mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 02:25:32 -04:00
Don't unset fullscreen before going into fullscreen
This commit is contained in:
parent
034a2fddae
commit
004b1b95d1
18
src/Window.c
18
src/Window.c
@ -2258,7 +2258,6 @@ void Window_FreeFramebuffer(Bitmap* bmp) {
|
|||||||
#include <AGL/agl.h>
|
#include <AGL/agl.h>
|
||||||
|
|
||||||
static AGLContext ctx_handle;
|
static AGLContext ctx_handle;
|
||||||
static bool ctx_firstFullscreen;
|
|
||||||
static int ctx_windowWidth, ctx_windowHeight;
|
static int ctx_windowWidth, ctx_windowHeight;
|
||||||
|
|
||||||
static void GLContext_Check(int code, const char* place) {
|
static void GLContext_Check(int code, const char* place) {
|
||||||
@ -2323,16 +2322,6 @@ static void GLContext_SetFullscreen(void) {
|
|||||||
GLContext_Check(code, "aglSetFullScreen");
|
GLContext_Check(code, "aglSetFullScreen");
|
||||||
GLContext_MakeCurrent();
|
GLContext_MakeCurrent();
|
||||||
|
|
||||||
/* This is a weird hack to workaround a bug where the first time a context */
|
|
||||||
/* is made fullscreen, we just end up with a blank screen. So we undo it as fullscreen */
|
|
||||||
/* and redo it as fullscreen. */
|
|
||||||
if (!ctx_firstFullscreen) {
|
|
||||||
ctx_firstFullscreen = true;
|
|
||||||
GLContext_UnsetFullscreen();
|
|
||||||
GLContext_SetFullscreen();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
win_fullscreen = true;
|
win_fullscreen = true;
|
||||||
ctx_windowWidth = Window_Width;
|
ctx_windowWidth = Window_Width;
|
||||||
ctx_windowHeight = Window_Height;
|
ctx_windowHeight = Window_Height;
|
||||||
@ -2373,15 +2362,10 @@ void GLContext_Init(struct GraphicsMode* mode) {
|
|||||||
GLContext_Check(0, "Destroying pixel format");
|
GLContext_Check(0, "Destroying pixel format");
|
||||||
|
|
||||||
GLContext_SetDrawable();
|
GLContext_SetDrawable();
|
||||||
GLContext_Update();
|
|
||||||
GLContext_MakeCurrent();
|
GLContext_MakeCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLContext_Update(void) {
|
void GLContext_Update(void) { aglUpdateContext(ctx_handle); }
|
||||||
if (win_fullscreen) return;
|
|
||||||
GLContext_SetDrawable();
|
|
||||||
aglUpdateContext(ctx_handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLContext_Free(void) {
|
void GLContext_Free(void) {
|
||||||
if (!ctx_handle) return;
|
if (!ctx_handle) return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user