Merge pull request #1154 from 0lvin/sdl2_soft_fix

soft: fix texture lock
This commit is contained in:
Yamagi 2024-10-26 16:03:16 +02:00 committed by GitHub
commit b134bb1770
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2194,7 +2194,11 @@ RE_CleanFrame(void)
memset(swap_buffers, 0, memset(swap_buffers, 0,
vid_buffer_height * vid_buffer_width * sizeof(pixel_t) * 2); vid_buffer_height * vid_buffer_width * sizeof(pixel_t) * 2);
#ifdef USE_SDL3
if (!SDL_LockTexture(texture, NULL, (void**)&pixels, &pitch)) if (!SDL_LockTexture(texture, NULL, (void**)&pixels, &pitch))
#else
if (SDL_LockTexture(texture, NULL, (void**)&pixels, &pitch))
#endif
{ {
Com_Printf("Can't lock texture: %s\n", SDL_GetError()); Com_Printf("Can't lock texture: %s\n", SDL_GetError());
return; return;
@ -2214,7 +2218,11 @@ RE_FlushFrame(int vmin, int vmax)
int pitch; int pitch;
Uint32 *pixels; Uint32 *pixels;
#ifdef USE_SDL3
if (!SDL_LockTexture(texture, NULL, (void**)&pixels, &pitch)) if (!SDL_LockTexture(texture, NULL, (void**)&pixels, &pitch))
#else
if (SDL_LockTexture(texture, NULL, (void**)&pixels, &pitch))
#endif
{ {
Com_Printf("Can't lock texture: %s\n", SDL_GetError()); Com_Printf("Can't lock texture: %s\n", SDL_GetError());
return; return;