Commit eb8a5c10 authored by Robert Menzel's avatar Robert Menzel
Browse files

less padding

parent 5209b760
...@@ -79,7 +79,7 @@ class Buffer ...@@ -79,7 +79,7 @@ class Buffer
public: public:
//! Most common default: a new Buffer corresponds to a new GL resource. You might decide on a binding point //! Most common default: a new Buffer corresponds to a new GL resource. You might decide on a binding point
//! now or later. //! now or later.
Buffer( GLenum _target ) : mTarget(_target), mSize(0) Buffer( GLenum _target ) : mSize(0), mTarget(_target)
{ {
mBuffer = SharedBufferObject( new BufferObject() ); mBuffer = SharedBufferObject( new BufferObject() );
} }
...@@ -93,11 +93,13 @@ public: ...@@ -93,11 +93,13 @@ public:
* In this case no GL wrapper calls should ever get called until one gets set! * In this case no GL wrapper calls should ever get called until one gets set!
*/ */
Buffer( SharedBufferObject _pBuffer, GLenum _target ) Buffer( SharedBufferObject _pBuffer, GLenum _target )
: mTarget(_target), : mSize(0),
mBuffer( _pBuffer ), mBuffer( _pBuffer ),
mSize(0) mTarget(_target)
{} {}
virtual ~Buffer(){}
// ==================================================================================================== \/ // ==================================================================================================== \/
// ============================================================================================ GETTERS \/ // ============================================================================================ GETTERS \/
// ==================================================================================================== \/ // ==================================================================================================== \/
...@@ -292,9 +294,9 @@ public: ...@@ -292,9 +294,9 @@ public:
// ============================================================================================ FIELDS \/ // ============================================================================================ FIELDS \/
// =================================================================================================== \/ // =================================================================================================== \/
protected: protected:
GLenum mTarget;
SharedBufferObject mBuffer;
GLint64 mSize; // as this might get queried often (e.g. ArrayBuffer) we will explicitly mirror it in RAM) GLint64 mSize; // as this might get queried often (e.g. ArrayBuffer) we will explicitly mirror it in RAM)
SharedBufferObject mBuffer;
GLenum mTarget;
}; };
ACGL_SHARED_TYPEDEF(Buffer) ACGL_SHARED_TYPEDEF(Buffer)
......
...@@ -66,9 +66,9 @@ public: ...@@ -66,9 +66,9 @@ public:
// ========================================================================================================= \/ // ========================================================================================================= \/
public: public:
VertexArrayObject() VertexArrayObject()
: mObjectName(0), : mpElementArrayBuffer(),
mpElementArrayBuffer(),
mAttributes(), mAttributes(),
mObjectName(0),
mMode(GL_TRIANGLES) mMode(GL_TRIANGLES)
{ {
glGenVertexArrays(1, &mObjectName); glGenVertexArrays(1, &mObjectName);
...@@ -375,9 +375,9 @@ public: ...@@ -375,9 +375,9 @@ public:
// ============================================================================================ FIELDS \/ // ============================================================================================ FIELDS \/
// =================================================================================================== \/ // =================================================================================================== \/
private: private:
GLuint mObjectName; // OpenGL object name
SharedElementArrayBuffer mpElementArrayBuffer; // optional EAB SharedElementArrayBuffer mpElementArrayBuffer; // optional EAB
AttributeVec mAttributes; // vertex attributes AttributeVec mAttributes; // vertex attributes
GLuint mObjectName; // OpenGL object name
GLenum mMode; // primitive type to render (e.g. GL_TRIANGLES) GLenum mMode; // primitive type to render (e.g. GL_TRIANGLES)
//! Bind this VAO and remember the previously bound VAO //! Bind this VAO and remember the previously bound VAO
......
...@@ -70,11 +70,10 @@ private: ...@@ -70,11 +70,10 @@ private:
virtual int sync(); virtual int sync();
private: private:
char *mBuffer; char *mBuffer;
int mBufferSize; // how many bytes are used std::string mPrefix;
int mBufferMaxSize; // size of the buffer size_t mBufferSize; // how many bytes are used
size_t mBufferMaxSize; // size of the buffer
std::string mPrefix;
bool mNewLineIsAboutToStart; bool mNewLineIsAboutToStart;
}; };
......
Supports Markdown
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