include/SDL_opengl.h
author Jørgen P. Tjernø <jorgen@uberent.com>
Wed, 04 Jun 2014 09:59:10 -0700
changeset 8811 3f0b8a86c65b
parent 8805 a5c009ff64d7
child 8812 b0f96c169c97
permissions -rw-r--r--
SDL_opengl: Fix Mac build with new glext.h
     1 /*
     2   Simple DirectMedia Layer
     3   Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
     4 
     5   This software is provided 'as-is', without any express or implied
     6   warranty.  In no event will the authors be held liable for any damages
     7   arising from the use of this software.
     8 
     9   Permission is granted to anyone to use this software for any purpose,
    10   including commercial applications, and to alter it and redistribute it
    11   freely, subject to the following restrictions:
    12 
    13   1. The origin of this software must not be misrepresented; you must not
    14      claim that you wrote the original software. If you use this software
    15      in a product, an acknowledgment in the product documentation would be
    16      appreciated but is not required.
    17   2. Altered source versions must be plainly marked as such, and must not be
    18      misrepresented as being the original software.
    19   3. This notice may not be removed or altered from any source distribution.
    20 */
    21 
    22 /**
    23  *  \file SDL_opengl.h
    24  *
    25  *  This is a simple file to encapsulate the OpenGL API headers.
    26  */
    27 
    28 #ifndef _SDL_opengl_h
    29 #define _SDL_opengl_h
    30 
    31 #include "SDL_config.h"
    32 
    33 #ifndef __IPHONEOS__
    34 
    35 #ifdef __WIN32__
    36 #ifndef WIN32_LEAN_AND_MEAN
    37 #define WIN32_LEAN_AND_MEAN
    38 #endif
    39 #ifndef NOMINMAX
    40 #define NOMINMAX                /* Don't defined min() and max() */
    41 #endif
    42 #include <windows.h>
    43 #endif
    44 
    45 #ifdef __glext_h_
    46 /* Someone has already included glext.h */
    47 #define NO_SDL_GLEXT
    48 #endif
    49 #ifndef NO_SDL_GLEXT
    50 #define __glext_h_              /* Don't let gl.h include glext.h */
    51 #endif
    52 #if defined(__MACOSX__)
    53 #include <stddef.h>             /* Needed for ptrdiff_t */
    54 #include <OpenGL/gl.h>          /* Header File For The OpenGL Library */
    55 #define __X_GL_H
    56 #else
    57 #include <GL/gl.h>              /* Header File For The OpenGL Library */
    58 #endif
    59 #ifndef NO_SDL_GLEXT
    60 #undef __glext_h_
    61 #endif
    62 
    63 /**
    64  *  \file SDL_opengl.h
    65  *
    66  *  This file is included because glext.h is not available on some systems.
    67  *  If you don't want this version included, simply define ::NO_SDL_GLEXT.
    68  *
    69  *  The latest version is available from:
    70  *      http://www.opengl.org/registry/
    71  */
    72 
    73 /**
    74  *  \def NO_SDL_GLEXT
    75  *
    76  *  Define this if you have your own version of glext.h and want to disable the
    77  *  version included in SDL_opengl.h.
    78  */
    79 
    80 #if !defined(NO_SDL_GLEXT) && !defined(GL_GLEXT_LEGACY)
    81 #include "SDL_opengl_glext.h"
    82 #endif /* NO_SDL_GLEXT */
    83 
    84 #endif /* !__IPHONEOS__ */
    85 
    86 #endif /* _SDL_opengl_h */
    87 
    88 /* vi: set ts=4 sw=4 expandtab: */