-
Notifications
You must be signed in to change notification settings - Fork 86
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
try sdl3 #783
base: main
Are you sure you want to change the base?
try sdl3 #783
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added pr comments next to todos so they don't get lost
@@ -1,6 +1,8 @@ | |||
#include "SDLAudioPlayer.h" | |||
#include <spdlog/spdlog.h> | |||
|
|||
// todo: https://wiki.libsdl.org/SDL3/README/migration#sdl_audioh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo
// todo: SDL_GameControllerHasLED() - replaced with SDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN | ||
// if (SDL_GameControllerHasLED(controller)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo
// todo: SDL_GameControllerHasRumble() - replaced with SDL_PROP_GAMEPAD_CAP_RUMBLE_BOOLEAN | ||
// bool hasRumble = SDL_GameControllerHasRumble(controller); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo
// todo: SDL_GameControllerHasLED() - replaced with SDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN | ||
// if (!SDL_GameControllerHasLED(mController)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo
// todo: move a bunch of stuff in here over to use instance ids | ||
// char guidString[33]; // SDL_GUID_LENGTH + 1 for null terminator | ||
// SDL_GetJoystickGUIDForID() | ||
// SDL_GUIDToString(SDL_JoystickGetDeviceGUID(sdlIndex), guidString, sizeof(guidString)); | ||
// std::string sdlControllerName = SDL_GameControllerNameForIndex(sdlIndex) != nullptr | ||
// ? SDL_GameControllerNameForIndex(sdlIndex) | ||
// : "Game Controller"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo
/* todo: | ||
|
||
SDL_WINDOW_FULLSCREEN_DESKTOP has been removed, and you can call SDL_GetWindowFullscreenMode() | ||
to see whether an exclusive fullscreen mode will be used or the borderless fullscreen desktop mode | ||
will be used when the window is fullscreen. | ||
|
||
*/ | ||
|
||
if (SDL_SetWindowFullscreen(wnd, on)) { | ||
// on ? (CVarGetInteger(CVAR_SDL_WINDOWED_FULLSCREEN, 0) ? SDL_WINDOW_FULLSCREEN_DESKTOP | ||
// : SDL_WINDOW_FULLSCREEN) | ||
// : 0) >= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo
/* todo: | ||
|
||
SDL_RENDERER_ACCELERATED - all renderers except SDL_SOFTWARE_RENDERER are accelerated | ||
SDL_RENDERER_PRESENTVSYNC - replaced with SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER | ||
during renderer creation and SDL_PROP_RENDERER_VSYNC_NUMBER | ||
after renderer creation | ||
|
||
*/ | ||
|
||
renderer = SDL_CreateRenderer(wnd, nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo
/* todo: | ||
|
||
SDL_GetMouseState(), SDL_GetGlobalMouseState(), SDL_GetRelativeMouseState(), | ||
SDL_WarpMouseInWindow(), and SDL_WarpMouseGlobal() all use floating point mouse | ||
positions, to provide sub-pixel precision on platforms that support it. | ||
|
||
*/ | ||
static float fx, fy; | ||
SDL_GetMouseState(&fx, &fy); | ||
*x = static_cast<int>(fx); | ||
*y = static_cast<int>(fy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo
/* todo: | ||
|
||
SDL_GetMouseState(), SDL_GetGlobalMouseState(), SDL_GetRelativeMouseState(), | ||
SDL_WarpMouseInWindow(), and SDL_WarpMouseGlobal() all use floating point mouse | ||
positions, to provide sub-pixel precision on platforms that support it. | ||
|
||
*/ | ||
static float fx, fy; | ||
SDL_GetRelativeMouseState(&fx, &fy); | ||
*x = static_cast<int>(fx); | ||
*y = static_cast<int>(fy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo
/* todo: | ||
The callback passed to SDL_AddTimer() has changed parameters to: | ||
Uint32 SDLCALL TimerCallback(void *userdata, SDL_TimerID timerID, Uint32 interval); | ||
*/ | ||
|
||
// SDL_AddTimer(16, &__lusViCallback, NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo
overall todo list on the soh PR
sdl migration guide https://wiki.libsdl.org/SDL3/README/migration