Skip to content

Conversation

@lessthen3
Copy link

added new demo headers that are updated to SDL3 and have been confirmed to compile and run appropriately on my machine.

added new demo headers that are updated to SDL3 and have been confirmed to compile and run appropriately on my machine.
added detection for L and R CTRL
added L and R CTRL support
@riri
Copy link
Contributor

riri commented Nov 23, 2024

Please move your updated demos to sdl3_* and keep the original sdl_* (or rename to sdl2_*) : SDL3 is still preview and many still rely on SDL2.

Comment on lines 244 to 245
vertices = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);
elements = glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY);
Copy link

Choose a reason for hiding this comment

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

On my machine compiling for Emscripten results in undefined glMapBuffer() behavior. Replacing it with glMapBufferRange() works and looks like result is consistent.

vertices =
        glMapBufferRange(GL_ARRAY_BUFFER, 0, max_vertex_buffer,
                         GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);
elements =
        glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER, 0, max_element_buffer,
                         GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);

Copy link
Author

Choose a reason for hiding this comment

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

hm that's strange, I'll take another look at the code and make the suggested changes

@RobLoach RobLoach mentioned this pull request Jan 5, 2025
@lessthen3
Copy link
Author

Please move your updated demos to sdl3_* and keep the original sdl_* (or rename to sdl2_*) : SDL3 is still preview and many still rely on SDL2.

Yeah sure I'll reorganize the directory.

I'm not sure how to rewrite the makefile though, I use Windows mainly so I usually use CMake. Could you help me with that?

-changed directory structure to be more in line with current style

-implemented map buffer change for better emscripten support

-changed header guards and define names to reflect SDL3 opposed to SDL2
@lessthen3
Copy link
Author

I think I fixed the commit and I did test the changes on my machine to make sure it still compiles nicely.

However I have no idea if those Makefile changes for sdl3 work.

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.

3 participants