From 298f1c65b624fea15aa4a4d0e187e5dc4e09b034 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 30 Apr 2014 13:19:22 +0000 Subject: [PATCH] Renamed the new include/osg/OpenGL automatically configured header file to include/osg/GL replacing the original hand built GL header --- CMakeLists.txt | 4 +- include/osg/GL | 257 ----------------------------------- src/osg/CMakeLists.txt | 1 - src/osg/{OpenGL.in => GL.in} | 0 4 files changed, 2 insertions(+), 260 deletions(-) delete mode 100644 include/osg/GL rename src/osg/{OpenGL.in => GL.in} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index e7ac68ee2..2b344137c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -605,8 +605,8 @@ SET(OPENSCENEGRAPH_CONFIG_HEADER "${PROJECT_BINARY_DIR}/include/osg/Config") CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/src/osg/Config.in" "${OPENSCENEGRAPH_CONFIG_HEADER}") -SET(OPENSCENEGRAPH_OPENGL_HEADER "${PROJECT_BINARY_DIR}/include/osg/OpenGL") -CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/src/osg/OpenGL.in" +SET(OPENSCENEGRAPH_OPENGL_HEADER "${PROJECT_BINARY_DIR}/include/osg/GL") +CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/src/osg/GL.in" "${OPENSCENEGRAPH_OPENGL_HEADER}") # INSTALL_FILES(/include/osg/ FILES "${OPENSCENEGRAPH_CONFIG_HEADER}") diff --git a/include/osg/GL b/include/osg/GL deleted file mode 100644 index 3e0a126ee..000000000 --- a/include/osg/GL +++ /dev/null @@ -1,257 +0,0 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield - * - * This library is open source and may be redistributed and/or modified under - * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or - * (at your option) any later version. The full license is in LICENSE file - * included with this distribution, and on the openscenegraph.org website. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * OpenSceneGraph Public License for more details. -*/ - -#ifndef OSG_GL -#define OSG_GL 1 - -#if 1 - -#include - -#else - - -#include -#include - - -#if defined(OSG_GLES1_AVAILABLE) - - #ifdef __APPLE__ - //if its apple include the target defines so we can check for IOS - #include "TargetConditionals.h" - #include - #else - #include - #endif - -#elif defined(OSG_GLES2_AVAILABLE) - - #ifdef __APPLE__ - //if its apple include the target defines so we can check for IOS - #include "TargetConditionals.h" - #include - #else - #include - #endif - - -#else - - #ifndef WIN32 - - // Required for compatibility with glext.h sytle function definitions of - // OpenGL extensions, such as in src/osg/Point.cpp. - #ifndef APIENTRY - #define APIENTRY - #endif - - #else // WIN32 - - #if defined(__CYGWIN__) || defined(__MINGW32__) - - #ifndef APIENTRY - #define GLUT_APIENTRY_DEFINED - #define APIENTRY __stdcall - #endif - // XXX This is from Win32's - #ifndef CALLBACK - #define CALLBACK __stdcall - #endif - - #else // ! __CYGWIN__ - - // Under Windows avoid including - // to avoid name space pollution, but Win32's - // needs APIENTRY and WINGDIAPI defined properly. - // XXX This is from Win32's - #ifndef APIENTRY - #define GLUT_APIENTRY_DEFINED - #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) - #define WINAPI __stdcall - #define APIENTRY WINAPI - #else - #define APIENTRY - #endif - #endif - - // XXX This is from Win32's - #ifndef CALLBACK - #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) - #define CALLBACK __stdcall - #else - #define CALLBACK - #endif - #endif - - #endif // __CYGWIN__ - - // XXX This is from Win32's and - #ifndef WINGDIAPI - #define GLUT_WINGDIAPI_DEFINED - #define DECLSPEC_IMPORT __declspec(dllimport) - #define WINGDIAPI DECLSPEC_IMPORT - #endif - - // XXX This is from Win32's - #if !defined(_WCHAR_T_DEFINED) && !(defined(__GNUC__)&&((__GNUC__ == 3)||(__GNUC__ == 4))) - typedef unsigned short wchar_t; - #define _WCHAR_T_DEFINED - #endif - - #endif // WIN32 - - #if defined(OSG_GL3_AVAILABLE) - - #define GL3_PROTOTYPES 1 - #ifdef __APPLE__ - #include - #include - #else - #include - #endif - #define GLint64EXT GLint64 - #define GLuint64EXT GLuint64 - #define GL_BGRA_EXT GL_BGRA - - #else - #ifndef __gl_h_ - #ifdef __APPLE__ - #include - #else - #include - - // hack required to avoid conflicts with Qt - // Qt expects GLdouble to be a macro ?! - #ifndef GLdouble - #define GLdouble double - #endif - #endif - #endif - - #endif - - #ifndef GL_APIENTRY - #define GL_APIENTRY APIENTRY - #endif // GL_APIENTRY - -#endif - - -#if !defined(GL_EXT_timer_query) && !defined(OSG_GL3_AVAILABLE) - - #ifdef _WIN32 - typedef __int64 GLint64EXT; - typedef unsigned __int64 GLuint64EXT; - #else - typedef long long int GLint64EXT; - typedef unsigned long long int GLuint64EXT; - #endif -#endif - -#ifdef OSG_GL_MATRICES_AVAILABLE - - inline void glLoadMatrix(const float* mat) { glLoadMatrixf(static_cast(mat)); } - inline void glMultMatrix(const float* mat) { glMultMatrixf(static_cast(mat)); } - - #ifdef OSG_GLES1_AVAILABLE - inline void glLoadMatrix(const double* mat) - { - GLfloat flt_mat[16]; - for(unsigned int i=0;i<16;++i) flt_mat[i] = mat[i]; - glLoadMatrixf(flt_mat); - } - - inline void glMultMatrix(const double* mat) - { - GLfloat flt_mat[16]; - for(unsigned int i=0;i<16;++i) flt_mat[i] = mat[i]; - glMultMatrixf(flt_mat); - } - - #else - inline void glLoadMatrix(const double* mat) { glLoadMatrixd(static_cast(mat)); } - inline void glMultMatrix(const double* mat) { glMultMatrixd(static_cast(mat)); } - #endif -#endif - -// add defines for OpenGL targets that don't define them, just to ease compatibility across targets -#ifndef GL_DOUBLE - #define GL_DOUBLE 0x140A - typedef double GLdouble; -#endif - -#ifndef GL_INT - #define GL_INT 0x1404 -#endif - -#ifndef GL_UNSIGNED_INT - #define GL_UNSIGNED_INT 0x1405 -#endif - -#ifndef GL_NONE - // OpenGL ES1 doesn't provide GL_NONE - #define GL_NONE 0x0 -#endif - -#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) - //GLES defines (OES) - #define GL_RGB8_OES 0x8051 - #define GL_RGBA8_OES 0x8058 -#endif - -#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) || defined(OSG_GL3_AVAILABLE) - #define GL_POLYGON 0x0009 - #define GL_QUADS 0x0007 - #define GL_QUAD_STRIP 0x0008 -#endif - -#if defined(OSG_GL3_AVAILABLE) - #define GL_LUMINANCE 0x1909 - #define GL_LUMINANCE_ALPHA 0x190A -#endif - -#ifdef OSG_GL1_AVAILABLE - #define OSG_GL1_FEATURES true -#else - #define OSG_GL1_FEATURES false -#endif - -#ifdef OSG_GL2_AVAILABLE - #define OSG_GL2_FEATURES true -#else - #define OSG_GL2_FEATURES false -#endif - -#ifdef OSG_GL3_AVAILABLE - #define OSG_GL3_FEATURES true -#else - #define OSG_GL3_FEATURES false -#endif - -#ifdef OSG_GLES1_AVAILABLE - #define OSG_GLES1_FEATURES true -#else - #define OSG_GLES1_FEATURES false -#endif - -#ifdef OSG_GLES2_AVAILABLE - #define OSG_GLES2_FEATURES true -#else - #define OSG_GLES2_FEATURES false -#endif - - -#endif - -#endif // __osgGL_h diff --git a/src/osg/CMakeLists.txt b/src/osg/CMakeLists.txt index 76eb9588b..b82869d5f 100644 --- a/src/osg/CMakeLists.txt +++ b/src/osg/CMakeLists.txt @@ -71,7 +71,6 @@ SET(TARGET_H ${HEADER_PATH}/FrontFace ${HEADER_PATH}/Geode ${HEADER_PATH}/Geometry - ${HEADER_PATH}/GL ${HEADER_PATH}/GL2Extensions ${HEADER_PATH}/GLExtensions ${HEADER_PATH}/GLBeginEndAdapter diff --git a/src/osg/OpenGL.in b/src/osg/GL.in similarity index 100% rename from src/osg/OpenGL.in rename to src/osg/GL.in