Brève interruption de service ce midi pour augmentation de la mémoire 🤞

Commit 575d8c0a authored by Frédéric Larue's avatar Frédéric Larue

Utility functions added to VBO to make it easier to use VBOBuffers outside of a VBO object.

parent 9cae4222
......@@ -122,6 +122,13 @@ namespace GPU
m_Dimension( 0 ),
m_Normalized( GL_FALSE )
{}
inline VBOAttribBuffer( GLint dimension, GLenum type, bool normalized = false ) :
VBOBuffer( GL_ARRAY_BUFFER ),
m_Dimension( dimension ),
m_Normalized( normalized )
{
SetType( type );
}
inline void SetDimension( GLint dim ) { m_Dimension= dim; }
inline GLint Dimension() const { return m_Dimension; }
......@@ -154,6 +161,13 @@ namespace GPU
{
friend class GPU::VBO;
public:
inline VBOIndexBuffer() : VBOBuffer( GL_ELEMENT_ARRAY_BUFFER ) {}
inline VBOIndexBuffer( GLenum type ) : VBOBuffer( GL_ELEMENT_ARRAY_BUFFER )
{
SetType( type );
}
inline void DrawElements( GLenum mode, GLint first, GLsizei count )
{
glDrawElements( mode, count, Type(), (char*)NULL + first*TypeSize() ); // All this mess to avoid cast compilation warnings...
......@@ -163,9 +177,6 @@ namespace GPU
{
glDrawElements( mode, BufferSize(), Type(), NULL );
}
public:
inline VBOIndexBuffer() : VBOBuffer( GL_ELEMENT_ARRAY_BUFFER ) {}
};
......
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