![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 STAPsGLObj.hpp 00003 ******************************************************************************/ 00007 /****************************************************************************** 00008 SUKITTI PUNAK (09/10/2010) 00009 UPDATE (09/10/2010) 00010 ******************************************************************************/ 00011 #ifndef STAPs_GL_OBJ_HPP 00012 #define STAPs_GL_OBJ_HPP 00013 00014 //#include "../Core/TAPsStdLib.hpp" 00015 //#include "TAPsOpenGLMaterial.hpp" 00016 //#include "TAPsOpenGLTexture.hpp" 00017 00018 #include "STAPsGLSupport.hpp" 00019 00020 #ifdef TAPs_USE_WXWIDGETS 00021 #include <wx/Image.h> 00022 #endif//TAPs_USE_WXWIDGETS 00023 00024 BEGIN_NAMESPACE_TAPs__OpenGL 00025 //============================================================================= 00026 class GLObj { 00027 //============================================================================= 00028 public: 00029 // Member Functions ------------------------------------------------------- 00031 friend std::ostream & operator<< ( std::ostream &output, GLObj const &obj ) 00032 { 00033 output << obj.StrInfo(); 00034 return output; 00035 } 00036 //------------------------------------------------------------------------- 00038 GLObj (); 00040 //GLObj ( GLObj const &orig ); 00042 ~GLObj (); 00043 //------------------------------------------------------------------------- 00045 virtual std::string StrInfo () const; 00046 //------------------------------------------------------------------------- 00048 //inline GLObj & operator= ( GLObj const &orig ); 00049 //------------------------------------------------------------------------- 00050 00051 //#define TAPs_USE_GLSL 00052 //#define TAPs_USE_WXWIDGETS 00053 00055 bool InitShaders ( 00056 std::string const & shaderFileName, 00057 bool useVertexShader, 00058 bool useGeometryShader, 00059 bool useFragmentShader 00060 ); 00062 //void ClearShaders (); 00063 00064 OpenGL::GLSLShaderManager glslManager; 00065 OpenGL::GLSLProgramObject * glslProgObj; 00066 00067 #ifdef TAPs_USE_WXWIDGETS 00068 00069 //bool InitTexture1D ( std::string & imageFile ); 00071 //bool InitTexture2D ( std::string & imageFile ); 00073 //bool InitTexture3D ( std::string & imageFile, int depth ); 00075 //void ClearTextures (); 00076 #endif//TAPs_USE_WXWIDGETS 00077 00078 //------------------------------------------------------------------------- 00080 static int GetVersionMajorNumber () { return m_GL_Version[0]; } 00082 static int GetVersionMinorNumber () { return m_GL_Version[1]; } 00084 static int GetVersionMinorMinorNumber () { return m_GL_Version[2]; } 00086 static const std::string & GetTAPsResourcePath () { return m_GL_TAPsResourcePath; } 00088 static const std::string & GetTAPsGLSLShadersResourcePath () { return m_GL_TAPsGLSLShadersResourcePath; } 00090 //virtual void Draw () const; 00091 // Data Members ----------------------------------------------------------- 00092 //OpenGL::Material Material; 00093 //OpenGL::Texture Texture; 00094 //============================================================================= 00095 protected: 00096 // Member Functions ------------------------------------------------------- 00098 static bool InitOnce (); 00100 static void SetTAPsResourcePath (); 00101 // Data Members ----------------------------------------------------------- 00102 static char m_GL_Version[3]; 00103 static std::string m_GL_TAPsResourcePath; 00104 static std::string m_GL_TAPsGLSLShadersResourcePath; 00105 //============================================================================= 00106 private: 00107 // Member Functions ------------------------------------------------------- 00108 // Data Members ----------------------------------------------------------- 00109 //============================================================================= 00110 }; // END CLASS GLObj 00111 //============================================================================= 00112 END_NAMESPACE_TAPs__OpenGL 00113 //----------------------------------------------------------------------------- 00114 // Include definition if TAPs_USE_EXPORT is not defined 00115 #if !defined( TAPs_USE_EXPORT ) 00116 #include "STAPsGLObj.cpp" 00117 #endif 00118 //----------------------------------------------------------------------------- 00119 #endif 00120 //34567890123456789012345678901234567890123456789012345678901234567890123456789 00121 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----