kusano 7d535a
/*
kusano 7d535a
** The OpenGL Extension Wrangler Library
kusano 7d535a
** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee="" org=""></milan>
kusano 7d535a
** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org=""></mmagallo[]debian>
kusano 7d535a
** Copyright (C) 2002, Lev Povalahev
kusano 7d535a
** All rights reserved.
kusano 7d535a
** 
kusano 7d535a
** Redistribution and use in source and binary forms, with or without 
kusano 7d535a
** modification, are permitted provided that the following conditions are met:
kusano 7d535a
** 
kusano 7d535a
** * Redistributions of source code must retain the above copyright notice, 
kusano 7d535a
**   this list of conditions and the following disclaimer.
kusano 7d535a
** * Redistributions in binary form must reproduce the above copyright notice, 
kusano 7d535a
**   this list of conditions and the following disclaimer in the documentation 
kusano 7d535a
**   and/or other materials provided with the distribution.
kusano 7d535a
** * The name of the author may be used to endorse or promote products 
kusano 7d535a
**   derived from this software without specific prior written permission.
kusano 7d535a
**
kusano 7d535a
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
kusano 7d535a
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
kusano 7d535a
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
kusano 7d535a
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
kusano 7d535a
** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
kusano 7d535a
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
kusano 7d535a
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
kusano 7d535a
** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
kusano 7d535a
** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
kusano 7d535a
** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
kusano 7d535a
** THE POSSIBILITY OF SUCH DAMAGE.
kusano 7d535a
*/
kusano 7d535a
kusano 7d535a
#ifndef __glew_utils_h__
kusano 7d535a
#define __glew_utils_h__
kusano 7d535a
kusano 7d535a
#include <gl glew.h=""></gl>
kusano 7d535a
#if defined(_WIN32)
kusano 7d535a
#  include <gl wglew.h=""></gl>
kusano 7d535a
#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
kusano 7d535a
#  include <gl glxew.h=""></gl>
kusano 7d535a
#endif
kusano 7d535a
kusano 7d535a
/*
kusano 7d535a
 * Define glewGetContext and related helper macros.
kusano 7d535a
 */
kusano 7d535a
#ifdef GLEW_MX
kusano 7d535a
#  define glewGetContext() ctx
kusano 7d535a
#  ifdef _WIN32
kusano 7d535a
#    define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx
kusano 7d535a
#    define GLEW_CONTEXT_ARG_VAR_INIT ctx
kusano 7d535a
#    define wglewGetContext() ctx
kusano 7d535a
#    define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx
kusano 7d535a
#    define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx
kusano 7d535a
#  else /* _WIN32 */
kusano 7d535a
#    define GLEW_CONTEXT_ARG_DEF_INIT void
kusano 7d535a
#    define GLEW_CONTEXT_ARG_VAR_INIT
kusano 7d535a
#    define glxewGetContext() ctx
kusano 7d535a
#    define GLXEW_CONTEXT_ARG_DEF_INIT void
kusano 7d535a
#    define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx
kusano 7d535a
#  endif /* _WIN32 */
kusano 7d535a
#  define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx
kusano 7d535a
#else /* GLEW_MX */
kusano 7d535a
#  define GLEW_CONTEXT_ARG_DEF_INIT void
kusano 7d535a
#  define GLEW_CONTEXT_ARG_VAR_INIT
kusano 7d535a
#  define GLEW_CONTEXT_ARG_DEF_LIST void
kusano 7d535a
#  define WGLEW_CONTEXT_ARG_DEF_INIT void
kusano 7d535a
#  define WGLEW_CONTEXT_ARG_DEF_LIST void
kusano 7d535a
#  define GLXEW_CONTEXT_ARG_DEF_INIT void
kusano 7d535a
#  define GLXEW_CONTEXT_ARG_DEF_LIST void
kusano 7d535a
#endif /* GLEW_MX */
kusano 7d535a
kusano 7d535a
/*
kusano 7d535a
 * Define glewGetProcAddress.
kusano 7d535a
 */
kusano 7d535a
#if defined(_WIN32)
kusano 7d535a
#  define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name)
kusano 7d535a
#else
kusano 7d535a
#  if defined(__APPLE__)
kusano 7d535a
     extern void* NSGLGetProcAddress (const GLubyte* name);
kusano 7d535a
#    define glewGetProcAddress(name) NSGLGetProcAddress(name)
kusano 7d535a
#  else
kusano 7d535a
#    if defined(__sgi) || defined(__sun)
kusano 7d535a
       extern void* dlGetProcAddress (const GLubyte* name);
kusano 7d535a
#      define glewGetProcAddress(name) dlGetProcAddress(name)
kusano 7d535a
#    else /* __linux */
kusano 7d535a
#      define glewGetProcAddress(name) (*glXGetProcAddressARB)(name)
kusano 7d535a
#    endif
kusano 7d535a
#  endif
kusano 7d535a
#endif
kusano 7d535a
kusano 7d535a
/*
kusano 7d535a
 * GLEW, just like OpenGL or GLU, does not rely on the standard C library.
kusano 7d535a
 * These functions implement the string processing functionality required in the library.
kusano 7d535a
 */
kusano 7d535a
extern GLuint _glewStrLen (const GLubyte* s);
kusano 7d535a
extern GLuint _glewStrCLen (const GLubyte* s, GLubyte c);
kusano 7d535a
extern GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n);
kusano 7d535a
extern GLboolean _glewStrSame1 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb);
kusano 7d535a
extern GLboolean _glewStrSame2 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb);
kusano 7d535a
extern GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb)
kusano 7d535a
kusano 7d535a
#endif /* __glew_utils_h__ */