1 #ifndef __SSOPENGLSHADER__
2 #define __SSOPENGLSHADER__
7 #define PUT_UNIFORM_WARNIG (1)
19 SSOpenGLShader(
const std::string& str,
const GLenum shader_type );
20 SSOpenGLShader(
const std::string& name,
const std::string& str,
const GLenum shader_type );
22 virtual int Compile(
void );
23 inline GLhandleARB GetHandle(
void )
const {
return h; }
57 GLhandleARB GetID(){
return h; }
60 virtual int Link(
void );
61 virtual void Use(
void );
63 inline void Enable(
void ) { Use(); }
64 inline void Disable(
void ) { glUseProgramObjectARB( 0 ); }
66 inline GLint GetUniformLocation(
const char *name )
68 GLint ul = glGetUniformLocationARB( h, name );
74 inline GLint GetAttribLocation(
const char *name )
76 GLint al = glGetAttribLocationARB( h, name );
88 std::vector<SSOpenGLProgramObject*> m_shader_list;
96 glpgObject = m_Myinst->m_shader_list[index];
106 static void Destory()
108 m_Myinst->_Destroy();
113 for ( std::vector<SSOpenGLProgramObject*>::iterator itr = m_shader_list.begin();
114 itr != m_shader_list.end() ; itr++ )
118 m_Myinst->m_shader_list.clear();
129 m_Myinst->m_shader_list.push_back(obj);
136 int SsGL_CheckShaderReady(
void );