From 22e8c3d8959651309040e30fc521c81acce9f0b7 Mon Sep 17 00:00:00 2001 From: Themaister Date: Mon, 15 Aug 2011 22:21:50 +0200 Subject: [PATCH] Should fix breakage of OGL on OSX. --- gfx/gfx_common.c | 5 +++-- gfx/gfx_common.h | 2 ++ gfx/gl.c | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gfx/gfx_common.c b/gfx/gfx_common.c index 3ea403653b..307527cf92 100644 --- a/gfx/gfx_common.c +++ b/gfx/gfx_common.c @@ -116,9 +116,10 @@ void gfx_set_dwm(void) #include "SDL_syswm.h" #include "SDL.h" +#ifndef __APPLE__ void gfx_get_window_size(unsigned *width, unsigned *height) { -#if defined(__APPLE__) || defined(_WIN32) +#ifdef _WIN32 SDL_Event evnt; while (SDL_PollEvent(&evnt)); const SDL_VideoInfo *info = SDL_GetVideoInfo(); @@ -140,4 +141,4 @@ void gfx_get_window_size(unsigned *width, unsigned *height) *height = target.height; #endif } - +#endif diff --git a/gfx/gfx_common.h b/gfx/gfx_common.h index 5ffe52ea8a..d96d8c1ced 100644 --- a/gfx/gfx_common.h +++ b/gfx/gfx_common.h @@ -28,6 +28,8 @@ void gfx_window_title_reset(void); void gfx_set_dwm(void); #endif +#ifndef __APPLE__ void gfx_get_window_size(unsigned *width, unsigned *height); +#endif #endif diff --git a/gfx/gl.c b/gfx/gl.c index 9dc5141f86..39ed9f979f 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -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) { 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); } } +#endif } static bool gl_frame(void *data, const void* frame, unsigned width, unsigned height, unsigned pitch, const char *msg)