Skip to content

Adding support for OpenGL functions #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Adding support for OpenGL functions #270

wants to merge 2 commits into from

Conversation

kc7bfi
Copy link
Contributor

@kc7bfi kc7bfi commented Oct 2, 2013

I have added code to expose some of the OpenGL functions. This was motivated by a need to determine the number of nVidia adapters present on a system. I had to make some changes to WinGDI.java and GDI32.java. I'm not sure why the pull request is attempting to replace the entire file, it may be due to indentation issues. Hope this is not a problem. I also removed a debug statmenet in the WinRas which was previously submitted.
David

@dblock
Copy link
Member

dblock commented Oct 2, 2013

Yes, the PR changes are all about tabs vs. spaces, check what the JNA code is and change your editor to those. It would be helpful, otherwise it's really hard to see history. I think it's a 2 spaces tab, but I could be wrong.

Please update CHANGELOG.

public void testCountGpusNV() {
try {
OpenGL32Util.countGpusNV();
} catch (Exception e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a better exception we can catch here so that the test is properly ignored when you don't have an NVidia card?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exception is only if something goes wrong. If the nVidia extensions are not supported then 0 is returned.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is just to get the stacktrace? I think the test should expect that
function to return >= 0 and not catch any errors.

On Wed, Oct 2, 2013 at 12:34 PM, David Robison notifications@gh.loli.gardenwrote:

In contrib/platform/test/com/sun/jna/platform/win32/OpenGL32UtilTest.java:

+import junit.framework.TestCase;
+
+/**

  • public void testCountGpusNV() {
  •   try {
    
  •       OpenGL32Util.countGpusNV();
    
  •   } catch (Exception e) {
    

The exception is only if something goes wrong. If the nVidia extensions
are not supported then 0 is returned.


Reply to this email directly or view it on GitHubhttps://github.com//pull/270/files#r6720402
.

dB. | Moscow - Geneva - Seattle - New York
code.dblock.org - @dblockdotorg http://twitter.com/#!/dblockdotorg -
artsy.net - github/dblock https://github.com/dblock

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'll make the change. David

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I committed and pushed the change. Do I need to do anything with the pull request?

@dblock
Copy link
Member

dblock commented Oct 2, 2013

Code looks good otherwise, I'll merge after your changes.

@kc7bfi
Copy link
Contributor Author

kc7bfi commented Oct 2, 2013

I'm going to refork and retry the changes. It appears that my Eclipse was modifying the indentation/etc and I cannot seem to get back to where everything is as it was. Is there an easy way to restore my repository to the master without deleting and creating a new fork?

@dblock
Copy link
Member

dblock commented Oct 2, 2013

Backup the local git repo so you don't lose changes.

Then bring master back to be in sync with upstream JNA.

git remote add upstream git@github.com:twall/jna.git
git checkout master
git checkout -b opengl-try1 # new branch
git push origin opengl-try1 # push to github
git checkout master
git reset --hard HEAD~100 # reset 100 commits back
git pull upstream master # sync with master
git push origin master -f

Now you have a clean master and a opengl-try1 branch with your changes, next time create a new branch before committing anything with git checkout -b opengl-try2 for example.

@dblock
Copy link
Member

dblock commented Oct 6, 2013

Reopened as #280.

@dblock dblock closed this Oct 6, 2013
dblock added a commit that referenced this pull request Oct 7, 2013
mstyura pushed a commit to mstyura/jna that referenced this pull request Sep 9, 2024
…access#270)


Motivation:

When a stream receives a STOP_SENDING frame, it should be able to keep receiving data.

Modification:

Update QuicheQuicChannel.handleWritableStreams() to handle Quiche.QUICHE_ERR_STREAM_STOPPED
differently from other errors, and ignore it instead of throwing an exception and closing the stream.

Result:

Stream no longer gets closed and can receive more data.

Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants