mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Guard SDL calls by USE_SDL define.
This commit is contained in:
parent
222accdd8d
commit
5856ec606e
|
@ -83,6 +83,9 @@ if(SDL)
|
|||
include(FindPkgConfig)
|
||||
pkg_check_modules(SDL REQUIRED sdl)
|
||||
include_directories(${SDL_INCLUDE_DIRS})
|
||||
add_definitions(
|
||||
-DUSE_SDL
|
||||
)
|
||||
endif(SDL)
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
|
|
@ -416,9 +416,8 @@ bool OGL_Start()
|
|||
OGL_Stop();
|
||||
return FALSE;
|
||||
}
|
||||
#else // _WINDOWS
|
||||
#elif defined(USE_SDL)
|
||||
// init sdl & gl
|
||||
const SDL_VideoInfo *videoInfo;
|
||||
Uint32 videoFlags = 0;
|
||||
|
||||
if (OGL.fullscreen)
|
||||
|
@ -442,6 +441,7 @@ bool OGL_Start()
|
|||
}
|
||||
|
||||
/* Video Info */
|
||||
const SDL_VideoInfo *videoInfo;
|
||||
printf( "[glN64]: (II) Getting video info...\n" );
|
||||
if (!(videoInfo = SDL_GetVideoInfo()))
|
||||
{
|
||||
|
@ -512,7 +512,7 @@ void OGL_Stop()
|
|||
ReleaseDC( hWnd, OGL.hDC );
|
||||
OGL.hDC = NULL;
|
||||
}
|
||||
#else // _WINDOWS
|
||||
#elif defined(USE_SDL)
|
||||
SDL_QuitSubSystem( SDL_INIT_VIDEO );
|
||||
OGL.hScreen = NULL;
|
||||
#endif // _WINDOWS
|
||||
|
@ -1155,7 +1155,7 @@ void OGL_SwapBuffers()
|
|||
SwapBuffers( wglGetCurrentDC() );
|
||||
else
|
||||
SwapBuffers( OGL.hDC );
|
||||
#else
|
||||
#elif defined(USE_SDL)
|
||||
static int frames[5] = { 0, 0, 0, 0, 0 };
|
||||
static int framesIndex = 0;
|
||||
static Uint32 lastTicks = 0;
|
||||
|
|
11
OpenGL.h
11
OpenGL.h
|
@ -6,11 +6,18 @@
|
|||
#include <GL/gl.h>
|
||||
#include "glext.h"
|
||||
#else
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include "winlnxdefs.h"
|
||||
#ifdef ANDROID
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#else
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glext.h>
|
||||
#endif // ANDROID
|
||||
#ifdef USE_SDL
|
||||
#include <SDL.h>
|
||||
#endif // USE_SDL
|
||||
#endif // _WINDOWS
|
||||
|
||||
#include "gSP.h"
|
||||
|
@ -32,7 +39,7 @@ struct GLInfo
|
|||
HGLRC hRC;
|
||||
HDC hDC;
|
||||
HWND hWnd;
|
||||
#else
|
||||
#elif defined(USE_SDL)
|
||||
SDL_Surface *hScreen;
|
||||
#endif // _WINDOWS
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user