mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-14 05:41:02 +00:00
sdl2: we have colored rects in gl now I guess
This commit is contained in:
parent
0a37bdf76d
commit
fea559398a
1 changed files with 8 additions and 9 deletions
|
@ -273,7 +273,7 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen)
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
else if (rendermode == render_opengl)
|
else if (rendermode == render_opengl)
|
||||||
{
|
{
|
||||||
if (sdlglcontext == 0)
|
if (sdlglcontext == NULL)
|
||||||
{
|
{
|
||||||
sdlglcontext = SDL_GL_CreateContext(window);
|
sdlglcontext = SDL_GL_CreateContext(window);
|
||||||
}
|
}
|
||||||
|
@ -1331,7 +1331,7 @@ void I_OsPolling(void)
|
||||||
//
|
//
|
||||||
void I_UpdateNoBlit(void)
|
void I_UpdateNoBlit(void)
|
||||||
{
|
{
|
||||||
if (!vidSurface)
|
if (rendermode == render_none)
|
||||||
return;
|
return;
|
||||||
if (exposevideo)
|
if (exposevideo)
|
||||||
{
|
{
|
||||||
|
@ -1339,13 +1339,12 @@ void I_UpdateNoBlit(void)
|
||||||
if (rendermode == render_opengl)
|
if (rendermode == render_opengl)
|
||||||
{
|
{
|
||||||
OglSdlFinishUpdate(cv_vidwait.value);
|
OglSdlFinishUpdate(cv_vidwait.value);
|
||||||
SDL_GL_SwapWindow(window);
|
SDL_RenderPresent(renderer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
if (rendermode == render_soft)
|
if (rendermode == render_soft)
|
||||||
{
|
{
|
||||||
SDL_RenderClear(renderer);
|
|
||||||
SDL_RenderCopy(renderer, texture, NULL, NULL);
|
SDL_RenderCopy(renderer, texture, NULL, NULL);
|
||||||
SDL_RenderPresent(renderer);
|
SDL_RenderPresent(renderer);
|
||||||
}
|
}
|
||||||
|
@ -1406,7 +1405,7 @@ static inline SDL_bool SDLmatchVideoformat(void)
|
||||||
//
|
//
|
||||||
void I_FinishUpdate(void)
|
void I_FinishUpdate(void)
|
||||||
{
|
{
|
||||||
if (!vidSurface)
|
if (rendermode == render_none)
|
||||||
return; //Alam: No software or OpenGl surface
|
return; //Alam: No software or OpenGl surface
|
||||||
|
|
||||||
if (I_SkipFrame())
|
if (I_SkipFrame())
|
||||||
|
@ -1437,7 +1436,6 @@ void I_FinishUpdate(void)
|
||||||
SDL_UpdateTexture(texture, NULL, vidSurface->pixels, realwidth * 4);
|
SDL_UpdateTexture(texture, NULL, vidSurface->pixels, realwidth * 4);
|
||||||
}
|
}
|
||||||
// Blit buffer to texture
|
// Blit buffer to texture
|
||||||
SDL_RenderClear(renderer);
|
|
||||||
SDL_RenderCopy(renderer, texture, NULL, NULL);
|
SDL_RenderCopy(renderer, texture, NULL, NULL);
|
||||||
SDL_RenderPresent(renderer);
|
SDL_RenderPresent(renderer);
|
||||||
}
|
}
|
||||||
|
@ -1446,6 +1444,7 @@ void I_FinishUpdate(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OglSdlFinishUpdate(cv_vidwait.value);
|
OglSdlFinishUpdate(cv_vidwait.value);
|
||||||
|
//SDL_RenderPresent(renderer);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
exposevideo = SDL_FALSE;
|
exposevideo = SDL_FALSE;
|
||||||
|
@ -1827,10 +1826,10 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen)
|
||||||
* We want at least 1 bit R, G, and B,
|
* We want at least 1 bit R, G, and B,
|
||||||
* and at least 16 bpp. Why 1 bit? May be more?
|
* and at least 16 bpp. Why 1 bit? May be more?
|
||||||
*/
|
*/
|
||||||
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 1);
|
/*SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 1);
|
||||||
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 1);
|
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 1);
|
||||||
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 1);
|
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 1);
|
||||||
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);*/
|
||||||
|
|
||||||
window = SDL_CreateWindow("SRB2", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
|
window = SDL_CreateWindow("SRB2", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
|
||||||
realwidth, realheight, flags | SDL_WINDOW_OPENGL);
|
realwidth, realheight, flags | SDL_WINDOW_OPENGL);
|
||||||
|
@ -1839,7 +1838,7 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen)
|
||||||
renderer = SDL_CreateRenderer(window, -1, 0);
|
renderer = SDL_CreateRenderer(window, -1, 0);
|
||||||
if (renderer != NULL)
|
if (renderer != NULL)
|
||||||
{
|
{
|
||||||
SDL_RenderSetLogicalSize(renderer, BASEVIDWIDTH, BASEVIDHEIGHT);
|
//SDL_RenderSetLogicalSize(renderer, BASEVIDWIDTH, BASEVIDHEIGHT);
|
||||||
sdlglcontext = SDL_GL_CreateContext(window);
|
sdlglcontext = SDL_GL_CreateContext(window);
|
||||||
}
|
}
|
||||||
else return SDL_FALSE;
|
else return SDL_FALSE;
|
||||||
|
|
Loading…
Reference in a new issue