- removed the hard screen resolution switch that still was present on Windows and cleaned up the entire video backend code from the remaining support code for this.
Like Linux and macOS this will only support borderless fullscreen in the active desktop resolution now, which is what modern systems need. The list of discrete resolutions has been removed as it makes no sense anymore with a fixed video mode - all the other scaling options remain active, though.
This commit is contained in:
parent
322488d1d1
commit
b65b83edb3
28 changed files with 143 additions and 1826 deletions
|
|
@ -40,7 +40,7 @@ class SystemFrameBuffer : public DFrameBuffer
|
|||
{
|
||||
public:
|
||||
// This must have the same parameters as the Windows version, even if they are not used!
|
||||
SystemFrameBuffer(void *hMonitor, int width, int height, int, int, bool fullscreen, bool bgra);
|
||||
SystemFrameBuffer(void *hMonitor, bool fullscreen);
|
||||
~SystemFrameBuffer();
|
||||
|
||||
virtual bool IsFullscreen();
|
||||
|
|
@ -49,8 +49,6 @@ public:
|
|||
int GetClientWidth();
|
||||
int GetClientHeight();
|
||||
|
||||
virtual int GetTrueHeight() { return GetClientHeight(); }
|
||||
|
||||
protected:
|
||||
bool UpdatePending;
|
||||
|
||||
|
|
|
|||
|
|
@ -489,7 +489,8 @@ void NSEventToGameMousePosition(NSEvent* inEvent, event_t* outEvent)
|
|||
|
||||
// Compensate letterbox adjustment done by cross-platform code
|
||||
// More elegant solution is a bit problematic due to HiDPI/Retina support
|
||||
outEvent->data2 += (screen->GetTrueHeight() - screen->VideoHeight) / 2;
|
||||
// What does this do? Add 0?
|
||||
//outEvent->data2 += (screen->GetTrueHeight() - screen->ClientHeight()) / 2;
|
||||
|
||||
screen->ScaleCoordsFromWindow(outEvent->data1, outEvent->data2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,20 +92,9 @@
|
|||
|
||||
DFrameBuffer *CreateGLSWFrameBuffer(int width, int height, bool bgra, bool fullscreen);
|
||||
|
||||
EXTERN_CVAR(Bool, ticker )
|
||||
EXTERN_CVAR(Bool, vid_vsync)
|
||||
EXTERN_CVAR(Bool, vid_hidpi)
|
||||
|
||||
CUSTOM_CVAR(Bool, fullscreen, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||
{
|
||||
extern int NewWidth, NewHeight, NewBits, DisplayBits;
|
||||
|
||||
NewWidth = screen->VideoWidth;
|
||||
NewHeight = screen->VideoHeight;
|
||||
NewBits = DisplayBits;
|
||||
setmodeneeded = true;
|
||||
}
|
||||
|
||||
CUSTOM_CVAR(Bool, vid_autoswitch, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
|
||||
{
|
||||
Printf("You must restart " GAMENAME " to apply graphics switching mode\n");
|
||||
|
|
@ -215,13 +204,7 @@ class CocoaVideo : public IVideo
|
|||
public:
|
||||
CocoaVideo();
|
||||
|
||||
virtual EDisplayType GetDisplayType() { return DISPLAY_Both; }
|
||||
virtual void SetWindowedScale(float scale);
|
||||
|
||||
virtual DFrameBuffer* CreateFrameBuffer(int width, int height, bool bgra, bool fs, DFrameBuffer* old);
|
||||
|
||||
virtual void StartModeIterator(int bits, bool fullscreen);
|
||||
virtual bool NextMode(int* width, int* height, bool* letterbox);
|
||||
virtual DFrameBuffer* CreateFrameBuffer();
|
||||
|
||||
static bool IsFullscreen();
|
||||
static void UseHiDPI(bool hiDPI);
|
||||
|
|
@ -230,15 +213,6 @@ public:
|
|||
static void SetWindowTitle(const char* title);
|
||||
|
||||
private:
|
||||
struct ModeIterator
|
||||
{
|
||||
size_t index;
|
||||
int bits;
|
||||
bool fullscreen;
|
||||
};
|
||||
|
||||
ModeIterator m_modeIterator;
|
||||
|
||||
CocoaWindow* m_window;
|
||||
|
||||
int m_width;
|
||||
|
|
@ -394,75 +368,14 @@ CocoaVideo::CocoaVideo()
|
|||
FConsoleWindow::GetInstance().Show(false);
|
||||
}
|
||||
|
||||
void CocoaVideo::StartModeIterator(const int bits, const bool fullscreen)
|
||||
{
|
||||
m_modeIterator.index = 0;
|
||||
m_modeIterator.bits = bits;
|
||||
m_modeIterator.fullscreen = fullscreen;
|
||||
}
|
||||
|
||||
bool CocoaVideo::NextMode(int* const width, int* const height, bool* const letterbox)
|
||||
{
|
||||
assert(NULL != width);
|
||||
assert(NULL != height);
|
||||
|
||||
const int bits = m_modeIterator.bits;
|
||||
|
||||
if (8 != bits && 16 != bits && 24 != bits && 32 != bits)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t& index = m_modeIterator.index;
|
||||
|
||||
if (index < sizeof(VideoModes) / sizeof(VideoModes[0]))
|
||||
{
|
||||
*width = VideoModes[index].width;
|
||||
*height = VideoModes[index].height;
|
||||
|
||||
if (m_modeIterator.fullscreen && NULL != letterbox)
|
||||
{
|
||||
const NSSize screenSize = [[m_window screen] frame].size;
|
||||
const float screenRatio = screenSize.width / screenSize.height;
|
||||
const float modeRatio = float(*width) / *height;
|
||||
|
||||
*letterbox = fabs(screenRatio - modeRatio) > 0.001f;
|
||||
}
|
||||
|
||||
++index;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
DFrameBuffer* CocoaVideo::CreateFrameBuffer(const int width, const int height, const bool bgra, const bool fullscreen, DFrameBuffer* const old)
|
||||
DFrameBuffer* CocoaVideo::CreateFrameBuffer()
|
||||
{
|
||||
PalEntry flashColor = 0;
|
||||
int flashAmount = 0;
|
||||
|
||||
if (NULL != old)
|
||||
{
|
||||
if (width == m_width && height == m_height && bgra == m_bgra)
|
||||
{
|
||||
SetMode(width, height, fullscreen, bgra, vid_hidpi);
|
||||
return old;
|
||||
}
|
||||
|
||||
old->GetFlash(flashColor, flashAmount);
|
||||
|
||||
if (old == screen)
|
||||
{
|
||||
screen = NULL;
|
||||
}
|
||||
|
||||
delete old;
|
||||
}
|
||||
|
||||
DFrameBuffer* fb = NULL;
|
||||
|
||||
fb = new OpenGLFrameBuffer(NULL, width, height, 32, 60, fullscreen);
|
||||
fb = new OpenGLFrameBuffer(NULL, fullscreen);
|
||||
|
||||
fb->SetFlash(flashColor, flashAmount);
|
||||
|
||||
|
|
@ -471,11 +384,6 @@ DFrameBuffer* CocoaVideo::CreateFrameBuffer(const int width, const int height, c
|
|||
return fb;
|
||||
}
|
||||
|
||||
void CocoaVideo::SetWindowedScale(float scale)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool CocoaVideo::IsFullscreen()
|
||||
{
|
||||
CocoaVideo* const video = GetInstance();
|
||||
|
|
@ -628,8 +536,8 @@ CocoaVideo* CocoaVideo::GetInstance()
|
|||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
SystemFrameBuffer::SystemFrameBuffer(void*, const int width, const int height, int, int, const bool fullscreen, bool bgra)
|
||||
: DFrameBuffer(width, height, bgra)
|
||||
SystemFrameBuffer::SystemFrameBuffer(void*, const bool fullscreen)
|
||||
: DFrameBuffer(vid_defwidth, vid_defheight)
|
||||
, UpdatePending(false)
|
||||
{
|
||||
CGGammaValue gammaTable[GAMMA_TABLE_SIZE];
|
||||
|
|
@ -743,21 +651,11 @@ void I_ShutdownGraphics()
|
|||
|
||||
void I_InitGraphics()
|
||||
{
|
||||
UCVarValue val;
|
||||
|
||||
val.Bool = !!Args->CheckParm("-devparm");
|
||||
ticker.SetGenericRepDefault(val, CVAR_Bool);
|
||||
|
||||
Video = new CocoaVideo;
|
||||
atterm(I_ShutdownGraphics);
|
||||
}
|
||||
|
||||
|
||||
DFrameBuffer* I_SetMode(int &width, int &height, DFrameBuffer* old)
|
||||
{
|
||||
return Video->CreateFrameBuffer(width, height, false, fullscreen, old);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
|
@ -779,40 +677,6 @@ CUSTOM_CVAR(Bool, vid_hidpi, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
|||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
CCMD(vid_listmodes)
|
||||
{
|
||||
if (Video == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static const char* const ratios[7] = { "", " - 16:9", " - 16:10", " - 17:10", " - 5:4", "", " - 21:9" };
|
||||
int width, height;
|
||||
bool letterbox;
|
||||
|
||||
Video->StartModeIterator(32, screen->IsFullscreen());
|
||||
|
||||
while (Video->NextMode(&width, &height, &letterbox))
|
||||
{
|
||||
const bool current = width == DisplayWidth && height == DisplayHeight;
|
||||
const int ratio = CheckRatio(width, height);
|
||||
|
||||
Printf(current ? PRINT_BOLD : PRINT_HIGH, "%s%4d x%5d x%3d%s%s\n",
|
||||
current || !(ratio & 3) ? "" : TEXTCOLOR_GOLD,
|
||||
width, height, 32, ratios[ratio],
|
||||
current || !letterbox ? "" : TEXTCOLOR_BROWN " LB");
|
||||
}
|
||||
}
|
||||
|
||||
CCMD(vid_currentmode)
|
||||
{
|
||||
Printf("%dx%dx%d\n", DisplayWidth, DisplayHeight, DisplayBits);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
bool I_SetCursor(FTexture* cursorpic)
|
||||
{
|
||||
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
||||
|
|
|
|||
|
|
@ -66,30 +66,8 @@ typedef sem_t Semaphore;
|
|||
sem_init(&sem, shared, value);
|
||||
#endif
|
||||
|
||||
class IVideo
|
||||
{
|
||||
public:
|
||||
virtual ~IVideo () {}
|
||||
|
||||
virtual EDisplayType GetDisplayType () = 0;
|
||||
virtual void SetWindowedScale (float scale) = 0;
|
||||
|
||||
virtual DFrameBuffer *CreateFrameBuffer (int width, int height, bool bgra, bool fs, DFrameBuffer *old) = 0;
|
||||
|
||||
virtual void StartModeIterator (int bits, bool fs) = 0;
|
||||
virtual bool NextMode (int *width, int *height, bool *letterbox) = 0;
|
||||
|
||||
virtual bool SetResolution (int width, int height, int bits);
|
||||
|
||||
virtual void DumpAdapters();
|
||||
};
|
||||
|
||||
void I_InitGraphics ();
|
||||
void I_ShutdownGraphics ();
|
||||
|
||||
extern Semaphore FPSLimitSemaphore;
|
||||
void I_SetFPSLimit(int limit);
|
||||
|
||||
extern IVideo *Video;
|
||||
|
||||
#endif // __HARDWARE_H__
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class SystemFrameBuffer : public DFrameBuffer
|
|||
|
||||
public:
|
||||
// this must have the same parameters as the Windows version, even if they are not used!
|
||||
SystemFrameBuffer (void *hMonitor, int width, int height, int, int, bool fullscreen, bool bgra);
|
||||
SystemFrameBuffer (void *hMonitor, bool fullscreen);
|
||||
~SystemFrameBuffer ();
|
||||
|
||||
void ForceBuffering (bool force);
|
||||
|
|
@ -21,8 +21,6 @@ public:
|
|||
virtual void SetVSync( bool vsync );
|
||||
void SwapBuffers();
|
||||
|
||||
void NewRefreshRate ();
|
||||
|
||||
friend class SDLGLVideo;
|
||||
|
||||
int GetClientWidth();
|
||||
|
|
@ -30,8 +28,6 @@ public:
|
|||
|
||||
SDL_Window *GetSDLWindow() { return Screen; }
|
||||
|
||||
virtual int GetTrueHeight() { return GetClientHeight(); }
|
||||
|
||||
protected:
|
||||
void SetGammaTable(uint16_t *tbl);
|
||||
void ResetGammaTable();
|
||||
|
|
|
|||
|
|
@ -42,14 +42,10 @@
|
|||
#include "m_argv.h"
|
||||
#include "swrenderer/r_swrenderer.h"
|
||||
|
||||
EXTERN_CVAR (Bool, ticker)
|
||||
EXTERN_CVAR (Bool, fullscreen)
|
||||
EXTERN_CVAR (Float, vid_winscale)
|
||||
|
||||
IVideo *Video;
|
||||
|
||||
extern int NewWidth, NewHeight, NewBits, DisplayBits;
|
||||
bool V_DoModeSetup (int width, int height, int bits);
|
||||
void I_RestartRenderer();
|
||||
|
||||
|
||||
|
|
@ -77,11 +73,6 @@ void I_InitGraphics ()
|
|||
|
||||
Printf("Using video driver %s\n", SDL_GetCurrentVideoDriver());
|
||||
|
||||
UCVarValue val;
|
||||
|
||||
val.Bool = !!Args->CheckParm ("-devparm");
|
||||
ticker.SetGenericRepDefault (val, CVAR_Bool);
|
||||
|
||||
extern IVideo *gl_CreateVideo();
|
||||
Video = gl_CreateVideo();
|
||||
|
||||
|
|
@ -89,40 +80,12 @@ void I_InitGraphics ()
|
|||
I_FatalError ("Failed to initialize display");
|
||||
|
||||
atterm (I_ShutdownGraphics);
|
||||
|
||||
Video->SetWindowedScale (vid_winscale);
|
||||
}
|
||||
|
||||
/** Remaining code is common to Win32 and Linux **/
|
||||
|
||||
// VIDEO WRAPPERS ---------------------------------------------------------
|
||||
|
||||
DFrameBuffer *I_SetMode (int &width, int &height, DFrameBuffer *old)
|
||||
{
|
||||
bool fs = false;
|
||||
switch (Video->GetDisplayType ())
|
||||
{
|
||||
case DISPLAY_WindowOnly:
|
||||
fs = false;
|
||||
break;
|
||||
case DISPLAY_FullscreenOnly:
|
||||
fs = true;
|
||||
break;
|
||||
case DISPLAY_Both:
|
||||
fs = fullscreen;
|
||||
break;
|
||||
}
|
||||
DFrameBuffer *res = Video->CreateFrameBuffer (width, height, false, fs, old);
|
||||
|
||||
/* Right now, CreateFrameBuffer cannot return NULL
|
||||
if (res == NULL)
|
||||
{
|
||||
I_FatalError ("Mode %dx%d is unavailable\n", width, height);
|
||||
}
|
||||
*/
|
||||
return res;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// SetFPSLimit
|
||||
|
|
@ -197,62 +160,3 @@ void I_SetFPSLimit(int limit)
|
|||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
extern int NewWidth, NewHeight, NewBits, DisplayBits;
|
||||
|
||||
CUSTOM_CVAR (Bool, fullscreen, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL)
|
||||
{
|
||||
NewWidth = screen->VideoWidth;
|
||||
NewHeight = screen->VideoHeight;
|
||||
NewBits = DisplayBits;
|
||||
setmodeneeded = true;
|
||||
}
|
||||
|
||||
CUSTOM_CVAR (Float, vid_winscale, 1.f, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
{
|
||||
if (self < 1.f)
|
||||
{
|
||||
self = 1.f;
|
||||
}
|
||||
else if (Video)
|
||||
{
|
||||
Video->SetWindowedScale (self);
|
||||
NewWidth = screen->VideoWidth;
|
||||
NewHeight = screen->VideoHeight;
|
||||
NewBits = DisplayBits;
|
||||
setmodeneeded = true;
|
||||
}
|
||||
}
|
||||
|
||||
CCMD (vid_listmodes)
|
||||
{
|
||||
static const char *ratios[7] = { "", " - 16:9", " - 16:10", "", " - 5:4", "", " - 21:9" };
|
||||
int width, height, bits;
|
||||
bool letterbox;
|
||||
|
||||
if (Video == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (bits = 1; bits <= 32; bits++)
|
||||
{
|
||||
Video->StartModeIterator (bits, screen->IsFullscreen());
|
||||
while (Video->NextMode (&width, &height, &letterbox))
|
||||
{
|
||||
bool thisMode = (width == DisplayWidth && height == DisplayHeight && bits == DisplayBits);
|
||||
int ratio = CheckRatio (width, height);
|
||||
Printf (thisMode ? PRINT_BOLD : PRINT_HIGH,
|
||||
"%s%4d x%5d x%3d%s%s\n",
|
||||
thisMode || !IsRatioWidescreen(ratio) ? "" : TEXTCOLOR_GOLD,
|
||||
width, height, bits,
|
||||
ratios[ratio],
|
||||
thisMode || !letterbox ? "" : TEXTCOLOR_BROWN " LB"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CCMD (vid_currentmode)
|
||||
{
|
||||
Printf ("%dx%dx%d\n", DisplayWidth, DisplayHeight, DisplayBits);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,20 +93,9 @@ public:
|
|||
SDLGLVideo (int parm);
|
||||
~SDLGLVideo ();
|
||||
|
||||
EDisplayType GetDisplayType () { return DISPLAY_Both; }
|
||||
void SetWindowedScale (float scale);
|
||||
|
||||
DFrameBuffer *CreateFrameBuffer (int width, int height, bool bgra, bool fs, DFrameBuffer *old);
|
||||
|
||||
void StartModeIterator (int bits, bool fs);
|
||||
bool NextMode (int *width, int *height, bool *letterbox);
|
||||
bool SetResolution (int width, int height, int bits);
|
||||
DFrameBuffer *CreateFrameBuffer ();
|
||||
|
||||
void SetupPixelFormat(bool allowsoftware, int multisample, const int *glver);
|
||||
|
||||
private:
|
||||
int IteratorMode;
|
||||
int IteratorBits;
|
||||
};
|
||||
|
||||
// CODE --------------------------------------------------------------------
|
||||
|
|
@ -125,132 +114,13 @@ SDLGLVideo::~SDLGLVideo ()
|
|||
if (GLRenderer != NULL) GLRenderer->FlushTextures();
|
||||
}
|
||||
|
||||
void SDLGLVideo::StartModeIterator (int bits, bool fs)
|
||||
DFrameBuffer *SDLGLVideo::CreateFrameBuffer ()
|
||||
{
|
||||
IteratorMode = 0;
|
||||
IteratorBits = bits;
|
||||
}
|
||||
SystemFrameBuffer *fb = new OpenGLFrameBuffer(0, fullscreen);
|
||||
|
||||
bool SDLGLVideo::NextMode (int *width, int *height, bool *letterbox)
|
||||
{
|
||||
if (IteratorBits != 8)
|
||||
return false;
|
||||
|
||||
if ((unsigned)IteratorMode < sizeof(VideoModes)/sizeof(VideoModes[0]))
|
||||
{
|
||||
*width = VideoModes[IteratorMode].width;
|
||||
*height = VideoModes[IteratorMode].height;
|
||||
++IteratorMode;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
DFrameBuffer *SDLGLVideo::CreateFrameBuffer (int width, int height, bool bgra, bool fullscreen, DFrameBuffer *old)
|
||||
{
|
||||
static int retry = 0;
|
||||
static int owidth, oheight;
|
||||
|
||||
PalEntry flashColor;
|
||||
// int flashAmount;
|
||||
|
||||
if (old != NULL)
|
||||
{ // Reuse the old framebuffer if its attributes are the same
|
||||
SystemFrameBuffer *fb = static_cast<SystemFrameBuffer *> (old);
|
||||
if (fb->Width == width &&
|
||||
fb->Height == height)
|
||||
{
|
||||
bool fsnow = (SDL_GetWindowFlags (fb->GetSDLWindow()) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0;
|
||||
|
||||
if (fsnow != fullscreen)
|
||||
{
|
||||
SDL_SetWindowFullscreen (fb->GetSDLWindow(), fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0);
|
||||
}
|
||||
return old;
|
||||
}
|
||||
// old->GetFlash (flashColor, flashAmount);
|
||||
delete old;
|
||||
}
|
||||
else
|
||||
{
|
||||
flashColor = 0;
|
||||
// flashAmount = 0;
|
||||
}
|
||||
|
||||
SystemFrameBuffer *fb = new OpenGLFrameBuffer(0, width, height, 32, 60, fullscreen);
|
||||
|
||||
retry = 0;
|
||||
|
||||
// If we could not create the framebuffer, try again with slightly
|
||||
// different parameters in this order:
|
||||
// 1. Try with the closest size
|
||||
// 2. Try in the opposite screen mode with the original size
|
||||
// 3. Try in the opposite screen mode with the closest size
|
||||
// This is a somewhat confusing mass of recursion here.
|
||||
|
||||
while (fb == NULL)
|
||||
{
|
||||
switch (retry)
|
||||
{
|
||||
case 0:
|
||||
owidth = width;
|
||||
oheight = height;
|
||||
case 2:
|
||||
// Try a different resolution. Hopefully that will work.
|
||||
void V_ClosestResolution(int *, int *, int);
|
||||
V_ClosestResolution (&width, &height, 8);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
// Try changing fullscreen mode. Maybe that will work.
|
||||
width = owidth;
|
||||
height = oheight;
|
||||
fullscreen = !fullscreen;
|
||||
break;
|
||||
|
||||
default:
|
||||
// I give up!
|
||||
I_FatalError ("Could not create new screen (%d x %d)", owidth, oheight);
|
||||
|
||||
fprintf( stderr, "!!! [SDLGLVideo::CreateFrameBuffer] Got beyond I_FatalError !!!" );
|
||||
return NULL; //[C] actually this shouldn't be reached; probably should be replaced with an ASSERT
|
||||
}
|
||||
|
||||
++retry;
|
||||
fb = static_cast<SystemFrameBuffer *>(CreateFrameBuffer (width, height, false, fullscreen, NULL));
|
||||
}
|
||||
|
||||
// fb->SetFlash (flashColor, flashAmount);
|
||||
return fb;
|
||||
}
|
||||
|
||||
void SDLGLVideo::SetWindowedScale (float scale)
|
||||
{
|
||||
}
|
||||
|
||||
bool SDLGLVideo::SetResolution (int width, int height, int bits)
|
||||
{
|
||||
// FIXME: Is it possible to do this without completely destroying the old
|
||||
// interface?
|
||||
#ifndef NO_GL
|
||||
|
||||
if (GLRenderer != NULL) GLRenderer->FlushTextures();
|
||||
I_ShutdownGraphics();
|
||||
|
||||
Video = new SDLGLVideo(0);
|
||||
if (Video == NULL) I_FatalError ("Failed to initialize display");
|
||||
|
||||
#if (defined(WINDOWS)) || defined(WIN32)
|
||||
bits=32;
|
||||
#else
|
||||
bits=24;
|
||||
#endif
|
||||
|
||||
V_DoModeSetup(width, height, bits);
|
||||
#endif
|
||||
return true; // We must return true because the old video context no longer exists.
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
|
|
@ -302,8 +172,8 @@ IVideo *gl_CreateVideo()
|
|||
|
||||
// FrameBuffer implementation -----------------------------------------------
|
||||
|
||||
SystemFrameBuffer::SystemFrameBuffer (void *, int width, int height, int, int, bool fullscreen, bool bgra)
|
||||
: DFrameBuffer (width, height, bgra)
|
||||
SystemFrameBuffer::SystemFrameBuffer (void *, bool fullscreen)
|
||||
: DFrameBuffer (vid_defwidth, vid_defheight)
|
||||
{
|
||||
// NOTE: Core profiles were added with GL 3.2, so there's no sense trying
|
||||
// to set core 3.1 or 3.0. We could try a forward-compatible context
|
||||
|
|
@ -427,10 +297,6 @@ void SystemFrameBuffer::SetVSync( bool vsync )
|
|||
#endif
|
||||
}
|
||||
|
||||
void SystemFrameBuffer::NewRefreshRate ()
|
||||
{
|
||||
}
|
||||
|
||||
void SystemFrameBuffer::SwapBuffers()
|
||||
{
|
||||
#if !defined(__APPLE__) && !defined(__OpenBSD__)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue