Open
Conversation
ccawley2011
reviewed
Aug 20, 2025
Comment on lines
+230
to
+231
| r_Event e; | ||
| while (r_PollEvent(&e)) { |
There was a problem hiding this comment.
I'd suggest moving all of the event code into renderer.c to reduce the amount of abstraction required.
| # ifdef SDL3_RENDERER | ||
| return r_key_map[event.key.scancode]; | ||
| # else | ||
| return r_key_map[event.key.keysym.sym & 0xff]; |
There was a problem hiding this comment.
It might be simplest to use scancodes with both SDL2 and SDL3.
Comment on lines
+29
to
+35
| SDL_Init( | ||
| #ifdef SDL3_RENDERER | ||
| 0 | ||
| #else | ||
| SDL_INIT_EVERYTHING | ||
| #endif | ||
| ); |
There was a problem hiding this comment.
Suggested change
| SDL_Init( | |
| #ifdef SDL3_RENDERER | |
| 0 | |
| #else | |
| SDL_INIT_EVERYTHING | |
| #endif | |
| ); | |
| SDL_Init(SDL_INIT_VIDEO); |
Comment on lines
-23
to
+47
| window = SDL_CreateWindow( | ||
| NULL, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, | ||
| window = SDL_CreateWindow(NULL, | ||
| #ifndef SDL3_RENDERER | ||
| SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, | ||
| #endif | ||
| width, height, SDL_WINDOW_OPENGL); | ||
|
|
||
| #ifdef SDL3_RENDERER | ||
| /* init SDL text input (for R_EV_TEXTINPUT event) */ | ||
| SDL_StartTextInput(window); | ||
| #endif |
There was a problem hiding this comment.
This might be slightly more readable with a single ifdef.
|
there has been a new community fork of this repository. the community is looking to add some new simple features. please feel free to try your PR over there. |
This file contains hidden or 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
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.
These 3 commits:
./build.sh sdl3