diff options
Diffstat (limited to 'git-37321d1.patch')
-rw-r--r-- | git-37321d1.patch | 182 |
1 files changed, 0 insertions, 182 deletions
diff --git a/git-37321d1.patch b/git-37321d1.patch deleted file mode 100644 index f2f878f770b8..000000000000 --- a/git-37321d1.patch +++ /dev/null @@ -1,182 +0,0 @@ -From 37321d1d483cee0c01285774921fb861bd6f9c1e Mon Sep 17 00:00:00 2001 -From: Edoardo Prezioso <edo88@email.it> -Date: Thu, 8 Jan 2015 00:23:14 +0100 -Subject: [PATCH] - Implement SDL2 into GZDoom (needs improvements). - -Make also minor fixes. -Now it compiles and runs fine for me, except for the invisible cursor in the menu (no idea why). ---- - src/posix/sdl/sdlglvideo.cpp | 67 ++++++++++++++++++++++++++------------------ - src/posix/sdl/sdlglvideo.h | 9 +++--- - 2 files changed, 44 insertions(+), 32 deletions(-) - -diff --git a/src/posix/sdl/sdlglvideo.cpp b/src/posix/sdl/sdlglvideo.cpp -index 649989e..9331c0f 100644 ---- a/src/posix/sdl/sdlglvideo.cpp -+++ b/src/posix/sdl/sdlglvideo.cpp -@@ -1,8 +1,6 @@ - - // HEADER FILES ------------------------------------------------------------ - --#include <iostream> -- - #include "doomtype.h" - - #include "templates.h" -@@ -48,6 +46,7 @@ extern IVideo *Video; - // extern int vid_renderer; - - EXTERN_CVAR (Float, Gamma) -+EXTERN_CVAR (Int, vid_adapter) - EXTERN_CVAR (Int, vid_displaybits) - EXTERN_CVAR (Int, vid_renderer) - -@@ -156,14 +155,19 @@ bool SDLGLVideo::NextMode (int *width, int *height, bool *letterbox) - } - else - { -- SDL_Rect **modes = SDL_ListModes (NULL, SDL_FULLSCREEN|SDL_HWSURFACE); -- if (modes != NULL && modes[IteratorMode] != NULL) -+ SDL_DisplayMode mode = {}, oldmode = {}; -+ if(IteratorMode != 0) -+ SDL_GetDisplayMode(vid_adapter, IteratorMode-1, &oldmode); -+ do - { -- *width = modes[IteratorMode]->w; -- *height = modes[IteratorMode]->h; -+ if (SDL_GetDisplayMode(vid_adapter, IteratorMode, &mode) != 0) -+ return false; - ++IteratorMode; -- return true; -- } -+ } while(mode.w == oldmode.w && mode.h == oldmode.h); -+ -+ *width = mode.w; -+ *height = mode.h; -+ return true; - } - return false; - } -@@ -182,11 +186,11 @@ DFrameBuffer *SDLGLVideo::CreateFrameBuffer (int width, int height, bool fullscr - if (fb->Width == width && - fb->Height == height) - { -- bool fsnow = (fb->Screen->flags & SDL_FULLSCREEN) != 0; -+ bool fsnow = (SDL_GetWindowFlags (fb->Screen) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0; - - if (fsnow != fullscreen) - { -- SDL_WM_ToggleFullScreen (fb->Screen); -+ SDL_SetWindowFullscreen (fb->Screen, fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); - } - return old; - } -@@ -336,30 +340,37 @@ SDLGLFB::SDLGLFB (void *, int width, int height, int, int, bool fullscreen) - return; - } - -- -- Screen = SDL_SetVideoMode (width, height, -- 32, -- SDL_HWSURFACE|SDL_HWPALETTE|SDL_OPENGL | SDL_GL_DOUBLEBUFFER|SDL_ANYFORMAT| -- (fullscreen ? SDL_FULLSCREEN : 0)); -+ FString caption; -+ caption.Format(GAMESIG " %s (%s)", GetVersionString(), GetGitTime()); -+ Screen = SDL_CreateWindow (caption, -+ SDL_WINDOWPOS_UNDEFINED_DISPLAY(vid_adapter), SDL_WINDOWPOS_UNDEFINED_DISPLAY(vid_adapter), -+ width, height, (fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0)|SDL_WINDOW_OPENGL); - - if (Screen == NULL) - return; - -- m_supportsGamma = -1 != SDL_GetGammaRamp(m_origGamma[0], m_origGamma[1], m_origGamma[2]); -- --#if defined(__APPLE__) -- // Need to set title here because a window is not created yet when calling the same function from main() -- char caption[100]; -- mysnprintf(caption, countof(caption), GAMESIG " %s (%s)", GetVersionString(), GetGitTime()); -- SDL_WM_SetCaption(caption, NULL); --#endif // __APPLE__ -+ GLContext = SDL_GL_CreateContext(Screen); -+ if (GLContext == NULL) -+ return; -+ -+ m_supportsGamma = -1 != SDL_GetWindowGammaRamp(Screen, m_origGamma[0], m_origGamma[1], m_origGamma[2]); - } - - SDLGLFB::~SDLGLFB () - { -- if (m_supportsGamma) -+ if (Screen) - { -- SDL_SetGammaRamp(m_origGamma[0], m_origGamma[1], m_origGamma[2]); -+ if (m_supportsGamma) -+ { -+ SDL_SetWindowGammaRamp(Screen, m_origGamma[0], m_origGamma[1], m_origGamma[2]); -+ } -+ -+ if (GLContext) -+ { -+ SDL_GL_DeleteContext(GLContext); -+ } -+ -+ SDL_DestroyWindow(Screen); - } - } - -@@ -386,7 +397,7 @@ bool SDLGLFB::CanUpdate () - - void SDLGLFB::SetGammaTable(WORD *tbl) - { -- SDL_SetGammaRamp(&tbl[0], &tbl[256], &tbl[512]); -+ SDL_SetWindowGammaRamp(Screen, &tbl[0], &tbl[256], &tbl[512]); - } - - bool SDLGLFB::Lock(bool buffered) -@@ -420,7 +431,7 @@ bool SDLGLFB::IsLocked () - - bool SDLGLFB::IsFullscreen () - { -- return (Screen->flags & SDL_FULLSCREEN) != 0; -+ return (SDL_GetWindowFlags (Screen) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0; - } - - -@@ -443,6 +454,6 @@ void SDLGLFB::NewRefreshRate () - - void SDLGLFB::SwapBuffers() - { -- SDL_GL_SwapBuffers (); -+ SDL_GL_SwapWindow (Screen); - } - -diff --git a/src/posix/sdl/sdlglvideo.h b/src/posix/sdl/sdlglvideo.h -index 205e416..3867be6 100644 ---- a/src/posix/sdl/sdlglvideo.h -+++ b/src/posix/sdl/sdlglvideo.h -@@ -3,7 +3,6 @@ - - #include "hardware.h" - #include "v_video.h" --#include <SDL.h> - #include "gl/system/gl_system.h" - - EXTERN_CVAR (Float, dimamount) -@@ -70,9 +69,11 @@ protected: - SDLGLFB () {} - BYTE GammaTable[3][256]; - bool UpdatePending; -- -- SDL_Surface *Screen; -- -+ -+ SDL_Window *Screen; -+ -+ SDL_GLContext GLContext; -+ - void UpdateColors (); - - int m_Lock; --- -2.3.2 - |