37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
/* ================================================================
|
|
This header provides common includes to SDL2 and OpenGL/OpenGLES
|
|
================================================================ */
|
|
#if defined(__APPLE__)
|
|
#include <TargetConditionals.h>
|
|
#endif
|
|
#include "SDL.h"
|
|
#if defined(_WIN32)
|
|
#define USE_GLEW
|
|
#elif defined(__IPHONEOS__) || defined(__ANDROID__)
|
|
#define HAVE_OPENGLES
|
|
#endif
|
|
|
|
#if defined(HAVE_OPENGLES)
|
|
#include "SDL_opengles2.h"
|
|
#if defined(__IPHONEOS__) || defined(__ANDROID__)
|
|
#define glGenVertexArrays glGenVertexArraysOES
|
|
#define glBindVertexArray glBindVertexArrayOES
|
|
#define glDeleteVertexArrays glDeleteVertexArraysOES
|
|
#endif
|
|
#elif defined(USE_GLEW)
|
|
#include <GL/glew.h>
|
|
#else
|
|
#define GL_GLEXT_PROTOTYPES 1
|
|
#include "SDL_opengl.h"
|
|
#if defined(TARGET_OS_MAC)
|
|
#ifndef glGenVertexArrays
|
|
#define glGenVertexArrays glGenVertexArraysAPPLE
|
|
#endif
|
|
#ifndef glBindVertexArray
|
|
#define glBindVertexArray glBindVertexArrayAPPLE
|
|
#endif
|
|
#ifndef glDeleteVertexArrays
|
|
#define glDeleteVertexArrays glDeleteVertexArraysAPPLE
|
|
#endif
|
|
#endif
|
|
#endif |