Commit 9fc9b26c authored by Frédéric Larue's avatar Frédéric Larue
Browse files

Bind/Unbind functions of VBO set to public.

parent 419ba16e
...@@ -194,32 +194,6 @@ namespace GPU ...@@ -194,32 +194,6 @@ namespace GPU
Shader *m_Shader; Shader *m_Shader;
AttribBindingMap m_AttribBinding; AttribBindingMap m_AttribBinding;
inline void Bind()
{
if( m_Shader )
m_Shader->Bind();
for( auto a=m_AttribBinding.begin(); a!=m_AttribBinding.end(); ++a )
{
a->first->SetLocation( a->second );
a->first->Bind();
}
if( m_Indices )
m_Indices->Bind();
}
inline void Unbind()
{
if( m_Shader )
m_Shader->Unbind();
for( auto a=m_AttribBinding.begin(); a!=m_AttribBinding.end(); ++a )
a->first->Unbind();
gpuAssert( glBindBufferARB( GL_ARRAY_BUFFER, 0 ) );
gpuAssert( glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, 0 ) );
}
public: public:
inline VBO() : inline VBO() :
m_PrimitiveType( GL_NONE ), m_PrimitiveType( GL_NONE ),
...@@ -335,6 +309,32 @@ namespace GPU ...@@ -335,6 +309,32 @@ namespace GPU
m_AttribBinding.clear(); m_AttribBinding.clear();
} }
inline void Bind()
{
if( m_Shader )
m_Shader->Bind();
for( auto a=m_AttribBinding.begin(); a!=m_AttribBinding.end(); ++a )
{
a->first->SetLocation( a->second );
a->first->Bind();
}
if( m_Indices )
m_Indices->Bind();
}
inline void Unbind()
{
if( m_Shader )
m_Shader->Unbind();
for( auto a=m_AttribBinding.begin(); a!=m_AttribBinding.end(); ++a )
a->first->Unbind();
gpuAssert( glBindBufferARB( GL_ARRAY_BUFFER, 0 ) );
gpuAssert( glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, 0 ) );
}
inline void DrawArrays() inline void DrawArrays()
{ {
assert( m_PrimitiveType != GL_NONE ); assert( m_PrimitiveType != GL_NONE );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment