// Copyright (C) 2012-2013 ChaosForge / Kornel Kisielewicz // http://chaosforge.org/ // // This file is part of NV Libraries. // For conditions of distribution and use, see copyright notice in nv.hh #ifndef NV_LIB_GL_HH #define NV_LIB_GL_HH #include #include //#define NV_SDL_GL #define NV_GL_DYNAMIC //#define NV_GL_SHARED #if NV_PLATFORM == NV_WINDOWS # define NV_GL_PATH "opengl32.dll" #elif NV_PLATFORM == NV_APPLE # define NV_GL_PATH "/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib" #else # define NV_GL_PATH "libGL.so" #endif #include extern "C" { #if NV_PLATFORM == NV_WINDOWS # define NV_GL_APIENTRY __stdcall #else # define NV_GL_APIENTRY #endif #if defined(NV_GL_SHARED) && (NV_PLATFORM == NV_WINDOWS) # define NV_GL_API __declspec(dllimport) #else # define NV_GL_API extern #endif #include #if defined(NV_GL_DYNAMIC) # define NV_GL_FUN( rtype, fname, fparams ) NV_GL_API rtype ( NV_GL_APIENTRY *fname) fparams #else # define NV_GL_FUN( rtype, fname, fparams ) NV_GL_API rtype NV_GL_APIENTRY fname fparams #endif #define NV_GL_FUN_EXT NV_GL_FUN #include #undef NV_GL_FUN_EXT #undef NV_GL_FUN } namespace nv { /* Dynamic load support */ # if defined( NV_GL_DYNAMIC ) bool load_gl_library( const char* path = NV_GL_PATH ); # else inline bool load_gl_library( const char* path = "" ) { return true; } # endif } #endif // NV_LIB_GL_HH