diff --git a/src/posix/sdl/hardware.cpp b/src/posix/sdl/hardware.cpp index cb9a24967..362fadc54 100644 --- a/src/posix/sdl/hardware.cpp +++ b/src/posix/sdl/hardware.cpp @@ -56,6 +56,8 @@ EXTERN_CVAR (Bool, fullscreen) EXTERN_CVAR (Bool, swtruecolor) EXTERN_CVAR (Float, vid_winscale) +CVAR (Bool, vid_sdl, 0, 0); + IVideo *Video; extern int NewWidth, NewHeight, NewBits, DisplayBits; @@ -120,7 +122,7 @@ void I_InitGraphics () ticker.SetGenericRepDefault (val, CVAR_Bool); //currentrenderer = vid_renderer; - if (currentrenderer==1) Video = new SDLGLVideo(0); + if (currentrenderer==1 || vid_sdl==0) Video = new SDLGLVideo(0); else Video = new SDLVideo (0); if (Video == NULL) diff --git a/src/posix/sdl/sdlglvideo.cpp b/src/posix/sdl/sdlglvideo.cpp index 58cfc9a23..a07f7c0f5 100644 --- a/src/posix/sdl/sdlglvideo.cpp +++ b/src/posix/sdl/sdlglvideo.cpp @@ -52,6 +52,8 @@ EXTERN_CVAR (Int, vid_renderer) EXTERN_CVAR (Int, vid_maxfps) EXTERN_CVAR (Bool, cl_capfps) +DFrameBuffer *CreateGLSWFrameBuffer(int width, int height, bool fullscreen); + // PUBLIC DATA DEFINITIONS ------------------------------------------------- CUSTOM_CVAR(Bool, gl_debug, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) @@ -194,7 +196,12 @@ DFrameBuffer *SDLGLVideo::CreateFrameBuffer (int width, int height, bool bgra, b // flashAmount = 0; } - SDLGLFB *fb = new OpenGLFrameBuffer (0, width, height, 32, 60, fullscreen); + SDLGLFB *fb; + if (vid_renderer == 1) + fb = new OpenGLFrameBuffer (0, width, height, 32, 60, fullscreen); + else + fb = (SDLGLFB*)CreateGLSWFrameBuffer (width, height, fullscreen); + retry = 0; // If we could not create the framebuffer, try again with slightly