Gizmo3D

gzGraphicsEngine.h

Go to the documentation of this file.
00001 //*****************************************************************************
00002 // File         : gzGraphicsEngine.h
00003 // Module       : 
00004 // Description  : Class definition of stub calls
00005 // Author       : Anders Modén      
00006 // Product      : Gizmo3D 2.1.1
00007 //      
00008 // Copyright © 2003- Saab Training Systems AB, Sweden
00009 //          
00010 // NOTE:    Gizmo3D is a high performance 3D Scene Graph and effect visualisation 
00011 //          C++ toolkit for Linux, Mac OS X, Windows (Win32) and IRIX® for  
00012 //          usage in Game or VisSim development.
00013 //
00014 //
00015 // Revision History...                          
00016 //                                  
00017 // Who  Date    Description                     
00018 //                                  
00019 // AMO  990217  Created file    
00020 //
00021 //******************************************************************************
00022 
00023 #ifndef __GZ_GRAPHICS_ENGINE_H__
00024 #define __GZ_GRAPHICS_ENGINE_H__
00025 
00032 #include "gzBasicTypes.h"
00033 #include "gzGraphicsAbstractionLayer.h"
00034 #include "gzBase.h"
00035 
00037 
00038 enum gzEngineType
00039 { 
00040     GZ_ENGINE_NONE      = -1 , 
00041     GZ_ENGINE_DEBUG     =  0 , 
00042     GZ_ENGINE_SOFTWARE  =  1 , 
00043     GZ_ENGINE_OPENGL    =  2 , 
00044     GZ_ENGINE_DIRECTX   =  3 ,
00045 } ;
00046 
00047 enum gzEngineVendor
00048 {
00049     GZ_ENGINE_VENDOR_UNKNOWN    =   0,
00050     GZ_ENGINE_VENDOR_NVIDIA     =   1,
00051     GZ_ENGINE_VENDOR_ATI        =   2,
00052     GZ_ENGINE_VENDOR_MATROX     =   3,
00053     GZ_ENGINE_VENDOR_INTEL      =   4,
00054     GZ_ENGINE_VENDOR_MESA       =   5,
00055 };
00056 
00057 const gzUByte GZ_MAX_3D_ENGINES=10;
00058 
00059 //-------------------- engine dependant implementations ------------------------
00060 
00061 //******************************************************************************
00062 // Class    : gzGraphicsEngine
00063 //                                  
00064 // Purpose  : -
00065 //                                  
00066 // Notes    : - 
00067 //                                  
00068 // Revision History...                          
00069 //                                  
00070 // Who  Date    Description                     
00071 //                                  
00072 // AMO  990217  Created 
00073 //                                  
00074 //******************************************************************************
00075 class gzGraphicsEngine
00076 {
00077 public:
00078 
00079     // ------------------- extensions. Not basically supported by Engine --------------------
00080 
00081     GZ_GRAPH_EXPORT static  inline  gzBool  has_vertex_array()              { return s_vertex_array; }
00082     GZ_GRAPH_EXPORT static  inline  gzBool  has_polygon_offset()            { return s_polygon_offset; }
00083     GZ_GRAPH_EXPORT static  inline  gzBool  has_multitexture()              { return s_multitexture; }
00084     GZ_GRAPH_EXPORT static  inline  gzBool  has_compiled_vertex_array()     { return s_compiled_vertex_array; }
00085     GZ_GRAPH_EXPORT static  inline  gzBool  has_texenvop()                  { return s_texenvop; }
00086     GZ_GRAPH_EXPORT static  inline  gzBool  has_pbuffer()                   { return s_pbuffer; }
00087     GZ_GRAPH_EXPORT static  inline  gzBool  has_compressed_textures()       { return s_compressed_textures; }
00088     GZ_GRAPH_EXPORT static  inline  gzBool  has_compressed_s3tc()           { return s_compressed_s3tc; }
00089     GZ_GRAPH_EXPORT static  inline  gzBool  has_depth_clamp()               { return s_depth_clamp; }
00090     
00091     GZ_GRAPH_EXPORT static  inline  gzBool  has_vertex_program()            { return s_vertex_program; }
00092     GZ_GRAPH_EXPORT static  inline  gzBool  has_fragment_program()          { return s_fragment_program; }
00093     
00094     GZ_GRAPH_EXPORT static  inline  gzBool  has_vertex_buffer_object()      { return s_vertex_buffer_object; }
00095     
00096     GZ_GRAPH_EXPORT static  inline  gzBool  has_two_sided_stencil()         { return s_two_sided_stencil; }
00097     GZ_GRAPH_EXPORT static  inline  gzBool  has_separate_stencil()          { return s_separate_stencil; }
00098 
00099     GZ_GRAPH_EXPORT static  inline  gzBool  has_shader_objects()            { return s_shader_objects; }
00100     GZ_GRAPH_EXPORT static  inline  gzBool  has_vertex_shader()             { return s_vertex_shader; }
00101     GZ_GRAPH_EXPORT static  inline  gzBool  has_fragment_shader()           { return s_fragment_shader; }
00102     GZ_GRAPH_EXPORT static  inline  gzBool  has_multisample()               { return s_multisample; }
00103     GZ_GRAPH_EXPORT static  inline  gzBool  has_auto_mipmap()               { return s_auto_mipmap; }
00104     GZ_GRAPH_EXPORT static  inline  gzBool  has_npot_texture()              { return s_npot_texture; }
00105     GZ_GRAPH_EXPORT static  inline  gzBool  has_pixel_buffer_object()       { return s_pixel_buffer_object; }
00106     GZ_GRAPH_EXPORT static  inline  gzBool  has_geometry_shader()           { return s_geometry_shader; }
00107     GZ_GRAPH_EXPORT static  inline  gzBool  has_draw_instanced()            { return s_draw_instanced; }
00108 
00109     // --- limits ------
00110 
00111     GZ_GRAPH_EXPORT static  inline  gzInt   getMaxTextureSize()             { return s_maxtexturesize; }
00112 
00113     GZ_GRAPH_EXPORT static  inline  gzULong getNumberOfTextureUnits()       { return s_numberOfTextureUnits; }
00114 
00115     GZ_GRAPH_EXPORT static  inline  gzBool  isRemoteConnection()            { return s_remoteConnection; }
00116     
00117     // --- generic -----
00118 
00119     GZ_GRAPH_EXPORT static  inline  gzEngineVendor  getEngineVendor()       { return s_engineVendor; }
00120     GZ_GRAPH_EXPORT static gzBool                   hasValidEngine();
00121     GZ_GRAPH_EXPORT static gzVoid                   useEngine(gzEngineType type);
00122     GZ_GRAPH_EXPORT static gzEngineType             getEngineType();
00123     GZ_GRAPH_EXPORT static gzGraphicsEngine *       getEngine();
00124     GZ_GRAPH_EXPORT static gzFloat                  getVersion();
00125     GZ_GRAPH_EXPORT static gzFloat                  getShaderVersion();
00126     GZ_GRAPH_EXPORT static gzString                 getExtensions();
00127 
00128     GZ_GRAPH_EXPORT static gzVoid       disableAllClientStates(gzBool disableAllTextureUnits=TRUE);
00129 
00130     // Engine functions
00131     
00132     GZ_GRAPH_EXPORT virtual gzVoid setupEngine()=0;
00133     GZ_GRAPH_EXPORT virtual gzVoid shutdownEngine()=0;
00134     
00135 protected:
00136 
00137 
00138     GZ_GRAPH_EXPORT static gzBool   s_vertex_array;
00139     GZ_GRAPH_EXPORT static gzBool   s_compiled_vertex_array;
00140     GZ_GRAPH_EXPORT static gzBool   s_multitexture;
00141     GZ_GRAPH_EXPORT static gzBool   s_texenvop;
00142     GZ_GRAPH_EXPORT static gzBool   s_pbuffer;
00143     GZ_GRAPH_EXPORT static gzBool   s_polygon_offset;
00144     GZ_GRAPH_EXPORT static gzBool   s_compressed_textures;
00145     GZ_GRAPH_EXPORT static gzBool   s_compressed_s3tc;
00146     GZ_GRAPH_EXPORT static gzBool   s_depth_clamp;
00147     GZ_GRAPH_EXPORT static gzBool   s_vertex_program;
00148     GZ_GRAPH_EXPORT static gzBool   s_fragment_program;
00149     GZ_GRAPH_EXPORT static gzBool   s_vertex_buffer_object;
00150     GZ_GRAPH_EXPORT static gzBool   s_two_sided_stencil;
00151     GZ_GRAPH_EXPORT static gzBool   s_separate_stencil;
00152     GZ_GRAPH_EXPORT static gzBool   s_shader_objects;
00153     GZ_GRAPH_EXPORT static gzBool   s_vertex_shader;
00154     GZ_GRAPH_EXPORT static gzBool   s_fragment_shader;
00155     GZ_GRAPH_EXPORT static gzBool   s_multisample;
00156     GZ_GRAPH_EXPORT static gzBool   s_auto_mipmap;
00157     GZ_GRAPH_EXPORT static gzBool   s_npot_texture;
00158     GZ_GRAPH_EXPORT static gzBool   s_pixel_buffer_object;
00159     GZ_GRAPH_EXPORT static gzBool   s_geometry_shader;
00160     GZ_GRAPH_EXPORT static gzBool   s_draw_instanced;
00161 
00162     GZ_GRAPH_EXPORT static gzInt                s_maxtexturesize;
00163 
00164     GZ_GRAPH_EXPORT static gzUInt               s_numberOfTextureUnits;
00165 
00166 
00167     GZ_GRAPH_EXPORT static gzString             s_gz_extensions;
00168     GZ_GRAPH_EXPORT static gzFloat              s_gz_version;
00169     GZ_GRAPH_EXPORT static gzEngineType         s_engineType;
00170     GZ_GRAPH_EXPORT static gzGraphicsEngine *   s_currentEngine;
00171     GZ_GRAPH_EXPORT static gzEngineVendor       s_engineVendor;
00172 
00173     GZ_GRAPH_EXPORT static gzBool               s_remoteConnection;
00174     GZ_GRAPH_EXPORT static gzFloat              s_shader_version;
00175     GZ_GRAPH_EXPORT static gzGraphicsEngine *   s_engine[GZ_MAX_3D_ENGINES];
00176 };
00177 
00178 
00179 #endif
00180 
00181 

Documentation for Gizmo3D generated at Wed Feb 20 11:54:05 2008 by   Saab Training Systems AB, ¸ (c) 2003-and beyond