| 1 | /* |
| 2 | ** The OpenGL Extension Wrangler Library |
| 3 | ** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org> |
| 4 | ** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org> |
| 5 | ** Copyright (C) 2002, Lev Povalahev |
| 6 | ** All rights reserved. |
| 7 | ** |
| 8 | ** Redistribution and use in source and binary forms, with or without |
| 9 | ** modification, are permitted provided that the following conditions are met: |
| 10 | ** |
| 11 | ** * Redistributions of source code must retain the above copyright notice, |
| 12 | ** this list of conditions and the following disclaimer. |
| 13 | ** * Redistributions in binary form must reproduce the above copyright notice, |
| 14 | ** this list of conditions and the following disclaimer in the documentation |
| 15 | ** and/or other materials provided with the distribution. |
| 16 | ** * The name of the author may be used to endorse or promote products |
| 17 | ** derived from this software without specific prior written permission. |
| 18 | ** |
| 19 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 20 | ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 21 | ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 22 | ** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
| 23 | ** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 24 | ** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 25 | ** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 26 | ** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 27 | ** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 28 | ** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 29 | ** THE POSSIBILITY OF SUCH DAMAGE. |
| 30 | */ |
| 31 | |
| 32 | // BANSHEE SPECIFIC START |
| 33 | #include "BsGLSupport.h" |
| 34 | // BANSHEE SPECIFIC END |
| 35 | |
| 36 | #include <GL/glew.h> |
| 37 | |
| 38 | #if defined(_WIN32) |
| 39 | # include <GL/wglew.h> |
| 40 | #elif !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) |
| 41 | # include <GL/glxew.h> |
| 42 | #endif |
| 43 | |
| 44 | /* |
| 45 | * Define glewGetContext and related helper macros. |
| 46 | */ |
| 47 | #ifdef GLEW_MX |
| 48 | # define glewGetContext() ctx |
| 49 | # ifdef _WIN32 |
| 50 | # define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx |
| 51 | # define GLEW_CONTEXT_ARG_VAR_INIT ctx |
| 52 | # define wglewGetContext() ctx |
| 53 | # define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx |
| 54 | # define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx |
| 55 | # else /* _WIN32 */ |
| 56 | # define GLEW_CONTEXT_ARG_DEF_INIT void |
| 57 | # define GLEW_CONTEXT_ARG_VAR_INIT |
| 58 | # define glxewGetContext() ctx |
| 59 | # define GLXEW_CONTEXT_ARG_DEF_INIT void |
| 60 | # define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx |
| 61 | # endif /* _WIN32 */ |
| 62 | # define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx |
| 63 | #else /* GLEW_MX */ |
| 64 | // BANSHEE SPECIFIC START |
| 65 | # define GLEW_CONTEXT_ARG_DEF_INIT bs::ct::GLSupport * |
|---|