1 #ifndef SOGLDRIVERDATABASE_H 2 #define SOGLDRIVERDATABASE_H 3 4 /**************************************************************************\ 5 * Copyright (c) Kongsberg Oil & Gas Technologies AS 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions are 10 * met: 11 * 12 * Redistributions of source code must retain the above copyright notice, 13 * this list of conditions and the following disclaimer. 14 * 15 * Redistributions in binary form must reproduce the above copyright 16 * notice, this list of conditions and the following disclaimer in the 17 * documentation and/or other materials provided with the distribution. 18 * 19 * Neither the name of the copyright holder nor the names of its 20 * contributors may be used to endorse or promote products derived from 21 * this software without specific prior written permission. 22 * 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 \**************************************************************************/ 35 36 #include <Inventor/C/glue/gl.h> 37 #include <Inventor/lists/SbList.h> 38 39 class SoGLDriver; 40 class SoGLDriverDatabaseP; 41 class SbName; 42 43 class COIN_DLL_API SoGLDriverDatabase { 44 public: 45 static SbBool isSupported(const cc_glglue * context, const SbName & feature); 46 static SbBool isBroken(const cc_glglue * context, const SbName & feature); 47 static SbBool isSlow(const cc_glglue * context, const SbName & feature); 48 static SbBool isFast(const cc_glglue * context, const SbName & feature); 49 50 static SbName getComment(const cc_glglue * context, const SbName & feature); 51 52 static void loadFromBuffer(const char * buffer); 53 static void loadFromFile(const SbName & filename); 54 55 static void addBuffer(const char * buffer); 56 static void addFile(const SbName & filename); 57 58 static void addFeature(const SbName & feature, const SbName & comment); 59 60 public: 61 static void init(void); 62 63 private: 64 static SoGLDriverDatabaseP * pimpl(void); 65 }; 66 67 /**************************************************************************/ 68 69 // OpenGL features that can't be checked with a single GL_ARB/EXT extension test 70 #define SO_GL_MULTIDRAW_ELEMENTS "COIN_multidraw_elements" 71 #define SO_GL_POLYGON_OFFSET "COIN_polygon_offset" 72 #define SO_GL_TEXTURE_OBJECT "COIN_texture_object" 73 #define SO_GL_3D_TEXTURES "COIN_3d_textures" 74 #define SO_GL_MULTITEXTURE "COIN_multitexture" 75 #define SO_GL_TEXSUBIMAGE "COIN_texsubimage" 76 #define SO_GL_2D_PROXY_TEXTURES "COIN_2d_proxy_textures" 77 #define SO_GL_TEXTURE_EDGE_CLAMP "COIN_texture_edge_clamp" 78 #define SO_GL_TEXTURE_COMPRESSION "COIN_texture_compression" 79 #define SO_GL_COLOR_TABLES "COIN_color_tables" 80 #define SO_GL_COLOR_SUBTABLES "COIN_color_subtables" 81 #define SO_GL_PALETTED_TEXTURES "COIN_paletted_textures" 82 #define SO_GL_BLEND_EQUATION "COIN_blend_equation" 83 #define SO_GL_VERTEX_ARRAY "COIN_vertex_array" 84 #define SO_GL_NV_VERTEX_ARRAY_RANGE "COIN_nv_vertex_array_range" 85 #define SO_GL_VERTEX_BUFFER_OBJECT "COIN_vertex_buffer_object" 86 #define SO_GL_ARB_FRAGMENT_PROGRAM "COIN_arb_fragment_program" 87 #define SO_GL_ARB_VERTEX_PROGRAM "COIN_arb_vertex_program" 88 #define SO_GL_ARB_VERTEX_SHADER "COIN_arb_vertex_shader" 89 #define SO_GL_ARB_SHADER_OBJECT "COIN_arb_shader_object" 90 #define SO_GL_OCCLUSION_QUERY "COIN_occlusion_query" 91 #define SO_GL_FRAMEBUFFER_OBJECT "COIN_framebuffer_object" 92 #define SO_GL_ANISOTROPIC_FILTERING "COIN_anisotropic_filtering" 93 #define SO_GL_SORTED_LAYERS_BLEND "COIN_sorted_layers_blend" 94 #define SO_GL_BUMPMAPPING "COIN_bumpmapping" 95 #define SO_GL_VBO_IN_DISPLAYLIST "COIN_vbo_in_displaylist" 96 #define SO_GL_NON_POWER_OF_TWO_TEXTURES "COIN_non_power_of_two_textures" 97 #define SO_GL_GENERATE_MIPMAP "COIN_generate_mipmap" 98 #define SO_GL_GLSL_CLIP_VERTEX_HW "COIN_GLSL_clip_vertex_hw" 99 #endif // SOGLDATABASE_H 100