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

try sdl3 #783

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

try sdl3 #783

wants to merge 9 commits into from

Conversation

briaguya-ai
Copy link
Collaborator

@briaguya-ai briaguya-ai commented Jan 5, 2025

Copy link
Collaborator Author

@briaguya-ai briaguya-ai left a 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
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

todo

Comment on lines +65 to +66
// todo: SDL_GameControllerHasLED() - replaced with SDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN
// if (SDL_GameControllerHasLED(controller)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

todo

Comment on lines +85 to +86
// todo: SDL_GameControllerHasRumble() - replaced with SDL_PROP_GAMEPAD_CAP_RUMBLE_BOOLEAN
// bool hasRumble = SDL_GameControllerHasRumble(controller);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

todo

Comment on lines +17 to +18
// todo: SDL_GameControllerHasLED() - replaced with SDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN
// if (!SDL_GameControllerHasLED(mController)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

todo

Comment on lines +48 to +54
// 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";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

todo

Comment on lines +255 to +266
/* 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) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

todo

Comment on lines +418 to +427
/* 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);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

todo

Comment on lines +474 to +484
/* 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);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

todo

Comment on lines +488 to +498
/* 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);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

todo

Comment on lines +16 to +24
/* 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);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

todo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant