forked from davidgfnet/opengx
-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
And glBitmap() and a few raster functions #74
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is now ready for review. |
The tables themselves are unused, for the time being.
Very primitive and slow implementation, but working.
Add support for GL_UNPACK_SKIP_ROWS, GL_UNPACK_SKIP_PIXELS and GL_UNPACK_ROW_LENGTH. The getter and setters for these options have been added some time ago, but we hadn't made use of their values yet.
It's unclear why this function exists, given that all attributes are booleans or integers, but let it be.
This will be used by glDrawPixels too.
Tested with the image.c example from Red Book 1.1: https://www.opengl.org/archives/resources/code/samples/redbook/image.c (just commented out the glCopyPixels() part, which is not implemented yet)
The transformation was incorrect, because it was causing the row 0 and the column 0 to fall outside of the screen: if we want the leftmost column of screen pixels to show the scene pixels having coordinate 0, then the left coordinate to guOrtho() must be -0.5, and in this way a scene pixel having 0 as the x coordinate will be centered on the leftmost pixel. For the rightmost column the computation was correct (the value we pass to guOrtho() must be 639.5, so we remove the -1 addend in order to maintain the old value.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://github.com/mardy/freeglut/blob/with-tutorials/tutorials/bitmap1.c