Should fix breakage of OGL on OSX.

This commit is contained in:
Themaister 2011-08-15 22:21:50 +02:00
parent d2b06a92c5
commit 22e8c3d895
3 changed files with 7 additions and 2 deletions

View File

@ -116,9 +116,10 @@ void gfx_set_dwm(void)
#include "SDL_syswm.h" #include "SDL_syswm.h"
#include "SDL.h" #include "SDL.h"
#ifndef __APPLE__
void gfx_get_window_size(unsigned *width, unsigned *height) void gfx_get_window_size(unsigned *width, unsigned *height)
{ {
#if defined(__APPLE__) || defined(_WIN32) #ifdef _WIN32
SDL_Event evnt; SDL_Event evnt;
while (SDL_PollEvent(&evnt)); while (SDL_PollEvent(&evnt));
const SDL_VideoInfo *info = SDL_GetVideoInfo(); const SDL_VideoInfo *info = SDL_GetVideoInfo();
@ -140,4 +141,4 @@ void gfx_get_window_size(unsigned *width, unsigned *height)
*height = target.height; *height = target.height;
#endif #endif
} }
#endif

View File

@ -28,6 +28,8 @@ void gfx_window_title_reset(void);
void gfx_set_dwm(void); void gfx_set_dwm(void);
#endif #endif
#ifndef __APPLE__
void gfx_get_window_size(unsigned *width, unsigned *height); void gfx_get_window_size(unsigned *width, unsigned *height);
#endif
#endif #endif

View File

@ -706,6 +706,7 @@ static void check_window(gl_t *gl)
} }
} }
#ifndef __APPLE__ // This check breaks on OSX for some reason. Oh well :)
if (!gl->should_resize) if (!gl->should_resize)
{ {
unsigned new_width, new_height; unsigned new_width, new_height;
@ -718,6 +719,7 @@ static void check_window(gl_t *gl)
SSNES_LOG("GL: Verified window size: %u x %u\n", gl->win_width, gl->win_height); 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) static bool gl_frame(void *data, const void* frame, unsigned width, unsigned height, unsigned pitch, const char *msg)