Skip to content
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

Support for decimal positions and sizes, window position control, and on_quit callback #126

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

LukeBorowy
Copy link

@LukeBorowy LukeBorowy commented Dec 28, 2020

I added the ability to set images, sprites, and text to be positioned and scaled using decimal (GLfloat) values, for a much smoother experience when moving and resizing.

I also added a on_close callback to the window, to allow applications to confirm closing and do cleanup.
Added positional control for where the window is created.
Also made a num_images member on the sprite struct, to allow easier control of sprites by the user, even though it is not used internally.

Added the key's scancode to the S2D events for keys in the value field.

And I added these things to the docs in the Readme.md.

I also made a small but very effective change to not flush the vertex buffer if it is empty. This way if only images are being drawn no time is wasted trying to flush an empty buffer. In my app it almost doubled FPS. If there are triangles, the z ordering is still conserved like normal.

There should be no breaking changes to the library, just some added features.

… position controls, and a handy num_images member for S2D_Sprite
…but realized it was useless since it is hardware-dependent. The `key` part of the event is sufficient.
This reverts commit a33b1df. Because actually the keysym scancode *is* useful, I am using it to keep track of an array of keys, and since it is a number it can be used as an index.
…y. In my app it almost doubled FPS. If there *are* triangles, the z ordering is still conserved like normal.
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.

None yet

1 participant