SDL3 return value fixes in gl1_sdl.c and gl3_sdl.c

and removed unused code from glimp_sdl3.c
This commit is contained in:
Daniel Gibson 2024-10-26 17:57:58 +02:00
parent b74d1a5247
commit 07ee830712
3 changed files with 12 additions and 8 deletions

View file

@ -104,7 +104,11 @@ int RI_PrepareForWindow(void)
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);
#ifdef USE_SDL3
if (SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8) == 0)
#else
if (SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8))
#endif
{
gl_state.stencil = true;
}
@ -294,7 +298,11 @@ int RI_InitContext(void* win)
if (gl_msaa_samples->value)
{
#ifdef USE_SDL3
if (SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &msaa_samples))
#else
if (SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &msaa_samples) == 0)
#endif
{
ri.Cvar_SetValue("r_msaa_samples", msaa_samples);
}

View file

@ -360,7 +360,11 @@ int GL3_InitContext(void* win)
if (gl_msaa_samples->value)
{
#ifdef USE_SDL3
if (SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &msaa_samples))
#else
if (SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &msaa_samples) == 0)
#endif
{
ri.Cvar_SetValue("r_msaa_samples", msaa_samples);
}

View file

@ -764,18 +764,10 @@ GLimp_GrabInput(qboolean grab)
SDL_SetWindowMouseGrab(window, grab ? true : false);
}
#ifdef USE_SDL3
if(!SDL_SetWindowRelativeMouseMode(window, grab ? true : false))
{
Com_Printf("WARNING: Setting Relative Mousemode failed, reason: %s\n", SDL_GetError());
}
#else
if(SDL_SetWindowRelativeMouseMode(window, grab ? true : false) < 0)
{
Com_Printf("WARNING: Setting Relative Mousemode failed, reason: %s\n", SDL_GetError());
Com_Printf(" You should probably update to SDL 2.0.3 or newer!\n");
}
#endif
}
/*