From 3c07921dee7a11f59f3692fe0844e38adc5259c9 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 10 Dec 2014 10:44:58 +0000 Subject: [PATCH] Removed old GL2Extensions class, replacing it with a typedef to GL2Extensions Removed old includes to include/osg/GL2Extensions git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14594 16af8721-9629-0410-8352-f15c8da7e697 --- .../osgshaderterrain/osgshaderterrain.cpp | 4 +- include/osg/GL2Extensions | 1031 +---------------- src/osg/CMakeLists.txt | 1 - src/osg/GL2Extensions.cpp | 771 ------------ src/osgAnimation/RigGeometry.cpp | 1 - src/osgDB/ObjectWrapper.cpp | 2 +- 6 files changed, 6 insertions(+), 1804 deletions(-) delete mode 100644 src/osg/GL2Extensions.cpp diff --git a/examples/osgshaderterrain/osgshaderterrain.cpp b/examples/osgshaderterrain/osgshaderterrain.cpp index 38271c732..9424ad278 100644 --- a/examples/osgshaderterrain/osgshaderterrain.cpp +++ b/examples/osgshaderterrain/osgshaderterrain.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -270,7 +270,7 @@ public: OpenThreads::ScopedLock lock(_mutex); - osg::GL2Extensions* gl2ext = gc->getState()->get(); + osg::GLExtensions* gl2ext = gc->getState()->get(); if( gl2ext ) { if( !gl2ext->isGlslSupported ) diff --git a/include/osg/GL2Extensions b/include/osg/GL2Extensions index 9861fe26b..67ce53e48 100644 --- a/include/osg/GL2Extensions +++ b/include/osg/GL2Extensions @@ -1,12 +1,4 @@ /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield - * Copyright (C) 2003-2005 3Dlabs Inc. Ltd. - * Copyright (C) 2004-2005 Nathan Cournia - * Copyright (C) 2007 Art Tevs - * Copyright (C) 2008 Zebra Imaging - * Copyright (C) 2010 VIRES Simulationstechnologie GmbH - * Copyright (C) 2012 David Callu - * Copyright (C) 2008 Mike Weiblen - * Copyright (C) 2012 Holger Helmich * * This application is open source and may be redistributed and/or modified * freely and without restriction, both in commercial and non commercial @@ -21,1029 +13,12 @@ #define OSG_GL2EXTENSIONS 1 #include -#include - - -#include - - -// identify GLES 1.1 -#if (defined(GL_VERSION_ES_CM_1_0) && GL_VERSION_ES_CM_1_0 > 0) || \ - (defined(GL_VERSION_ES_CM_1_1) && GL_VERSION_ES_CM_1_1 > 0) - - #define OPENGLES_1_1_FOUND 1 - -#endif - -#ifndef GL_SAMPLER_2D_ARRAY_EXT - #define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 - #define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 - #define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 - #define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 -#endif - -#if !defined(GL_VERSION_2_0) -typedef char GLchar; -#endif - -#if !defined(GL_VERSION_2_0) - #define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 - #define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 -#endif - -#if !defined(GL_VERSION_2_0) && !defined(GL_ES_VERSION_2_0) -#define GL_VERSION_2_0 1 -#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_MAX_DRAW_BUFFERS 0x8824 -#define GL_DRAW_BUFFER0 0x8825 -#define GL_DRAW_BUFFER1 0x8826 -#define GL_DRAW_BUFFER2 0x8827 -#define GL_DRAW_BUFFER3 0x8828 -#define GL_DRAW_BUFFER4 0x8829 -#define GL_DRAW_BUFFER5 0x882A -#define GL_DRAW_BUFFER6 0x882B -#define GL_DRAW_BUFFER7 0x882C -#define GL_DRAW_BUFFER8 0x882D -#define GL_DRAW_BUFFER9 0x882E -#define GL_DRAW_BUFFER10 0x882F -#define GL_DRAW_BUFFER11 0x8830 -#define GL_DRAW_BUFFER12 0x8831 -#define GL_DRAW_BUFFER13 0x8832 -#define GL_DRAW_BUFFER14 0x8833 -#define GL_DRAW_BUFFER15 0x8834 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_POINT_SPRITE 0x8861 -#define GL_COORD_REPLACE 0x8862 -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_MAX_TEXTURE_COORDS 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A -#define GL_MAX_VARYING_FLOATS 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_SHADER_TYPE 0x8B4F -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_DELETE_STATUS 0x8B80 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 -#define GL_LOWER_LEFT 0x8CA1 -#define GL_UPPER_LEFT 0x8CA2 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 - -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_CUBE 0x8B60 -#endif - -#if !defined(GL_SAMPLER_1D) -#define GL_SAMPLER_1D 0x8B5D -#endif -#if !defined(GL_SAMPLER_3D) -#define GL_SAMPLER_3D 0x8B5F -#endif - -#if !defined(GL_SAMPLER_1D_SHADOW) -#define GL_SAMPLER_1D_SHADOW 0x8B61 -#define GL_SAMPLER_2D_SHADOW 0x8B62 -#endif - -#ifndef GL_VERSION_2_1 -#define GL_VERSION_2_1 1 -#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F -#define GL_PIXEL_PACK_BUFFER 0x88EB -#define GL_PIXEL_UNPACK_BUFFER 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF -#define GL_FLOAT_MAT2x3 0x8B65 -#define GL_FLOAT_MAT2x4 0x8B66 -#define GL_FLOAT_MAT3x2 0x8B67 -#define GL_FLOAT_MAT3x4 0x8B68 -#define GL_FLOAT_MAT4x2 0x8B69 -#define GL_FLOAT_MAT4x3 0x8B6A -#define GL_SRGB 0x8C40 -#define GL_SRGB8 0x8C41 -#define GL_SRGB_ALPHA 0x8C42 -#define GL_SRGB8_ALPHA8 0x8C43 -#define GL_SLUMINANCE_ALPHA 0x8C44 -#define GL_SLUMINANCE8_ALPHA8 0x8C45 -#define GL_SLUMINANCE 0x8C46 -#define GL_SLUMINANCE8 0x8C47 -#define GL_COMPRESSED_SRGB 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 -#define GL_COMPRESSED_SLUMINANCE 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B -#endif - -#ifndef GL_ARB_framebuffer_sRGB -#define GL_FRAMEBUFFER_SRGB 0x8DB9 -#endif - -// EXT_geometry_shader4 -#ifndef GL_EXT_geometry_shader4 -#define GL_GEOMETRY_SHADER_EXT 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE -#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 -#define GL_LINES_ADJACENCY_EXT 0x000A -#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B -#define GL_TRIANGLES_ADJACENCY_EXT 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 -#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 -#endif - -// ARB_tessellation_shader -#ifndef GL_ARB_tessellation_shader -#define GL_PATCHES 0x000E -#define GL_PATCH_VERTICES 0x8E72 -#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 -#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 -#define GL_MAX_PATCH_VERTICES 0x8E7D -#define GL_MAX_TESS_GEN_LEVEL 0x8E7E -#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F -#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 -#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 -#define GL_MAX_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 -#define GL_MAX_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 -#define GL_MAX_MAX_TESS_PATCH_COMPONENTS 0x8E84 -#define GL_MAX_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 -#define GL_MAX_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 -#define GL_MAX_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 -#define GL_MAX_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A -#define GL_MAX_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C -#define GL_MAX_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D -#define GL_MAX_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E -#define GL_MAX_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F -#define GL_TESS_EVALUATION_SHADER 0x8E87 -#define GL_TESS_CONTROL_SHADER 0x8E88 -#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 -#define GL_TESS_GEN_MODE 0x8E76 -#define GL_TESS_GEN_SPACING 0x8E77 -#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 -#define GL_TESS_GEN_POINT_MODE 0x8E79 -#define GL_ISOLINES 0x8E7A -#define GL_FRACTIONAL_ODD 0x8E7B -#define GL_FRACTIONAL_EVEN 0x8E7C -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 -#endif - -// EXT_gpu_shader4 -#ifndef GL_EXT_gpu_shader4 -#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 -#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 -#define GL_SAMPLER_BUFFER_EXT 0x8DC2 -#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 -#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 -#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 -#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 -#define GL_INT_SAMPLER_1D_EXT 0x8DC9 -#define GL_INT_SAMPLER_2D_EXT 0x8DCA -#define GL_INT_SAMPLER_3D_EXT 0x8DCB -#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC -#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD -#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF -#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 -#define GL_MIN_PROGRAM_TEXEL_OFFSET_EXT 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET_EXT 0x8905 -#endif - -// ARB_uniform_buffer_object -#ifndef GL_ARB_uniform_buffer_object -#define GL_UNIFORM_BUFFER 0x8A11 -#define GL_UNIFORM_BUFFER_BINDING 0x8A28 -#define GL_UNIFORM_BUFFER_START 0x8A29 -#define GL_UNIFORM_BUFFER_SIZE 0x8A2A -#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B -#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C -#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D -#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E -#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F -#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 -#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 -#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 -#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 -#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 -#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 -#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 -#define GL_UNIFORM_TYPE 0x8A37 -#define GL_UNIFORM_SIZE 0x8A38 -#define GL_UNIFORM_NAME_LENGTH 0x8A39 -#define GL_UNIFORM_BLOCK_INDEX 0x8A3A -#define GL_UNIFORM_OFFSET 0x8A3B -#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C -#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D -#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E -#define GL_UNIFORM_BLOCK_BINDING 0x8A3F -#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 -#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 -#define GL_INVALID_INDEX 0xFFFFFFFFu -#endif - -// ARB_get_program_binary -#ifndef GL_ARB_get_program_binary -#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 -#define GL_PROGRAM_BINARY_LENGTH 0x8741 -#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE -#define GL_PROGRAM_BINARY_FORMATS 0x87FF -#endif - -// ARB_gpu_shader_fp64 -#ifndef GL_ARB_gpu_shader_fp64 -#define GL_DOUBLE_VEC2 0x8FFC -#define GL_DOUBLE_VEC3 0x8FFD -#define GL_DOUBLE_VEC4 0x8FFE -#define GL_DOUBLE_MAT2 0x8F46 -#define GL_DOUBLE_MAT3 0x8F47 -#define GL_DOUBLE_MAT4 0x8F48 -#define GL_DOUBLE_MAT2x3 0x8F49 -#define GL_DOUBLE_MAT2x4 0x8F4A -#define GL_DOUBLE_MAT3x2 0x8F4B -#define GL_DOUBLE_MAT3x4 0x8F4C -#define GL_DOUBLE_MAT4x2 0x8F4D -#define GL_DOUBLE_MAT4x3 0x8F4E -#endif - -// ARB_texture_multisample -#ifndef GL_ARB_texture_multisample -#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 -#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A -#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B -#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D -#endif - -// GL_ARB_shader_image_load_store -#ifndef GL_ARB_shader_image_load_store -#define GL_IMAGE_1D 0x904C -#define GL_IMAGE_2D 0x904D -#define GL_IMAGE_3D 0x904E -#define GL_IMAGE_2D_RECT 0x904F -#define GL_IMAGE_CUBE 0x9050 -#define GL_IMAGE_BUFFER 0x9051 -#define GL_IMAGE_1D_ARRAY 0x9052 -#define GL_IMAGE_2D_ARRAY 0x9053 -#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 -#define GL_IMAGE_2D_MULTISAMPLE 0x9055 -#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 -#define GL_INT_IMAGE_1D 0x9057 -#define GL_INT_IMAGE_2D 0x9058 -#define GL_INT_IMAGE_3D 0x9059 -#define GL_INT_IMAGE_2D_RECT 0x905A -#define GL_INT_IMAGE_CUBE 0x905B -#define GL_INT_IMAGE_BUFFER 0x905C -#define GL_INT_IMAGE_1D_ARRAY 0x905D -#define GL_INT_IMAGE_2D_ARRAY 0x905E -#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F -#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 -#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 -#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 -#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 -#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 -#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 -#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 -#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 -#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 -#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C -#endif - -#ifndef GL_VERSION_3_1 -#define GL_SAMPLER_2D_RECT 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 -#define GL_SAMPLER_BUFFER 0x8DC2 -#define GL_INT_SAMPLER_2D_RECT 0x8DCD -#define GL_INT_SAMPLER_BUFFER 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 -#define GL_TEXTURE_BUFFER 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D -#define GL_TEXTURE_RECTANGLE 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 -#define GL_RGB_SNORM 0x8F92 -#define GL_RGBA_SNORM 0x8F93 -#define GL_R8_SNORM 0x8F94 -#define GL_RG8_SNORM 0x8F95 -#define GL_RGB8_SNORM 0x8F96 -#define GL_RGBA8_SNORM 0x8F97 -#define GL_R16_SNORM 0x8F98 -#define GL_RG16_SNORM 0x8F99 -#define GL_RGB16_SNORM 0x8F9A -#define GL_RGBA16_SNORM 0x8F9B -#define GL_SIGNED_NORMALIZED 0x8F9C -#define GL_PRIMITIVE_RESTART 0x8F9D -#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E -#endif - -#ifndef GL_RED_SNORM -#define GL_RED_SNORM 0x8F90 -#endif -#ifndef GL_RG_SNORM -#define GL_RG_SNORM 0x8F91 -#endif - - -#ifndef GL_VERSION_4_0 -#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F -#endif - -// ARB_shader_atomic_counters -#ifndef GL_ARB_shader_atomic_counters -#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 -#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 -#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 -#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 -#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 -#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 -#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB -#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE -#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF -#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 -#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 -#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 -#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 -#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 -#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 -#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 -#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC -#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 -#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA -#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB -#endif - -// ARB_compute_shader -#ifndef GL_ARB_compute_shader -#define GL_COMPUTE_SHADER 0x91B9 -#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB -#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC -#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD -#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 -#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 -#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 -#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 -#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 -#define GL_MAX_COMPUTE_LOCAL_INVOCATIONS 0x90EB -#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE -#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF -#define GL_COMPUTE_LOCAL_WORK_SIZE 0x8267 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED -#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE -#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF -#define GL_COMPUTE_SHADER_BIT 0x00000020 -#endif - -#ifndef GL_ARB_depth_clamp -#define GL_DEPTH_CLAMP 0x864F -#endif - -#ifndef GL_ARB_provoking_vertex -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C -#define GL_FIRST_VERTEX_CONVENTION 0x8E4D -#define GL_LAST_VERTEX_CONVENTION 0x8E4E -#define GL_PROVOKING_VERTEX 0x8E4F -#endif - -#ifndef GL_ARB_seamless_cube_map -#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F -#endif - -#ifndef GL_VERSION_4_3 -#define GL_SHADER_STORAGE_BARRIER_BIT 0x2000 -#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 -#define GL_SHADER_STORAGE_BUFFER 0x90D2 -#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 -#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 -#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 -#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 -#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 -#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 -#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 -#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA -#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB -#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC -#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD -#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE -#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF - - -#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 -#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 -#define GL_UNIFORM_BARRIER_BIT 0x00000004 -#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 -#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 -#define GL_COMMAND_BARRIER_BIT 0x00000040 -#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 -#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 -#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 -#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 -#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 -#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 - -#define GL_MAP_READ_BIT 0x0001 -#define GL_MAP_WRITE_BIT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 -#endif - -#ifndef GL_ARB_sync -#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 -#define GL_OBJECT_TYPE 0x9112 -#define GL_SYNC_CONDITION 0x9113 -#define GL_SYNC_STATUS 0x9114 -#define GL_SYNC_FLAGS 0x9115 -#define GL_SYNC_FENCE 0x9116 -#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 -#define GL_UNSIGNALED 0x9118 -#define GL_SIGNALED 0x9119 -#define GL_ALREADY_SIGNALED 0x911A -#define GL_TIMEOUT_EXPIRED 0x911B -#define GL_CONDITION_SATISFIED 0x911C -#define GL_WAIT_FAILED 0x911D -#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 -#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull -#endif - -#ifndef GL_TEXTURE_2D_ARRAY_EXT - #define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A - #define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A - #define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B - #define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D - #define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF - #define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E - #define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 - #define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 - #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 -#endif - -#ifndef GL_MAX_3D_TEXTURE_SIZE - #define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#endif - -#ifndef GL_VERSION_3_2 -typedef struct __GLsync *GLsync; -#endif - -// for compatibility with gl.h headers that don't support VBO, -//GL_VERSION_1_5 and GL_ARB_vertex_buffer_object provide these types for OpenGL -//all ES versions except GL_OES_VERSION_1_0 provide these types for OpenGL ES -#if !defined(GL_VERSION_1_5) && !defined(GL_ARB_vertex_buffer_object) \ - && !defined(GL_ES_VERSION_2_0) && !defined(OPENGLES_1_1_FOUND) - #if defined(_WIN64) - typedef __int64 GLintptr; - typedef __int64 GLsizeiptr; - #elif defined(__ia64__) || defined(__x86_64__) || defined(__ANDROID__) - typedef long int GLintptr; - typedef long int GLsizeiptr; - #else - typedef int GLintptr; - typedef int GLsizeiptr; - #endif -#endif - +#include namespace osg { -class OSG_EXPORT GL2Extensions : public osg::Referenced -{ - public: - GL2Extensions(unsigned int contextID); - - /** Function to call to get the extension of a specified context. - * If the Exentsion object for that context has not yet been created then - * and the 'createIfNotInitalized' flag been set to false then returns NULL. - * If 'createIfNotInitalized' is true then the Extensions object is - * automatically created. However, in this case the extension object - * only be created with the graphics context associated with ContextID..*/ - static GL2Extensions* Get(unsigned int contextID,bool createIfNotInitalized); - - /** allows users to override the extensions across graphics contexts. - * typically used when you have different extensions supported across graphics pipes - * but need to ensure that they all use the same low common denominator extensions.*/ - static void Set(unsigned int contextID, GL2Extensions* extensions); - - // C++-friendly convenience wrapper methods - GLuint getCurrentProgram() const; - bool getProgramInfoLog( GLuint program, std::string& result ) const; - bool getShaderInfoLog( GLuint shader, std::string& result ) const; - bool getAttribLocation( const char* attribName, GLuint& slot ) const; - bool getFragDataLocation( const char* fragDataName, GLuint& slot) const; - - - float glVersion; - float glslLanguageVersion; - - bool isGlslSupported; - bool isShaderObjectsSupported; - bool isVertexShaderSupported; - bool isFragmentShaderSupported; - bool isLanguage100Supported; - bool isGeometryShader4Supported; - bool areTessellationShadersSupported; - bool isGpuShader4Supported; - bool isUniformBufferObjectSupported; - bool isGetProgramBinarySupported; - bool isGpuShaderFp64Supported; - bool isShaderAtomicCountersSupported; - bool isRectangleSupported; - bool isCubeMapSupported; - - void (GL_APIENTRY * glDrawBuffers)(GLsizei n, const GLenum *bufs); - void (GL_APIENTRY * glAttachShader)(GLuint program, GLuint shader); - void (GL_APIENTRY * glBindAttribLocation)(GLuint program, GLuint index, const GLchar *name); - void (GL_APIENTRY * glCompileShader)(GLuint shader); - GLuint (GL_APIENTRY * glCreateProgram)(void); - GLuint (GL_APIENTRY * glCreateShader)(GLenum type); - void (GL_APIENTRY * glDeleteProgram)(GLuint program); - void (GL_APIENTRY * glDeleteObjectARB)(GLuint program); - void (GL_APIENTRY * glDeleteShader)(GLuint shader); - void (GL_APIENTRY * glDetachShader)(GLuint program, GLuint shader); - void (GL_APIENTRY * glDisableVertexAttribArray)(GLuint index); - void (GL_APIENTRY * glEnableVertexAttribArray)(GLuint index); - void (GL_APIENTRY * glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); - void (GL_APIENTRY * glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); - void (GL_APIENTRY * glGetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); - GLint (GL_APIENTRY * glGetAttribLocation)(GLuint program, const GLchar *name); - void (GL_APIENTRY * glGetProgramiv)(GLuint program, GLenum pname, GLint *params); - void (GL_APIENTRY * glGetObjectParameterivARB)(GLuint program, GLenum pname, GLint *params); - void (GL_APIENTRY * glGetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); - void (GL_APIENTRY * glGetInfoLogARB)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); - void (GL_APIENTRY * glGetShaderiv)(GLuint shader, GLenum pname, GLint *params); - void (GL_APIENTRY * glGetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); - void (GL_APIENTRY * glGetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); - GLint (GL_APIENTRY * glGetUniformLocation)(GLuint program, const GLchar *name); - void (GL_APIENTRY * glGetUniformfv)(GLuint program, GLint location, GLfloat *params); - void (GL_APIENTRY * glGetUniformiv)(GLuint program, GLint location, GLint *params); - void (GL_APIENTRY * glGetVertexAttribdv)(GLuint index, GLenum pname, GLdouble *params); - void (GL_APIENTRY * glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat *params); - void (GL_APIENTRY * glGetVertexAttribiv)(GLuint index, GLenum pname, GLint *params); - void (GL_APIENTRY * glGetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid* *pointer); - GLboolean (GL_APIENTRY * glIsProgram)(GLuint program); - GLboolean (GL_APIENTRY * glIsShader)(GLuint shader); - void (GL_APIENTRY * glLinkProgram)(GLuint program); - void (GL_APIENTRY * glShaderSource)(GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); - void (GL_APIENTRY * glUseProgram)(GLuint program); - void (GL_APIENTRY * glUniform1f)(GLint location, GLfloat v0); - void (GL_APIENTRY * glUniform2f)(GLint location, GLfloat v0, GLfloat v1); - void (GL_APIENTRY * glUniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); - void (GL_APIENTRY * glUniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); - void (GL_APIENTRY * glUniform1i)(GLint location, GLint v0); - void (GL_APIENTRY * glUniform2i)(GLint location, GLint v0, GLint v1); - void (GL_APIENTRY * glUniform3i)(GLint location, GLint v0, GLint v1, GLint v2); - void (GL_APIENTRY * glUniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); - void (GL_APIENTRY * glUniform1fv)(GLint location, GLsizei count, const GLfloat *value); - void (GL_APIENTRY * glUniform2fv)(GLint location, GLsizei count, const GLfloat *value); - void (GL_APIENTRY * glUniform3fv)(GLint location, GLsizei count, const GLfloat *value); - void (GL_APIENTRY * glUniform4fv)(GLint location, GLsizei count, const GLfloat *value); - void (GL_APIENTRY * glUniform1iv)(GLint location, GLsizei count, const GLint *value); - void (GL_APIENTRY * glUniform2iv)(GLint location, GLsizei count, const GLint *value); - void (GL_APIENTRY * glUniform3iv)(GLint location, GLsizei count, const GLint *value); - void (GL_APIENTRY * glUniform4iv)(GLint location, GLsizei count, const GLint *value); - void (GL_APIENTRY * glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); - void (GL_APIENTRY * glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); - void (GL_APIENTRY * glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); - void (GL_APIENTRY * glValidateProgram)(GLuint program); - void (GL_APIENTRY * glVertexAttrib1d)(GLuint index, GLdouble x); - void (GL_APIENTRY * glVertexAttrib1dv)(GLuint index, const GLdouble *v); - void (GL_APIENTRY * glVertexAttrib1f)(GLuint index, GLfloat x); - void (GL_APIENTRY * glVertexAttrib1fv)(GLuint index, const GLfloat *v); - void (GL_APIENTRY * glVertexAttrib1s)(GLuint index, GLshort x); - void (GL_APIENTRY * glVertexAttrib1sv)(GLuint index, const GLshort *v); - void (GL_APIENTRY * glVertexAttrib2d)(GLuint index, GLdouble x, GLdouble y); - void (GL_APIENTRY * glVertexAttrib2dv)(GLuint index, const GLdouble *v); - void (GL_APIENTRY * glVertexAttrib2f)(GLuint index, GLfloat x, GLfloat y); - void (GL_APIENTRY * glVertexAttrib2fv)(GLuint index, const GLfloat *v); - void (GL_APIENTRY * glVertexAttrib2s)(GLuint index, GLshort x, GLshort y); - void (GL_APIENTRY * glVertexAttrib2sv)(GLuint index, const GLshort *v); - void (GL_APIENTRY * glVertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z); - void (GL_APIENTRY * glVertexAttrib3dv)(GLuint index, const GLdouble *v); - void (GL_APIENTRY * glVertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z); - void (GL_APIENTRY * glVertexAttrib3fv)(GLuint index, const GLfloat *v); - void (GL_APIENTRY * glVertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z); - void (GL_APIENTRY * glVertexAttrib3sv)(GLuint index, const GLshort *v); - void (GL_APIENTRY * glVertexAttrib4Nbv)(GLuint index, const GLbyte *v); - void (GL_APIENTRY * glVertexAttrib4Niv)(GLuint index, const GLint *v); - void (GL_APIENTRY * glVertexAttrib4Nsv)(GLuint index, const GLshort *v); - void (GL_APIENTRY * glVertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); - void (GL_APIENTRY * glVertexAttrib4Nubv)(GLuint index, const GLubyte *v); - void (GL_APIENTRY * glVertexAttrib4Nuiv)(GLuint index, const GLuint *v); - void (GL_APIENTRY * glVertexAttrib4Nusv)(GLuint index, const GLushort *v); - void (GL_APIENTRY * glVertexAttrib4bv)(GLuint index, const GLbyte *v); - void (GL_APIENTRY * glVertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); - void (GL_APIENTRY * glVertexAttrib4dv)(GLuint index, const GLdouble *v); - void (GL_APIENTRY * glVertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); - void (GL_APIENTRY * glVertexAttrib4fv)(GLuint index, const GLfloat *v); - void (GL_APIENTRY * glVertexAttrib4iv)(GLuint index, const GLint *v); - void (GL_APIENTRY * glVertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); - void (GL_APIENTRY * glVertexAttrib4sv)(GLuint index, const GLshort *v); - void (GL_APIENTRY * glVertexAttrib4ubv)(GLuint index, const GLubyte *v); - void (GL_APIENTRY * glVertexAttrib4uiv)(GLuint index, const GLuint *v); - void (GL_APIENTRY * glVertexAttrib4usv)(GLuint index, const GLushort *v); - void (GL_APIENTRY * glVertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); - void (GL_APIENTRY * glVertexAttribDivisor)(GLuint index, GLuint divisor); - void (GL_APIENTRY * glUniformMatrix2x3fv)( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ); - void (GL_APIENTRY * glUniformMatrix3x2fv)( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ); - void (GL_APIENTRY * glUniformMatrix2x4fv)( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ); - void (GL_APIENTRY * glUniformMatrix4x2fv)( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ); - void (GL_APIENTRY * glUniformMatrix3x4fv)( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ); - void (GL_APIENTRY * glUniformMatrix4x3fv)( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ); - void (GL_APIENTRY * glProgramParameteri)( GLuint program, GLenum pname, GLint value ); - void (GL_APIENTRY * glPatchParameteri)( GLenum pname, GLint value ); - void (GL_APIENTRY * glPatchParameterfv)( GLenum pname, const GLfloat* values ); - void (GL_APIENTRY * glGetUniformuiv)( GLuint program, GLint location, GLuint* params ); - void (GL_APIENTRY * glBindFragDataLocation)( GLuint program, GLuint color, const GLchar* name ); - GLint (GL_APIENTRY * glGetFragDataLocation)( GLuint program, const GLchar* name ); - void (GL_APIENTRY * glUniform1ui)( GLint location, GLuint v0 ); - void (GL_APIENTRY * glUniform2ui)( GLint location, GLuint v0, GLuint v1 ); - void (GL_APIENTRY * glUniform3ui)( GLint location, GLuint v0, GLuint v1, GLuint v2 ); - void (GL_APIENTRY * glUniform4ui)( GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3 ); - void (GL_APIENTRY * glUniform1uiv)( GLint location, GLsizei count, const GLuint *value ); - void (GL_APIENTRY * glUniform2uiv)( GLint location, GLsizei count, const GLuint *value ); - void (GL_APIENTRY * glUniform3uiv)( GLint location, GLsizei count, const GLuint *value ); - void (GL_APIENTRY * glUniform4uiv)( GLint location, GLsizei count, const GLuint *value ); - GLuint (GL_APIENTRY * glGetHandleARB) (GLenum pname); - void (GL_APIENTRY * glGetUniformIndices)(GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices); - void (GL_APIENTRY * glGetActiveUniformsiv)(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); - void (GL_APIENTRY * glGetActiveUniformName)(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); - GLuint (GL_APIENTRY * glGetUniformBlockIndex)(GLuint program, const GLchar *uniformBlockName); - void (GL_APIENTRY * glGetActiveUniformBlockiv)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); - void (GL_APIENTRY * glGetActiveUniformBlockName)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); - void (GL_APIENTRY * glUniformBlockBinding)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); - void (GL_APIENTRY * glGetProgramBinary)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); - void (GL_APIENTRY * glProgramBinary)(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length); - void (GL_APIENTRY * glUniform1d)(GLint location, GLdouble v0); - void (GL_APIENTRY * glUniform2d)(GLint location, GLdouble v0, GLdouble v1); - void (GL_APIENTRY * glUniform3d)(GLint location, GLdouble v0, GLdouble v1, GLdouble v2); - void (GL_APIENTRY * glUniform4d)(GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); - void (GL_APIENTRY * glUniform1dv)(GLint location, GLsizei count, const GLdouble *value); - void (GL_APIENTRY * glUniform2dv)(GLint location, GLsizei count, const GLdouble *value); - void (GL_APIENTRY * glUniform3dv)(GLint location, GLsizei count, const GLdouble *value); - void (GL_APIENTRY * glUniform4dv)(GLint location, GLsizei count, const GLdouble *value); - void (GL_APIENTRY * glUniformMatrix2dv)(GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); - void (GL_APIENTRY * glUniformMatrix3dv)(GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); - void (GL_APIENTRY * glUniformMatrix4dv)(GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); - void (GL_APIENTRY * glUniformMatrix2x3dv)( GLint location, GLsizei count, GLboolean transpose, const GLdouble* value ); - void (GL_APIENTRY * glUniformMatrix3x2dv)( GLint location, GLsizei count, GLboolean transpose, const GLdouble* value ); - void (GL_APIENTRY * glUniformMatrix2x4dv)( GLint location, GLsizei count, GLboolean transpose, const GLdouble* value ); - void (GL_APIENTRY * glUniformMatrix4x2dv)( GLint location, GLsizei count, GLboolean transpose, const GLdouble* value ); - void (GL_APIENTRY * glUniformMatrix3x4dv)( GLint location, GLsizei count, GLboolean transpose, const GLdouble* value ); - void (GL_APIENTRY * glUniformMatrix4x3dv)( GLint location, GLsizei count, GLboolean transpose, const GLdouble* value ); - void (GL_APIENTRY * glGetActiveAtomicCounterBufferiv)( GLuint program, GLuint bufferIndex, GLenum pname, GLint* params ); - void (GL_APIENTRY * glDispatchCompute)( GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ ); - - // Buffer Object extensions - bool isBufferObjectSupported; - bool isPBOSupported; - bool isTBOSupported; - - void (GL_APIENTRY * glGenBuffers) (GLsizei n, GLuint *buffers); - void (GL_APIENTRY * glBindBuffer) (GLenum target, GLuint buffer); - void (GL_APIENTRY * glBufferData) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); - void (GL_APIENTRY * glBufferSubData) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); - void (GL_APIENTRY * glDeleteBuffers) (GLsizei n, const GLuint *buffers); - GLboolean (GL_APIENTRY * glIsBuffer) (GLuint buffer); - void (GL_APIENTRY * glGetBufferSubData) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); - GLvoid* (GL_APIENTRY * glMapBuffer) (GLenum target, GLenum access); - GLvoid* (GL_APIENTRY * glMapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); - GLboolean (GL_APIENTRY * glUnmapBuffer) (GLenum target); - void (GL_APIENTRY * glGetBufferParameteriv) (GLenum target, GLenum pname, GLint *params); - void (GL_APIENTRY * glGetBufferPointerv) (GLenum target, GLenum pname, GLvoid* *params); - void (GL_APIENTRY * glBindBufferRange) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); - void (GL_APIENTRY * glBindBufferBase) (GLenum target, GLuint index, GLuint buffer); - void (GL_APIENTRY * glTexBuffer) (GLenum target, GLenum internalFormat, GLuint buffer); - - void (GL_APIENTRY * glMemoryBarrier)( GLbitfield barriers ); - - // BlendFunc extensions - bool isBlendFuncSeparateSupported; - void (GL_APIENTRY * glBlendFuncSeparate) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) ; - - void (GL_APIENTRY * glBlendFunci) (GLuint buf, GLenum src, GLenum dst); - void (GL_APIENTRY * glBlendFuncSeparatei) (GLuint buf, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) ; - - - // Vertex Array extensions - bool isSecondaryColorSupported; - bool isFogCoordSupported; - bool isMultiTexSupported; - bool isOcclusionQuerySupported; - bool isARBOcclusionQuerySupported; - bool isTimerQuerySupported; - bool isARBTimerQuerySupported; - - void (GL_APIENTRY * glSecondaryColor3ubv) (const GLubyte* coord); - void (GL_APIENTRY * glSecondaryColor3fv) (const GLfloat* coord); - - void (GL_APIENTRY * glFogCoordfv) (const GLfloat* coord); - - void (GL_APIENTRY * glMultiTexCoord1f) (GLenum target,GLfloat coord); - void (GL_APIENTRY * glMultiTexCoord1fv) (GLenum target,const GLfloat* coord); - void (GL_APIENTRY * glMultiTexCoord2fv) (GLenum target,const GLfloat* coord); - void (GL_APIENTRY * glMultiTexCoord3fv) (GLenum target,const GLfloat* coord); - void (GL_APIENTRY * glMultiTexCoord4fv) (GLenum target,const GLfloat* coord); - - void (GL_APIENTRY * glMultiTexCoord1d) (GLenum target,GLdouble coord); - void (GL_APIENTRY * glMultiTexCoord1dv) (GLenum target,const GLdouble* coord); - void (GL_APIENTRY * glMultiTexCoord2dv) (GLenum target,const GLdouble* coord); - void (GL_APIENTRY * glMultiTexCoord3dv) (GLenum target,const GLdouble* coord); - void (GL_APIENTRY * glMultiTexCoord4dv) (GLenum target,const GLdouble* coord); - - // Occlusion Query extensions - void (GL_APIENTRY * glGenOcclusionQueries) ( GLsizei n, GLuint *ids ); - void (GL_APIENTRY * glDeleteOcclusionQueries) ( GLsizei n, const GLuint *ids ); - GLboolean (GL_APIENTRY * glIsOcclusionQuery) ( GLuint id ); - void (GL_APIENTRY * glBeginOcclusionQuery) ( GLuint id ); - void (GL_APIENTRY * glEndOcclusionQuery) (); - void (GL_APIENTRY * glGetOcclusionQueryiv) ( GLuint id, GLenum pname, GLint *params ); - void (GL_APIENTRY * glGetOcclusionQueryuiv) ( GLuint id, GLenum pname, GLuint *params ); - - void (GL_APIENTRY * glGetQueryiv) (GLenum target, GLenum pname, GLint *params); - void (GL_APIENTRY * glGenQueries) (GLsizei n, GLuint *ids); - void (GL_APIENTRY * glBeginQuery) (GLenum target, GLuint id); - void (GL_APIENTRY * glEndQuery) (GLenum target); - void (GL_APIENTRY * glQueryCounter) (GLuint id, GLenum target); - GLboolean (GL_APIENTRY * glIsQuery) (GLuint id); - void (GL_APIENTRY * glDeleteQueries) (GLsizei n, const GLuint *ids); - void (GL_APIENTRY * glGetQueryObjectiv) (GLuint id, GLenum pname, GLint *params); - void (GL_APIENTRY * glGetQueryObjectuiv) (GLuint id, GLenum pname, GLuint *params); - void (GL_APIENTRY * glGetQueryObjectui64v) (GLuint id, GLenum pname, GLuint64 *params); - void (GL_APIENTRY * glGetInteger64v) (GLenum pname, GLint64 *params); - - - // SampleMaski functionality - bool isOpenGL32upported; - bool isTextureMultisampleSupported; - bool isSampleMaskiSupported; - - void (GL_APIENTRY * glSampleMaski) (GLuint maskNumber, GLbitfield mask); - - // Vertex/Fragment Programs - bool isVertexProgramSupported; - bool isFragmentProgramSupported; - - void (GL_APIENTRY * glBindProgram) (GLenum target, GLuint id); - void (GL_APIENTRY * glGenPrograms) (GLsizei n, GLuint *programs); - void (GL_APIENTRY * glDeletePrograms) (GLsizei n, GLuint *programs); - void (GL_APIENTRY * glProgramString) (GLenum target, GLenum format, GLsizei len, const void *string); - void (GL_APIENTRY * glProgramLocalParameter4fv) (GLenum target, GLuint index, const GLfloat *params); - - - // Texture Extensions - bool isMultiTexturingSupported; - bool isTextureFilterAnisotropicSupported; - bool isTextureSwizzleSupported; - bool isTextureCompressionARBSupported; - bool isTextureCompressionS3TCSupported; - bool isTextureCompressionPVRTC2BPPSupported; - bool isTextureCompressionPVRTC4BPPSupported; - bool isTextureCompressionETCSupported; - bool isTextureCompressionETC2Supported; - bool isTextureCompressionRGTCSupported; - bool isTextureCompressionPVRTCSupported; - bool isTextureMirroredRepeatSupported; - bool isTextureEdgeClampSupported; - bool isTextureBorderClampSupported; - bool isGenerateMipMapSupported; - bool preferGenerateMipmapSGISForPowerOfTwo; - bool isTextureMultisampledSupported; - bool isShadowSupported; - bool isShadowAmbientSupported; - bool isTextureMaxLevelSupported; - GLint maxTextureSize; - bool _isTextureStorageEnabled; - bool isClientStorageSupported; - bool isTextureIntegerEXTSupported; - bool isTextureStorageEnabled; - - bool isTexStorage2DSupported() const { return glTexStorage2D != 0; } - bool isCompressedTexImage2DSupported() const { return glCompressedTexImage2D!=0; } - bool isCompressedTexSubImage2DSupported() const { return glCompressedTexSubImage2D!=0; } - bool isBindImageTextureSupported() const { return glBindImageTexture!=0; } - bool isNonPowerOfTwoTextureMipMappedSupported; - bool isNonPowerOfTwoTextureNonMipMappedSupported; - bool isNonPowerOfTwoTextureSupported(GLenum filter) const - { - return (filter==GL_LINEAR || filter==GL_NEAREST) ? - isNonPowerOfTwoTextureNonMipMappedSupported : - isNonPowerOfTwoTextureMipMappedSupported; - } - - void (GL_APIENTRY * glTexStorage2D) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); - void (GL_APIENTRY * glCompressedTexImage2D) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); - void (GL_APIENTRY * glCompressedTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); - void (GL_APIENTRY * glGetCompressedTexImage) (GLenum target, GLint level, GLvoid *data); - void (GL_APIENTRY * glTexImage2DMultisample) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); - void (GL_APIENTRY * glTexParameterIiv) (GLenum target, GLenum pname, const GLint* data); - void (GL_APIENTRY * glTexParameterIuiv) (GLenum target, GLenum pname, const GLuint* data); - void (GL_APIENTRY * glBindImageTexture) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); - - // Texture3D extensions - bool isTexture3DSupported; - bool isTexture3DFast; - GLint maxTexture3DSize; - bool isCompressedTexImage3DSupported() const { return glCompressedTexImage3D!=0; } - bool isCompressedTexSubImage3DSupported() const { return glCompressedTexSubImage3D!=0; } - - void (GL_APIENTRY * glTexImage3D) ( GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); - void (GL_APIENTRY * glTexSubImage3D) ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); - void (GL_APIENTRY * glCopyTexSubImage3D) ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ); - void (GL_APIENTRY * glCompressedTexImage3D) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); - void (GL_APIENTRY * glCompressedTexSubImage3D) ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ); - - // Texture2DArray extensions - bool isTexture2DArraySupported; - GLint maxLayerCount; - GLint max2DSize; - - - // Blending - bool isBlendColorSupported; - bool isBlendEquationSupported; - bool isBlendEquationSeparateSupported; - bool isSGIXMinMaxSupported; - bool isLogicOpSupported; - - void (GL_APIENTRY * glBlendColor) (GLclampf red , GLclampf green , GLclampf blue , GLclampf alpha); - void (GL_APIENTRY * glBlendEquation)(GLenum mode); - void (GL_APIENTRY * glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha); - void (GL_APIENTRY * glBlendEquationi)(GLuint buf, GLenum mode); - void (GL_APIENTRY * glBlendEquationSeparatei)(GLuint buf, GLenum modeRGB, GLenum modeAlpha); - - - // glEnablei/glDisabeli - void (GL_APIENTRY * glEnablei) (GLenum capability, GLuint buf); - void (GL_APIENTRY * glDisablei) (GLenum capability, GLuint buf); - - - // Stencil - bool isStencilWrapSupported; - bool isStencilTwoSidedSupported; - bool isOpenGL20Supported; - bool isSeparateStencilSupported; - - void (GL_APIENTRY * glActiveStencilFace) (GLenum face); - void (GL_APIENTRY * glStencilOpSeparate) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); - void (GL_APIENTRY * glStencilMaskSeparate) (GLenum face, GLuint mask); - void (GL_APIENTRY * glStencilFuncSeparate) (GLenum face, GLenum func, GLint ref, GLuint mask); - void (GL_APIENTRY * glStencilFuncSeparateATI) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); - - - // ColorMask - void (GL_APIENTRY * glColorMaski)(GLuint buf, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); - - - // ClampColor - bool isClampColorSupported; - void (GL_APIENTRY * glClampColor) (GLenum target, GLenum mode); - - - // PrimitiveRestartIndex - void (GL_APIENTRY * glPrimitiveRestartIndex) ( GLuint index ); - - - // Mutlisample - bool isMultisampleSupported; - bool isMultisampleFilterHintSupported; - - void (GL_APIENTRY * glSampleCoverage) (GLclampf value, GLboolean invert); - - - // Point - bool isPointParametersSupported; - bool isPointSpriteSupported; - bool isPointSpriteCoordOriginSupported; - - void (GL_APIENTRY * glPointParameteri) (GLenum pname, GLint param); - void (GL_APIENTRY * glPointParameterf) (GLenum pname, GLfloat param); - void (GL_APIENTRY * glPointParameterfv) (GLenum pname, const GLfloat *params); - - - // FrameBuferObject - bool isFrameBufferObjectSupported; - bool isPackedDepthStencilSupported; - bool isRenderbufferMultisampleSupported() const { return glRenderbufferStorageMultisample != 0; } - bool isRenderbufferMultisampleCoverageSupported() const { return glRenderbufferStorageMultisampleCoverageNV != 0; } - - void (GL_APIENTRY * glBindRenderbuffer) (GLenum, GLuint); - void (GL_APIENTRY * glDeleteRenderbuffers) (GLsizei n, const GLuint *renderbuffers); - void (GL_APIENTRY * glGenRenderbuffers) (GLsizei, GLuint *); - void (GL_APIENTRY * glRenderbufferStorage) (GLenum, GLenum, GLsizei, GLsizei); - void (GL_APIENTRY * glRenderbufferStorageMultisample) (GLenum, GLsizei, GLenum, GLsizei, GLsizei); - void (GL_APIENTRY * glRenderbufferStorageMultisampleCoverageNV) (GLenum, GLsizei, GLsizei, GLenum, GLsizei, GLsizei); - void (GL_APIENTRY * glBindFramebuffer) (GLenum, GLuint); - void (GL_APIENTRY * glDeleteFramebuffers) (GLsizei n, const GLuint *framebuffers); - void (GL_APIENTRY * glGenFramebuffers) (GLsizei, GLuint *); - GLenum (GL_APIENTRY * glCheckFramebufferStatus) (GLenum); - - void (GL_APIENTRY * glFramebufferTexture1D) (GLenum, GLenum, GLenum, GLuint, GLint); - void (GL_APIENTRY * glFramebufferTexture2D) (GLenum, GLenum, GLenum, GLuint, GLint); - void (GL_APIENTRY * glFramebufferTexture3D) (GLenum, GLenum, GLenum, GLuint, GLint, GLint); - void (GL_APIENTRY * glFramebufferTexture) (GLenum, GLenum, GLint, GLint); - void (GL_APIENTRY * glFramebufferTextureLayer) (GLenum, GLenum, GLuint, GLint, GLint); - void (GL_APIENTRY * glFramebufferTextureFace)( GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face ); - void (GL_APIENTRY * glFramebufferRenderbuffer) (GLenum, GLenum, GLenum, GLuint); - - void (GL_APIENTRY * glGenerateMipmap) (GLenum); - void (GL_APIENTRY * glBlitFramebuffer) (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum); - void (GL_APIENTRY * glGetRenderbufferParameteriv) (GLenum, GLenum, GLint*); - - - // Sync - GLsync (GL_APIENTRY * glFenceSync) (GLenum condition, GLbitfield flags); - GLboolean (GL_APIENTRY * glIsSync) (GLsync sync); - void (GL_APIENTRY * glDeleteSync) (GLsync sync); - GLenum (GL_APIENTRY * glClientWaitSync) (GLsync sync, GLbitfield flags, GLuint64 timeout); - void (GL_APIENTRY * glWaitSync) (GLsync sync, GLbitfield flags, GLuint64 timeout); - void (GL_APIENTRY * glGetSynciv) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); - - -}; + // backwards compatibility + typedef GLExtensions GL2Extensions; } #endif diff --git a/src/osg/CMakeLists.txt b/src/osg/CMakeLists.txt index 759145b48..34958569d 100644 --- a/src/osg/CMakeLists.txt +++ b/src/osg/CMakeLists.txt @@ -276,7 +276,6 @@ SET(TARGET_SRC FrontFace.cpp Geode.cpp Geometry.cpp - GL2Extensions.cpp GLExtensions.cpp GLBeginEndAdapter.cpp GLObjects.cpp diff --git a/src/osg/GL2Extensions.cpp b/src/osg/GL2Extensions.cpp deleted file mode 100644 index d2b6bd445..000000000 --- a/src/osg/GL2Extensions.cpp +++ /dev/null @@ -1,771 +0,0 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield - * Copyright (C) 2003-2005 3Dlabs Inc. Ltd. - * Copyright (C) 2004-2005 Nathan Cournia - * Copyright (C) 2008 Zebra Imaging - * Copyright (C) 2012 David Callu - * - * This application is open source and may be redistributed and/or modified - * freely and without restriction, both in commercial and non commercial - * applications, as long as this copyright notice is maintained. - * - * This application 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. - * -*/ - -/* file: src/osg/GL2Extensions.cpp - * author: Mike Weiblen 2008-01-19 -*/ - -#include -#include -#include -#include -#include -#include - -using namespace osg; - - -/////////////////////////////////////////////////////////////////////////// -// Static array of percontext osg::GL2Extensions instances - -typedef osg::buffered_object< osg::ref_ptr > BufferedExtensions; -static BufferedExtensions s_extensions; - -GL2Extensions* GL2Extensions::Get(unsigned int contextID, bool createIfNotInitalized) -{ - if (!s_extensions[contextID] && createIfNotInitalized) - s_extensions[contextID] = new GL2Extensions(contextID); - - return s_extensions[contextID].get(); -} - -void GL2Extensions::Set(unsigned int contextID, GL2Extensions* extensions) -{ - s_extensions[contextID] = extensions; -} - -/////////////////////////////////////////////////////////////////////////// -// Extension function pointers for OpenGL v2.x - -GL2Extensions::GL2Extensions(unsigned int contextID) -{ - const char* version = (const char*) glGetString( GL_VERSION ); - if (!version) - { - OSG_NOTIFY(osg::FATAL)<<"Error: OpenGL version test failed, requires valid graphics context."<=0;; - - - - isGlslSupported = ( glVersion >= 2.0f ) || - ( isShaderObjectsSupported && - isVertexShaderSupported && - isFragmentShaderSupported && - isLanguage100Supported ); - - if( isGlslSupported ) - { - // If glGetString raises an error, assume initial release "1.00" - while(glGetError() != GL_NO_ERROR) {} // reset error flag - - const char* langVerStr = (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION); - if( (glGetError() == GL_NO_ERROR) && langVerStr ) - { - glslLanguageVersion = (findAsciiToFloat(langVerStr)); - } - else - glslLanguageVersion = 1.0f; - } - - OSG_INFO - << "glVersion=" << glVersion << ", " - << "isGlslSupported=" << (isGlslSupported ? "YES" : "NO") << ", " - << "glslLanguageVersion=" << glslLanguageVersion - << std::endl; - - - setGLExtensionFuncPtr(glDrawBuffers, "glDrawBuffers", "glDrawBuffersARB"); - setGLExtensionFuncPtr(glAttachShader, "glAttachShader", "glAttachObjectARB"); - setGLExtensionFuncPtr(glBindAttribLocation, "glBindAttribLocation", "glBindAttribLocationARB"); - setGLExtensionFuncPtr(glCompileShader, "glCompileShader", "glCompileShaderARB"); - setGLExtensionFuncPtr(glCreateProgram, "glCreateProgram", "glCreateProgramObjectARB"); - setGLExtensionFuncPtr(glCreateShader, "glCreateShader", "glCreateShaderObjectARB"); - setGLExtensionFuncPtr(glDeleteProgram, "glDeleteProgram"); - setGLExtensionFuncPtr(glDeleteShader, "glDeleteShader"); - setGLExtensionFuncPtr(glDetachShader, "glDetachShader", "glDetachObjectARB"); - setGLExtensionFuncPtr(glDisableVertexAttribArray, "glDisableVertexAttribArray"); - setGLExtensionFuncPtr(glEnableVertexAttribArray, "glEnableVertexAttribArray"); - setGLExtensionFuncPtr(glGetActiveAttrib, "glGetActiveAttrib", "glGetActiveAttribARB"); - setGLExtensionFuncPtr(glGetActiveUniform, "glGetActiveUniform", "glGetActiveUniformARB"); - setGLExtensionFuncPtr(glGetAttachedShaders, "glGetAttachedShaders", "glGetAttachedObjectsARB"); - setGLExtensionFuncPtr(glGetAttribLocation, "glGetAttribLocation", "glGetAttribLocationARB"); - setGLExtensionFuncPtr(glGetProgramiv, "glGetProgramiv"); - setGLExtensionFuncPtr(glGetProgramInfoLog, "glGetProgramInfoLog"); - setGLExtensionFuncPtr(glGetShaderiv, "glGetShaderiv"); - setGLExtensionFuncPtr(glGetShaderInfoLog, "glGetShaderInfoLog"); - setGLExtensionFuncPtr(glGetShaderSource, "glGetShaderSource", "glGetShaderSourceARB"); - setGLExtensionFuncPtr(glGetUniformLocation, "glGetUniformLocation", "glGetUniformLocationARB"); - setGLExtensionFuncPtr(glGetUniformfv, "glGetUniformfv", "glGetUniformfvARB"); - setGLExtensionFuncPtr(glGetUniformiv, "glGetUniformiv", "glGetUniformivARB"); - setGLExtensionFuncPtr(glGetVertexAttribdv, "glGetVertexAttribdv"); - setGLExtensionFuncPtr(glGetVertexAttribfv, "glGetVertexAttribfv"); - setGLExtensionFuncPtr(glGetVertexAttribiv, "glGetVertexAttribiv"); - setGLExtensionFuncPtr(glGetVertexAttribPointerv, "glGetVertexAttribPointerv"); - setGLExtensionFuncPtr(glIsProgram, "glIsProgram"); - setGLExtensionFuncPtr(glIsShader, "glIsShader"); - setGLExtensionFuncPtr(glLinkProgram, "glLinkProgram", "glLinkProgramARB"); - setGLExtensionFuncPtr(glShaderSource, "glShaderSource", "glShaderSourceARB"); - setGLExtensionFuncPtr(glUseProgram, "glUseProgram", "glUseProgramObjectARB"); - setGLExtensionFuncPtr(glUniform1f, "glUniform1f", "glUniform1fARB"); - setGLExtensionFuncPtr(glUniform2f, "glUniform2f", "glUniform2fARB"); - setGLExtensionFuncPtr(glUniform3f, "glUniform3f", "glUniform3fARB"); - setGLExtensionFuncPtr(glUniform4f, "glUniform4f", "glUniform4fARB"); - setGLExtensionFuncPtr(glUniform1i, "glUniform1i", "glUniform1iARB"); - setGLExtensionFuncPtr(glUniform2i, "glUniform2i", "glUniform2iARB"); - setGLExtensionFuncPtr(glUniform3i, "glUniform3i", "glUniform3iARB"); - setGLExtensionFuncPtr(glUniform4i, "glUniform4i", "glUniform4iARB"); - setGLExtensionFuncPtr(glUniform1fv, "glUniform1fv", "glUniform1fvARB"); - setGLExtensionFuncPtr(glUniform2fv, "glUniform2fv", "glUniform2fvARB"); - setGLExtensionFuncPtr(glUniform3fv, "glUniform3fv", "glUniform3fvARB"); - setGLExtensionFuncPtr(glUniform4fv, "glUniform4fv", "glUniform4fvARB"); - setGLExtensionFuncPtr(glUniform1iv, "glUniform1iv", "glUniform1ivARB"); - setGLExtensionFuncPtr(glUniform2iv, "glUniform2iv", "glUniform2ivARB"); - setGLExtensionFuncPtr(glUniform3iv, "glUniform3iv", "glUniform3ivARB"); - setGLExtensionFuncPtr(glUniform4iv, "glUniform4iv", "glUniform4ivARB"); - setGLExtensionFuncPtr(glUniformMatrix2fv, "glUniformMatrix2fv", "glUniformMatrix2fvARB"); - setGLExtensionFuncPtr(glUniformMatrix3fv, "glUniformMatrix3fv", "glUniformMatrix3fvARB"); - setGLExtensionFuncPtr(glUniformMatrix4fv, "glUniformMatrix4fv", "glUniformMatrix4fvARB"); - setGLExtensionFuncPtr(glValidateProgram, "glValidateProgram", "glValidateProgramARB"); - setGLExtensionFuncPtr(glVertexAttrib1d, "glVertexAttrib1d"); - setGLExtensionFuncPtr(glVertexAttrib1dv, "glVertexAttrib1dv"); - setGLExtensionFuncPtr(glVertexAttrib1f, "glVertexAttrib1f"); - setGLExtensionFuncPtr(glVertexAttrib1fv, "glVertexAttrib1fv"); - setGLExtensionFuncPtr(glVertexAttrib1s, "glVertexAttrib1s"); - setGLExtensionFuncPtr(glVertexAttrib1sv, "glVertexAttrib1sv"); - setGLExtensionFuncPtr(glVertexAttrib2d, "glVertexAttrib2d"); - setGLExtensionFuncPtr(glVertexAttrib2dv, "glVertexAttrib2dv"); - setGLExtensionFuncPtr(glVertexAttrib2f, "glVertexAttrib2f"); - setGLExtensionFuncPtr(glVertexAttrib2fv, "glVertexAttrib2fv"); - setGLExtensionFuncPtr(glVertexAttrib2s, "glVertexAttrib2s"); - setGLExtensionFuncPtr(glVertexAttrib2sv, "glVertexAttrib2sv"); - setGLExtensionFuncPtr(glVertexAttrib3d, "glVertexAttrib3d"); - setGLExtensionFuncPtr(glVertexAttrib3dv, "glVertexAttrib3dv"); - setGLExtensionFuncPtr(glVertexAttrib3f, "glVertexAttrib3f"); - setGLExtensionFuncPtr(glVertexAttrib3fv, "glVertexAttrib3fv"); - setGLExtensionFuncPtr(glVertexAttrib3s, "glVertexAttrib3s"); - setGLExtensionFuncPtr(glVertexAttrib3sv, "glVertexAttrib3sv"); - setGLExtensionFuncPtr(glVertexAttrib4Nbv, "glVertexAttrib4Nbv"); - setGLExtensionFuncPtr(glVertexAttrib4Niv, "glVertexAttrib4Niv"); - setGLExtensionFuncPtr(glVertexAttrib4Nsv, "glVertexAttrib4Nsv"); - setGLExtensionFuncPtr(glVertexAttrib4Nub, "glVertexAttrib4Nub"); - setGLExtensionFuncPtr(glVertexAttrib4Nubv, "glVertexAttrib4Nubv"); - setGLExtensionFuncPtr(glVertexAttrib4Nuiv, "glVertexAttrib4Nuiv"); - setGLExtensionFuncPtr(glVertexAttrib4Nusv, "glVertexAttrib4Nusv"); - setGLExtensionFuncPtr(glVertexAttrib4bv, "glVertexAttrib4bv"); - setGLExtensionFuncPtr(glVertexAttrib4d, "glVertexAttrib4d"); - setGLExtensionFuncPtr(glVertexAttrib4dv, "glVertexAttrib4dv"); - setGLExtensionFuncPtr(glVertexAttrib4f, "glVertexAttrib4f"); - setGLExtensionFuncPtr(glVertexAttrib4fv, "glVertexAttrib4fv"); - setGLExtensionFuncPtr(glVertexAttrib4iv, "glVertexAttrib4iv"); - setGLExtensionFuncPtr(glVertexAttrib4s, "glVertexAttrib4s"); - setGLExtensionFuncPtr(glVertexAttrib4sv, "glVertexAttrib4sv"); - setGLExtensionFuncPtr(glVertexAttrib4ubv, "glVertexAttrib4ubv"); - setGLExtensionFuncPtr(glVertexAttrib4uiv, "glVertexAttrib4uiv"); - setGLExtensionFuncPtr(glVertexAttrib4usv, "glVertexAttrib4usv"); - setGLExtensionFuncPtr(glVertexAttribPointer, "glVertexAttribPointer"); - setGLExtensionFuncPtr(glVertexAttribDivisor, "glVertexAttribDivisor"); - - // v1.5-only ARB entry points, in case they're needed for fallback - setGLExtensionFuncPtr(glGetInfoLogARB, "glGetInfoLogARB"); - setGLExtensionFuncPtr(glGetObjectParameterivARB, "glGetObjectParameterivARB"); - setGLExtensionFuncPtr(glDeleteObjectARB, "glDeleteObjectARB"); - setGLExtensionFuncPtr(glGetHandleARB, "glGetHandleARB"); - - // GL 2.1 - setGLExtensionFuncPtr(glUniformMatrix2x3fv, "glUniformMatrix2x3fv" ); - setGLExtensionFuncPtr(glUniformMatrix3x2fv, "glUniformMatrix3x2fv" ); - setGLExtensionFuncPtr(glUniformMatrix2x4fv, "glUniformMatrix2x4fv" ); - setGLExtensionFuncPtr(glUniformMatrix4x2fv, "glUniformMatrix4x2fv" ); - setGLExtensionFuncPtr(glUniformMatrix3x4fv, "glUniformMatrix3x4fv" ); - setGLExtensionFuncPtr(glUniformMatrix4x3fv, "glUniformMatrix4x3fv" ); - - // EXT_geometry_shader4 - setGLExtensionFuncPtr(glProgramParameteri, "glProgramParameteri", "glProgramParameteriEXT" ); - - // ARB_tesselation_shader - setGLExtensionFuncPtr(glPatchParameteri, "glPatchParameteri" ); - setGLExtensionFuncPtr(glPatchParameterfv, "glPatchParameterfv"); - - // EXT_gpu_shader4 - setGLExtensionFuncPtr(glGetUniformuiv, "glGetUniformuiv", "glGetUniformuivEXT" ); - setGLExtensionFuncPtr(glBindFragDataLocation, "glBindFragDataLocation", "glBindFragDataLocationEXT" ); - setGLExtensionFuncPtr(glGetFragDataLocation, "glGetFragDataLocation", "glGetFragDataLocationEXT" ); - setGLExtensionFuncPtr(glUniform1ui, "glUniform1ui", "glUniform1uiEXT" ); - setGLExtensionFuncPtr(glUniform2ui, "glUniform2ui", "glUniform2uiEXT" ); - setGLExtensionFuncPtr(glUniform3ui, "glUniform3ui", "glUniform3uiEXT" ); - setGLExtensionFuncPtr(glUniform4ui, "glUniform4ui", "glUniform4uiEXT" ); - setGLExtensionFuncPtr(glUniform1uiv, "glUniform1uiv", "glUniform1uivEXT" ); - setGLExtensionFuncPtr(glUniform2uiv, "glUniform2uiv", "glUniform2uivEXT" ); - setGLExtensionFuncPtr(glUniform3uiv, "glUniform3uiv", "glUniform3uivEXT" ); - setGLExtensionFuncPtr(glUniform4uiv, "glUniform4uiv", "glUniform4uivEXT" ); - // ARB_uniform_buffer_object - setGLExtensionFuncPtr(glGetUniformIndices, "glGetUniformIndices"); - setGLExtensionFuncPtr(glGetActiveUniformsiv, "glGetActiveUniformsiv"); - setGLExtensionFuncPtr(glGetActiveUniformName, "glGetActiveUniformName"); - setGLExtensionFuncPtr(glGetUniformBlockIndex, "glGetUniformBlockIndex"); - setGLExtensionFuncPtr(glGetActiveUniformBlockiv, "glGetActiveUniformBlockiv"); - setGLExtensionFuncPtr(glGetActiveUniformBlockName, "glGetActiveUniformBlockName"); - setGLExtensionFuncPtr(glUniformBlockBinding, "glUniformBlockBinding"); - - // ARB_get_program_binary - setGLExtensionFuncPtr(glGetProgramBinary, "glGetProgramBinary"); - setGLExtensionFuncPtr(glProgramBinary, "glProgramBinary"); - - // ARB_gpu_shader_fp64 - setGLExtensionFuncPtr(glUniform1d, "glUniform1d" ); - setGLExtensionFuncPtr(glUniform2d, "glUniform2d" ); - setGLExtensionFuncPtr(glUniform3d, "glUniform3d" ); - setGLExtensionFuncPtr(glUniform4d, "glUniform4d" ); - setGLExtensionFuncPtr(glUniform1dv, "glUniform1dv" ); - setGLExtensionFuncPtr(glUniform2dv, "glUniform2dv" ); - setGLExtensionFuncPtr(glUniform3dv, "glUniform3dv" ); - setGLExtensionFuncPtr(glUniform4dv, "glUniform4dv" ); - setGLExtensionFuncPtr(glUniformMatrix2dv, "glUniformMatrix2dv" ); - setGLExtensionFuncPtr(glUniformMatrix3dv, "glUniformMatrix3dv" ); - setGLExtensionFuncPtr(glUniformMatrix4dv, "glUniformMatrix4dv" ); - setGLExtensionFuncPtr(glUniformMatrix2x3dv, "glUniformMatrix2x3dv" ); - setGLExtensionFuncPtr(glUniformMatrix3x2dv, "glUniformMatrix3x2dv" ); - setGLExtensionFuncPtr(glUniformMatrix2x4dv, "glUniformMatrix2x4dv" ); - setGLExtensionFuncPtr(glUniformMatrix4x2dv, "glUniformMatrix4x2dv" ); - setGLExtensionFuncPtr(glUniformMatrix3x4dv, "glUniformMatrix3x4dv" ); - setGLExtensionFuncPtr(glUniformMatrix4x3dv, "glUniformMatrix4x3dv" ); - - // ARB_shader_atomic_counters - setGLExtensionFuncPtr(glGetActiveAtomicCounterBufferiv, "glGetActiveAtomicCounterBufferiv" ); - - // ARB_compute_shader - setGLExtensionFuncPtr(glDispatchCompute, "glDispatchCompute" ); - - setGLExtensionFuncPtr(glMemoryBarrier, "glMemoryBarrier", "glMemoryBarrierEXT" ); - - // BufferObject extensions - setGLExtensionFuncPtr(glGenBuffers, "glGenBuffers","glGenBuffersARB"); - setGLExtensionFuncPtr(glBindBuffer, "glBindBuffer","glBindBufferARB"); - setGLExtensionFuncPtr(glBufferData, "glBufferData","glBufferDataARB"); - setGLExtensionFuncPtr(glBufferSubData, "glBufferSubData","glBufferSubDataARB"); - setGLExtensionFuncPtr(glDeleteBuffers, "glDeleteBuffers","glDeleteBuffersARB"); - setGLExtensionFuncPtr(glIsBuffer, "glIsBuffer","glIsBufferARB"); - setGLExtensionFuncPtr(glGetBufferSubData, "glGetBufferSubData","glGetBufferSubDataARB"); - setGLExtensionFuncPtr(glMapBuffer, "glMapBuffer","glMapBufferARB"); - setGLExtensionFuncPtr(glMapBufferRange, "glMapBufferRange" ); - setGLExtensionFuncPtr(glUnmapBuffer, "glUnmapBuffer","glUnmapBufferARB"); - setGLExtensionFuncPtr(glGetBufferParameteriv, "glGetBufferParameteriv","glGetBufferParameterivARB"); - setGLExtensionFuncPtr(glGetBufferPointerv, "glGetBufferPointerv","glGetBufferPointervARB"); - setGLExtensionFuncPtr(glBindBufferRange, "glBindBufferRange"); - setGLExtensionFuncPtr(glBindBufferBase, "glBindBufferBase", "glBindBufferBaseEXT", "glBindBufferBaseNV" ); - setGLExtensionFuncPtr(glTexBuffer, "glTexBuffer","glTexBufferARB" ); - - isPBOSupported = OSG_GL3_FEATURES || osg::isGLExtensionSupported(contextID,"GL_ARB_pixel_buffer_object"); - isUniformBufferObjectSupported = osg::isGLExtensionSupported(contextID, "GL_ARB_uniform_buffer_object"); - isTBOSupported = osg::isGLExtensionSupported(contextID,"GL_ARB_texture_buffer_object"); - - - // BlendFunc extensions - isBlendFuncSeparateSupported = OSG_GLES2_FEATURES || OSG_GL3_FEATURES || - osg::isGLExtensionSupported(contextID, "GL_EXT_blend_func_separate") || - strncmp((const char*)glGetString(GL_VERSION), "1.4", 3) >= 0; - - setGLExtensionFuncPtr(glBlendFuncSeparate, "glBlendFuncSeparate", "glBlendFuncSeparateEXT"); - - setGLExtensionFuncPtr(glBlendFunci, "glBlendFunci", "glBlendFunciARB"); - setGLExtensionFuncPtr(glBlendFuncSeparatei, "glBlendFuncSeparatei", "glBlendFuncSeparateiARB"); - - - // Vertex Array extensions - isSecondaryColorSupported = isGLExtensionSupported(contextID,"GL_EXT_secondary_color"); - isFogCoordSupported = isGLExtensionSupported(contextID,"GL_EXT_fog_coord"); - isMultiTexSupported = isGLExtensionSupported(contextID,"GL_ARB_multitexture"); - isOcclusionQuerySupported = osg::isGLExtensionSupported(contextID, "GL_NV_occlusion_query" ); - isARBOcclusionQuerySupported = OSG_GL3_FEATURES || osg::isGLExtensionSupported(contextID, "GL_ARB_occlusion_query" ); - - isTimerQuerySupported = osg::isGLExtensionSupported(contextID, "GL_EXT_timer_query" ); - isARBTimerQuerySupported = osg::isGLExtensionSupported(contextID, "GL_ARB_timer_query"); - - setGLExtensionFuncPtr(glFogCoordfv, "glFogCoordfv","glFogCoordfvEXT"); - setGLExtensionFuncPtr(glSecondaryColor3ubv, "glSecondaryColor3ubv","glSecondaryColor3ubvEXT"); - setGLExtensionFuncPtr(glSecondaryColor3fv, "glSecondaryColor3fv","glSecondaryColor3fvEXT"); - setGLExtensionFuncPtr(glMultiTexCoord1f, "glMultiTexCoord1f","glMultiTexCoord1fARB"); - setGLExtensionFuncPtr(glMultiTexCoord1fv, "glMultiTexCoord1fv","glMultiTexCoord1fvARB"); - setGLExtensionFuncPtr(glMultiTexCoord2fv, "glMultiTexCoord2fv","glMultiTexCoord2fvARB"); - setGLExtensionFuncPtr(glMultiTexCoord3fv, "glMultiTexCoord3fv","glMultiTexCoord3fvARB"); - setGLExtensionFuncPtr(glMultiTexCoord4fv, "glMultiTexCoord4fv","glMultiTexCoord4fvARB"); - setGLExtensionFuncPtr(glMultiTexCoord1d, "glMultiTexCoord1d","glMultiTexCoorddfARB"); - setGLExtensionFuncPtr(glMultiTexCoord2dv, "glMultiTexCoord2dv","glMultiTexCoord2dvARB"); - setGLExtensionFuncPtr(glMultiTexCoord3dv, "glMultiTexCoord3dv","glMultiTexCoord3dvARB"); - setGLExtensionFuncPtr(glMultiTexCoord4dv, "glMultiTexCoord4dv","glMultiTexCoord4dvARB"); - - setGLExtensionFuncPtr(glVertexAttrib1s, "glVertexAttrib1s","glVertexAttrib1sARB"); - setGLExtensionFuncPtr(glVertexAttrib1f, "glVertexAttrib1f","glVertexAttrib1fARB"); - setGLExtensionFuncPtr(glVertexAttrib1d, "glVertexAttrib1d","glVertexAttrib1dARB"); - setGLExtensionFuncPtr(glVertexAttrib1fv, "glVertexAttrib1fv","glVertexAttrib1fvARB"); - setGLExtensionFuncPtr(glVertexAttrib2fv, "glVertexAttrib2fv","glVertexAttrib2fvARB"); - setGLExtensionFuncPtr(glVertexAttrib3fv, "glVertexAttrib3fv","glVertexAttrib3fvARB"); - setGLExtensionFuncPtr(glVertexAttrib4fv, "glVertexAttrib4fv","glVertexAttrib4fvARB"); - setGLExtensionFuncPtr(glVertexAttrib2dv, "glVertexAttrib2dv","glVertexAttrib2dvARB"); - setGLExtensionFuncPtr(glVertexAttrib3dv, "glVertexAttrib3dv","glVertexAttrib3dvARB"); - setGLExtensionFuncPtr(glVertexAttrib4dv, "glVertexAttrib4dv","glVertexAttrib4dvARB"); - setGLExtensionFuncPtr(glVertexAttrib4ubv, "glVertexAttrib4ubv","glVertexAttrib4ubvARB"); - setGLExtensionFuncPtr(glVertexAttrib4Nubv, "glVertexAttrib4Nubv","glVertexAttrib4NubvARB"); - - setGLExtensionFuncPtr(glGenBuffers, "glGenBuffers","glGenBuffersARB"); - setGLExtensionFuncPtr(glBindBuffer, "glBindBuffer","glBindBufferARB"); - setGLExtensionFuncPtr(glBufferData, "glBufferData","glBufferDataARB"); - setGLExtensionFuncPtr(glBufferSubData, "glBufferSubData","glBufferSubDataARB"); - setGLExtensionFuncPtr(glDeleteBuffers, "glDeleteBuffers","glDeleteBuffersARB"); - setGLExtensionFuncPtr(glIsBuffer, "glIsBuffer","glIsBufferARB"); - setGLExtensionFuncPtr(glGetBufferSubData, "glGetBufferSubData","glGetBufferSubDataARB"); - setGLExtensionFuncPtr(glMapBuffer, "glMapBuffer","glMapBufferARB"); - setGLExtensionFuncPtr(glUnmapBuffer, "glUnmapBuffer","glUnmapBufferARB"); - setGLExtensionFuncPtr(glGetBufferParameteriv, "glGetBufferParameteriv","glGetBufferParameterivARB"); - setGLExtensionFuncPtr(glGetBufferPointerv, "glGetBufferPointerv","glGetBufferPointervARB"); - - setGLExtensionFuncPtr(glGenOcclusionQueries, "glGenOcclusionQueries","glGenOcclusionQueriesNV"); - setGLExtensionFuncPtr(glDeleteOcclusionQueries, "glDeleteOcclusionQueries","glDeleteOcclusionQueriesNV"); - setGLExtensionFuncPtr(glIsOcclusionQuery, "glIsOcclusionQuery","_glIsOcclusionQueryNV"); - setGLExtensionFuncPtr(glBeginOcclusionQuery, "glBeginOcclusionQuery","glBeginOcclusionQueryNV"); - setGLExtensionFuncPtr(glEndOcclusionQuery, "glEndOcclusionQuery","glEndOcclusionQueryNV"); - setGLExtensionFuncPtr(glGetOcclusionQueryiv, "glGetOcclusionQueryiv","glGetOcclusionQueryivNV"); - setGLExtensionFuncPtr(glGetOcclusionQueryuiv, "glGetOcclusionQueryuiv","glGetOcclusionQueryuivNV"); - - setGLExtensionFuncPtr(glGenQueries, "glGenQueries", "glGenQueriesARB"); - setGLExtensionFuncPtr(glDeleteQueries, "glDeleteQueries", "glDeleteQueriesARB"); - setGLExtensionFuncPtr(glIsQuery, "glIsQuery", "glIsQueryARB"); - setGLExtensionFuncPtr(glBeginQuery, "glBeginQuery", "glBeginQueryARB"); - setGLExtensionFuncPtr(glEndQuery, "glEndQuery", "glEndQueryARB"); - setGLExtensionFuncPtr(glGetQueryiv, "glGetQueryiv", "glGetQueryivARB"); - setGLExtensionFuncPtr(glGetQueryObjectiv, "glGetQueryObjectiv","glGetQueryObjectivARB"); - setGLExtensionFuncPtr(glGetQueryObjectuiv, "glGetQueryObjectuiv","glGetQueryObjectuivARB"); - setGLExtensionFuncPtr(glGetQueryObjectui64v, "glGetQueryObjectui64v","glGetQueryObjectui64vEXT"); - setGLExtensionFuncPtr(glQueryCounter, "glQueryCounter"); - setGLExtensionFuncPtr(glGetInteger64v, "glGetInteger64v"); - - - // SampleMaski functionality - isTextureMultisampleSupported = isGLExtensionSupported(contextID, "GL_ARB_texture_multisample"); - isOpenGL32upported = getGLVersionNumber() >= 3.2; - - // function pointers - setGLExtensionFuncPtr(glSampleMaski, "glSampleMaski"); - // protect against buggy drivers (maybe not necessary) - isSampleMaskiSupported = glSampleMaski!=0; - - - - // old styple Vertex/Fragment Programs - isVertexProgramSupported = isGLExtensionSupported(contextID,"GL_ARB_vertex_program"); - isFragmentProgramSupported = isGLExtensionSupported(contextID,"GL_ARB_fragment_program"); - - setGLExtensionFuncPtr(glBindProgram,"glBindProgramARB"); - setGLExtensionFuncPtr(glGenPrograms, "glGenProgramsARB"); - setGLExtensionFuncPtr(glDeletePrograms, "glDeleteProgramsARB"); - setGLExtensionFuncPtr(glProgramString, "glProgramStringARB"); - setGLExtensionFuncPtr(glProgramLocalParameter4fv, "glProgramLocalParameter4fvARB"); - - - - // Texture extensions - const char* renderer = (const char*) glGetString(GL_RENDERER); - std::string rendererString(renderer ? renderer : ""); - - bool radeonHardwareDetected = (rendererString.find("Radeon")!=std::string::npos || rendererString.find("RADEON")!=std::string::npos); - bool fireGLHardwareDetected = (rendererString.find("FireGL")!=std::string::npos || rendererString.find("FIREGL")!=std::string::npos); - - bool builtInSupport = OSG_GLES2_FEATURES || OSG_GL3_FEATURES; - - isMultiTexturingSupported = builtInSupport || OSG_GLES1_FEATURES || - isGLExtensionOrVersionSupported( contextID,"GL_ARB_multitexture", 1.3f) || - isGLExtensionOrVersionSupported(contextID,"GL_EXT_multitexture", 1.3f); - - isTextureFilterAnisotropicSupported = isGLExtensionSupported(contextID,"GL_EXT_texture_filter_anisotropic"); - isTextureSwizzleSupported = isGLExtensionSupported(contextID,"GL_ARB_texture_swizzle"); - isTextureCompressionARBSupported = builtInSupport || isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_compression", 1.3f); - isTextureCompressionS3TCSupported = isGLExtensionSupported(contextID,"GL_EXT_texture_compression_s3tc"); - isTextureCompressionPVRTC2BPPSupported = isGLExtensionSupported(contextID,"GL_IMG_texture_compression_pvrtc"); - isTextureCompressionPVRTC4BPPSupported = isTextureCompressionPVRTC2BPPSupported;//covered by same extension - isTextureCompressionETCSupported = isGLExtensionSupported(contextID,"GL_OES_compressed_ETC1_RGB8_texture"); - isTextureCompressionETC2Supported = isGLExtensionSupported(contextID,"GL_ARB_ES3_compatibility"); - isTextureCompressionRGTCSupported = isGLExtensionSupported(contextID,"GL_EXT_texture_compression_rgtc"); - isTextureCompressionPVRTCSupported = isGLExtensionSupported(contextID,"GL_IMG_texture_compression_pvrtc"); - - isTextureMirroredRepeatSupported = builtInSupport || - isGLExtensionOrVersionSupported(contextID,"GL_IBM_texture_mirrored_repeat", 1.4f) || - isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_mirrored_repeat", 1.4f); - - isTextureEdgeClampSupported = builtInSupport || - isGLExtensionOrVersionSupported(contextID,"GL_EXT_texture_edge_clamp", 1.2f) || - isGLExtensionOrVersionSupported(contextID,"GL_SGIS_texture_edge_clamp", 1.2f); - - - isTextureBorderClampSupported = OSG_GL3_FEATURES || ((OSG_GL1_FEATURES || OSG_GL2_FEATURES) && isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_border_clamp", 1.3f)); - isGenerateMipMapSupported = builtInSupport || isGLExtensionOrVersionSupported(contextID,"GL_SGIS_generate_mipmap", 1.4f); - preferGenerateMipmapSGISForPowerOfTwo = (radeonHardwareDetected||fireGLHardwareDetected) ? false : true; - isTextureMultisampledSupported = isGLExtensionSupported(contextID,"GL_ARB_texture_multisample"); - isShadowSupported = OSG_GL3_FEATURES || isGLExtensionSupported(contextID,"GL_ARB_shadow"); - isShadowAmbientSupported = isGLExtensionSupported(contextID,"GL_ARB_shadow_ambient"); - isClientStorageSupported = isGLExtensionSupported(contextID,"GL_APPLE_client_storage"); - isNonPowerOfTwoTextureNonMipMappedSupported = builtInSupport || isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_non_power_of_two", 2.0) || isGLExtensionSupported(contextID,"GL_APPLE_texture_2D_limited_npot"); - isNonPowerOfTwoTextureMipMappedSupported = builtInSupport || isNonPowerOfTwoTextureNonMipMappedSupported; - isTextureIntegerEXTSupported = OSG_GL3_FEATURES || isGLExtensionSupported(contextID, "GL_EXT_texture_integer"); - - if (rendererString.find("GeForce FX")!=std::string::npos) - { - isNonPowerOfTwoTextureMipMappedSupported = false; - OSG_INFO<<"Disabling _isNonPowerOfTwoTextureMipMappedSupported for GeForce FX hardware."<= 1.2f ); - - isTextureStorageEnabled = isTexStorage2DSupported(); - if ( (ptr = getenv("OSG_GL_TEXTURE_STORAGE")) != 0 && isTexStorage2DSupported()) - { - if (strcmp(ptr,"OFF")==0 || strcmp(ptr,"DISABLE")==0 ) isTextureStorageEnabled = false; - else isTextureStorageEnabled = true; - } - - - // Texture3D extensions - isTexture3DFast = OSG_GL3_FEATURES || isGLExtensionSupported(contextID,"GL_EXT_texture3D"); - - if (isTexture3DFast) isTexture3DSupported = true; - else isTexture3DSupported = strncmp((const char*)glGetString(GL_VERSION),"1.2",3)>=0; - - maxTexture3DSize = 0; - glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &maxTexture3DSize); - - setGLExtensionFuncPtr(glTexImage3D, "glTexImage3D","glTexImage3DEXT"); - setGLExtensionFuncPtr(glTexSubImage3D, "glTexSubImage3D","glTexSubImage3DEXT"); - setGLExtensionFuncPtr(glCompressedTexImage3D, "glCompressedTexImage3D","glCompressedTexImage3DARB"); - setGLExtensionFuncPtr(glCompressedTexSubImage3D, "glCompressedTexSubImage3D","glCompressedTexSubImage3DARB"); - setGLExtensionFuncPtr(glCopyTexSubImage3D, "glCopyTexSubImage3D","glCopyTexSubImage3DEXT"); - - - // Texture2DArray extensions - isTexture2DArraySupported = OSG_GL3_FEATURES || isGLExtensionSupported(contextID,"GL_EXT_texture_array"); - - max2DSize = 0; - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max2DSize); - maxLayerCount = 0; - glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS_EXT, &maxLayerCount); - - // Blending - isBlendColorSupported = OSG_GLES2_FEATURES || OSG_GL3_FEATURES || - isGLExtensionSupported(contextID,"GL_EXT_blend_color") || - strncmp((const char*)glGetString(GL_VERSION),"1.2",3)>=0; - - setGLExtensionFuncPtr(glBlendColor, "glBlendColor", "glBlendColorEXT"); - - bool bultInSupport = OSG_GLES2_FEATURES || OSG_GL3_FEATURES; - isBlendEquationSupported = bultInSupport || - isGLExtensionSupported(contextID, "GL_EXT_blend_equation") || - strncmp((const char*)glGetString(GL_VERSION), "1.2", 3) >= 0; - - - isBlendEquationSeparateSupported = bultInSupport || - isGLExtensionSupported(contextID, "GL_EXT_blend_equation_separate") || - strncmp((const char*)glGetString(GL_VERSION), "2.0", 3) >= 0; - - - isSGIXMinMaxSupported = isGLExtensionSupported(contextID, "GL_SGIX_blend_alpha_minmax"); - isLogicOpSupported = isGLExtensionSupported(contextID, "GL_EXT_blend_logic_op"); - - setGLExtensionFuncPtr(glBlendEquation, "glBlendEquation", "glBlendEquationEXT"); - setGLExtensionFuncPtr(glBlendEquationSeparate, "glBlendEquationSeparate", "glBlendEquationSeparateEXT"); - - setGLExtensionFuncPtr(glBlendEquationi, "glBlendEquationi", "glBlendEquationiARB"); - setGLExtensionFuncPtr(glBlendEquationSeparatei, "glBlendEquationSeparatei", "glBlendEquationSeparateiARB"); - - - // glEnablei/glDisabli - setGLExtensionFuncPtr(glEnablei, "glEnablei"); - setGLExtensionFuncPtr(glDisablei, "glDisablei"); - - - // Stencil` - isStencilWrapSupported = isGLExtensionOrVersionSupported(contextID, "GL_EXT_stencil_wrap", 1.4f); - isStencilTwoSidedSupported = isGLExtensionSupported(contextID, "GL_EXT_stencil_two_side"); - isOpenGL20Supported = getGLVersionNumber() >= 2.0; - isSeparateStencilSupported = isGLExtensionSupported(contextID, "GL_ATI_separate_stencil"); - - // function pointers - setGLExtensionFuncPtr(glActiveStencilFace, "glActiveStencilFaceEXT"); - setGLExtensionFuncPtr(glStencilOpSeparate, "glStencilOpSeparate", "glStencilOpSeparateATI"); - setGLExtensionFuncPtr(glStencilMaskSeparate, "glStencilMaskSeparate"); - setGLExtensionFuncPtr(glStencilFuncSeparate, "glStencilFuncSeparate", "glStencilFuncSeparateATI"); - setGLExtensionFuncPtr(glStencilFuncSeparateATI, "glStencilFuncSeparateATI"); - - - // Color Mask - setGLExtensionFuncPtr(glColorMaski, "glColorMaski", "glColorMaskiARB"); - - - // ClampColor - isClampColorSupported = OSG_GL3_FEATURES || - isGLExtensionSupported(contextID,"GL_ARB_color_buffer_float") || - strncmp((const char*)glGetString(GL_VERSION),"2.0",3)>=0; - - setGLExtensionFuncPtr(glClampColor, "glClampColor", "glClampColorARB"); - - - // PrimitiveRestartIndex - setGLExtensionFuncPtr(glPrimitiveRestartIndex, "glPrimitiveRestartIndex", "glPrimitiveRestartIndexNV"); - - - // Point - isPointParametersSupported = OSG_GL3_FEATURES || - strncmp((const char*)glGetString(GL_VERSION),"1.4",3)>=0 || - isGLExtensionSupported(contextID,"GL_ARB_point_parameters") || - isGLExtensionSupported(contextID,"GL_EXT_point_parameters") || - isGLExtensionSupported(contextID,"GL_SGIS_point_parameters"); - - - isPointSpriteSupported = OSG_GL3_FEATURES || isGLExtensionSupported(contextID, "GL_ARB_point_sprite") || isGLExtensionSupported(contextID, "GL_OES_point_sprite") || isGLExtensionSupported(contextID, "GL_NV_point_sprite"); - isPointSpriteCoordOriginSupported = OSG_GL3_FEATURES || strncmp((const char*)glGetString(GL_VERSION),"2.0",3)>=0; - - - setGLExtensionFuncPtr(glPointParameteri, "glPointParameteri", "glPointParameteriARB"); - if (!glPointParameteri) setGLExtensionFuncPtr(glPointParameteri, "glPointParameteriEXT", "glPointParameteriSGIS"); - - setGLExtensionFuncPtr(glPointParameterf, "glPointParameterf", "glPointParameterfARB"); - if (!glPointParameterf) setGLExtensionFuncPtr(glPointParameterf, "glPointParameterfEXT", "glPointParameterfSGIS"); - - setGLExtensionFuncPtr(glPointParameterfv, "glPointParameterfv", "glPointParameterfvARB"); - if (!glPointParameterfv) setGLExtensionFuncPtr(glPointParameterfv, "glPointParameterfvEXT", "glPointParameterfvSGIS"); - - - // Multisample - isMultisampleSupported = OSG_GLES2_FEATURES || OSG_GL3_FEATURES || isGLExtensionSupported(contextID,"GL_ARB_multisample"); - isMultisampleFilterHintSupported = isGLExtensionSupported(contextID, "GL_NV_multisample_filter_hint"); - - setGLExtensionFuncPtr(glSampleCoverage, "glSampleCoverageARB"); - - - // FrameBufferObject - setGLExtensionFuncPtr(glBindRenderbuffer, "glBindRenderbuffer", "glBindRenderbufferEXT", "glBindRenderbufferOES"); - setGLExtensionFuncPtr(glDeleteRenderbuffers, "glDeleteRenderbuffers", "glDeleteRenderbuffersEXT", "glDeleteRenderbuffersOES"); - setGLExtensionFuncPtr(glGenRenderbuffers, "glGenRenderbuffers", "glGenRenderbuffersEXT", "glGenRenderbuffersOES"); - setGLExtensionFuncPtr(glRenderbufferStorage, "glRenderbufferStorage", "glRenderbufferStorageEXT", "glRenderbufferStorageOES"); - setGLExtensionFuncPtr(glRenderbufferStorageMultisample, "glRenderbufferStorageMultisample", "glRenderbufferStorageMultisampleEXT", "glRenderbufferStorageMultisampleOES"); - setGLExtensionFuncPtr(glRenderbufferStorageMultisampleCoverageNV, "glRenderbufferStorageMultisampleCoverageNV"); - setGLExtensionFuncPtr(glBindFramebuffer, "glBindFramebuffer", "glBindFramebufferEXT", "glBindFramebufferOES"); - setGLExtensionFuncPtr(glDeleteFramebuffers, "glDeleteFramebuffers", "glDeleteFramebuffersEXT", "glDeleteFramebuffersOES"); - setGLExtensionFuncPtr(glGenFramebuffers, "glGenFramebuffers", "glGenFramebuffersEXT", "glGenFramebuffersOES"); - setGLExtensionFuncPtr(glCheckFramebufferStatus, "glCheckFramebufferStatus", "glCheckFramebufferStatusEXT", "glCheckFramebufferStatusOES"); - - setGLExtensionFuncPtr(glFramebufferTexture1D, "glFramebufferTexture1D", "glFramebufferTexture1DEXT", "glFramebufferTexture1DOES"); - setGLExtensionFuncPtr(glFramebufferTexture2D, "glFramebufferTexture2D", "glFramebufferTexture2DEXT", "glFramebufferTexture2DOES"); - setGLExtensionFuncPtr(glFramebufferTexture3D, "glFramebufferTexture3D", "glFramebufferTexture3DEXT", "glFramebufferTexture3DOES"); - setGLExtensionFuncPtr(glFramebufferTexture, "glFramebufferTexture", "glFramebufferTextureEXT", "glFramebufferTextureOES"); - setGLExtensionFuncPtr(glFramebufferTextureLayer, "glFramebufferTextureLayer", "glFramebufferTextureLayerEXT", "glFramebufferTextureLayerOES"); - setGLExtensionFuncPtr(glFramebufferTextureFace, "glFramebufferTextureFace", "glFramebufferTextureFaceEXT", "glFramebufferTextureFaceOES" ); - setGLExtensionFuncPtr(glFramebufferRenderbuffer, "glFramebufferRenderbuffer", "glFramebufferRenderbufferEXT", "glFramebufferRenderbufferOES"); - - setGLExtensionFuncPtr(glGenerateMipmap, "glGenerateMipmap", "glGenerateMipmapEXT", "glGenerateMipmapOES"); - setGLExtensionFuncPtr(glBlitFramebuffer, "glBlitFramebuffer", "glBlitFramebufferEXT", "glBlitFramebufferOES"); - setGLExtensionFuncPtr(glGetRenderbufferParameteriv, "glGetRenderbufferParameteriv", "glGetRenderbufferParameterivEXT", "glGetRenderbufferParameterivOES"); - - isFrameBufferObjectSupported = - glBindRenderbuffer != 0 && - glDeleteRenderbuffers != 0 && - glGenRenderbuffers != 0 && - glRenderbufferStorage != 0 && - glBindFramebuffer != 0 && - glDeleteFramebuffers != 0 && - glGenFramebuffers != 0 && - glCheckFramebufferStatus != 0 && - glFramebufferTexture2D != 0 && - glFramebufferRenderbuffer != 0 && - glGenerateMipmap != 0 && - glGetRenderbufferParameteriv != 0; - - isPackedDepthStencilSupported = OSG_GL3_FEATURES || - (isGLExtensionSupported(contextID, "GL_EXT_packed_depth_stencil")) || - (isGLExtensionSupported(contextID, "GL_OES_packed_depth_stencil")); - - - // Sync - osg::setGLExtensionFuncPtr(glFenceSync, "glFenceSync"); - osg::setGLExtensionFuncPtr(glIsSync, "glIsSync"); - osg::setGLExtensionFuncPtr(glDeleteSync, "glDeleteSync"); - osg::setGLExtensionFuncPtr(glClientWaitSync, "glClientWaitSync"); - osg::setGLExtensionFuncPtr(glWaitSync, "glWaitSync"); - osg::setGLExtensionFuncPtr(glGetSynciv, "glGetSynciv"); - -} - - - -/////////////////////////////////////////////////////////////////////////// -// C++-friendly convenience methods - -GLuint GL2Extensions::getCurrentProgram() const -{ - if( glVersion >= 2.0f ) - { - // GLSL as GL v2.0 core functionality - GLint result = 0; - glGetIntegerv( GL_CURRENT_PROGRAM, &result ); - return static_cast(result); - } - else if (glGetHandleARB) - { - // fallback for GLSL as GL v1.5 ARB extension -#ifndef GL_PROGRAM_OBJECT_ARB -#define GL_PROGRAM_OBJECT_ARB 0x8B40 -#endif - return glGetHandleARB( GL_PROGRAM_OBJECT_ARB ); - } - else - { - OSG_WARN<<"Warning GL2Extensions::getCurrentProgram not supported"< 1 ) - { - GLchar* infoLog = new GLchar[bufLen]; - glGetProgramInfoLog( program, bufLen, &strLen, infoLog ); - if( strLen > 0 ) result = reinterpret_cast(infoLog); - delete [] infoLog; - } - return (strLen > 0); -} - - -bool GL2Extensions::getShaderInfoLog( GLuint shader, std::string& result ) const -{ - GLsizei bufLen = 0; // length of buffer to allocate - GLsizei strLen = 0; // strlen GL actually wrote to buffer - - glGetShaderiv( shader, GL_INFO_LOG_LENGTH, &bufLen ); - if( bufLen > 1 ) - { - GLchar* infoLog = new GLchar[bufLen]; - glGetShaderInfoLog( shader, bufLen, &strLen, infoLog ); - if( strLen > 0 ) result = reinterpret_cast(infoLog); - delete [] infoLog; - } - return (strLen > 0); -} - - -bool GL2Extensions::getAttribLocation( const char* attribName, GLuint& location ) const -{ - // is there an active GLSL program? - GLuint program = getCurrentProgram(); - if( glIsProgram(program) == GL_FALSE ) return false; - - // has that program been successfully linked? - GLint linked = GL_FALSE; - glGetProgramiv( program, GL_LINK_STATUS, &linked ); - if( linked == GL_FALSE ) return false; - - // is there such a named attribute? - GLint loc = glGetAttribLocation( program, reinterpret_cast(attribName) ); - if( loc < 0 ) return false; - - location = loc; - return true; -} - - -bool GL2Extensions::getFragDataLocation( const char* fragDataName, GLuint& location ) const -{ - // is there an active GLSL program? - GLuint program = getCurrentProgram(); - if( glIsProgram(program) == GL_FALSE ) return false; - - // has that program been successfully linked? - GLint linked = GL_FALSE; - glGetProgramiv( program, GL_LINK_STATUS, &linked ); - if( linked == GL_FALSE ) return false; - - // check if supported - if (glGetFragDataLocation == NULL) return false; - - // is there such a named attribute? - GLint loc = glGetFragDataLocation( program, reinterpret_cast(fragDataName) ); - if( loc < 0 ) return false; - - location = loc; - return true; -} - diff --git a/src/osgAnimation/RigGeometry.cpp b/src/osgAnimation/RigGeometry.cpp index a8fe34f9d..344d129b8 100644 --- a/src/osgAnimation/RigGeometry.cpp +++ b/src/osgAnimation/RigGeometry.cpp @@ -16,7 +16,6 @@ #include #include #include -#include using namespace osgAnimation; diff --git a/src/osgDB/ObjectWrapper.cpp b/src/osgDB/ObjectWrapper.cpp index 0a950e4fc..d95fb456d 100644 --- a/src/osgDB/ObjectWrapper.cpp +++ b/src/osgDB/ObjectWrapper.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include