Compare commits

...
2 Commits
Author SHA1 Message Date
Themaister bce679df78 Only use hack on X when in windowed mode. 2011-08-16 10:26:36 +02:00
Themaister 22e8c3d895 Should fix breakage of OGL on OSX. 2011-08-15 22:21:50 +02:00
3 changed files with 10 additions and 12 deletions

No files matched your search

+2 -11
View File
@@ -116,17 +116,9 @@ void gfx_set_dwm(void)
#include "SDL_syswm.h"
#include "SDL.h"
#if !defined(__APPLE__) && !defined(_WIN32)
void gfx_get_window_size(unsigned *width, unsigned *height)
{
#if defined(__APPLE__) || defined(_WIN32)
SDL_Event evnt;
while (SDL_PollEvent(&evnt));
const SDL_VideoInfo *info = SDL_GetVideoInfo();
*width = info->current_w;
*height = info->current_h;
#else
// It seems that we need to go hardcore to get the actual
// window sizes properly right after startup ... :D
SDL_SysWMinfo info;
SDL_VERSION(&info.version);
SDL_GetWMInfo(&info);
@@ -138,6 +130,5 @@ void gfx_get_window_size(unsigned *width, unsigned *height)
*width = target.width;
*height = target.height;
#endif
}
#endif
+2
View File
@@ -28,6 +28,8 @@ void gfx_window_title_reset(void);
void gfx_set_dwm(void);
#endif
#if !defined(__APPLE__) && !defined(_WIN32)
void gfx_get_window_size(unsigned *width, unsigned *height);
#endif
#endif
+6 -1
View File
@@ -147,6 +147,7 @@ typedef struct gl
bool should_resize;
bool quitting;
bool fullscreen;
bool keep_aspect;
unsigned full_x, full_y;
@@ -706,7 +707,9 @@ static void check_window(gl_t *gl)
}
}
if (!gl->should_resize)
#if !defined(__APPLE__) && !defined(_WIN32)
// Hack to workaround limitations in tiling WMs ...
if (!gl->should_resize && !gl->fullscreen)
{
unsigned new_width, new_height;
gfx_get_window_size(&new_width, &new_height);
@@ -718,6 +721,7 @@ static void check_window(gl_t *gl)
SSNES_LOG("GL: Verified window size: %u x %u\n", gl->win_width, gl->win_height);
}
}
#endif
}
static bool gl_frame(void *data, const void* frame, unsigned width, unsigned height, unsigned pitch, const char *msg)
@@ -1095,6 +1099,7 @@ static void* gl_init(const video_info_t *video, const input_driver_t **input, vo
}
gl->vsync = video->vsync;
gl->fullscreen = video->fullscreen;
int attr = 0;
SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL, &attr);
if (attr <= 0 && video->vsync)