From eb8a5c10626b1c444c98b34f93fc3f2dfce0bfa9 Mon Sep 17 00:00:00 2001 From: Robert Menzel <menzel@informatik.rwth-aachen.de> Date: Sun, 5 Feb 2012 15:34:56 +0100 Subject: [PATCH] less padding --- include/ACGL/OpenGL/Objects/Buffer.hh | 14 ++++++++------ include/ACGL/OpenGL/Objects/VertexArrayObject.hh | 6 +++--- include/ACGL/Utils/Log.hh | 9 ++++----- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/include/ACGL/OpenGL/Objects/Buffer.hh b/include/ACGL/OpenGL/Objects/Buffer.hh index 3940c505..551464cd 100644 --- a/include/ACGL/OpenGL/Objects/Buffer.hh +++ b/include/ACGL/OpenGL/Objects/Buffer.hh @@ -79,7 +79,7 @@ class Buffer public: //! Most common default: a new Buffer corresponds to a new GL resource. You might decide on a binding point //! now or later. - Buffer( GLenum _target ) : mTarget(_target), mSize(0) + Buffer( GLenum _target ) : mSize(0), mTarget(_target) { mBuffer = SharedBufferObject( new BufferObject() ); } @@ -93,11 +93,13 @@ public: * In this case no GL wrapper calls should ever get called until one gets set! */ Buffer( SharedBufferObject _pBuffer, GLenum _target ) - : mTarget(_target), - mBuffer( _pBuffer ), - mSize(0) + : mSize(0), + mBuffer( _pBuffer ), + mTarget(_target) {} + virtual ~Buffer(){} + // ==================================================================================================== \/ // ============================================================================================ GETTERS \/ // ==================================================================================================== \/ @@ -292,9 +294,9 @@ public: // ============================================================================================ FIELDS \/ // =================================================================================================== \/ protected: - GLenum mTarget; - SharedBufferObject mBuffer; 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) diff --git a/include/ACGL/OpenGL/Objects/VertexArrayObject.hh b/include/ACGL/OpenGL/Objects/VertexArrayObject.hh index 5552a2df..f9e8bf1e 100755 --- a/include/ACGL/OpenGL/Objects/VertexArrayObject.hh +++ b/include/ACGL/OpenGL/Objects/VertexArrayObject.hh @@ -66,9 +66,9 @@ public: // ========================================================================================================= \/ public: VertexArrayObject() - : mObjectName(0), - mpElementArrayBuffer(), + : mpElementArrayBuffer(), mAttributes(), + mObjectName(0), mMode(GL_TRIANGLES) { glGenVertexArrays(1, &mObjectName); @@ -375,9 +375,9 @@ public: // ============================================================================================ FIELDS \/ // =================================================================================================== \/ private: - GLuint mObjectName; // OpenGL object name SharedElementArrayBuffer mpElementArrayBuffer; // optional EAB AttributeVec mAttributes; // vertex attributes + GLuint mObjectName; // OpenGL object name GLenum mMode; // primitive type to render (e.g. GL_TRIANGLES) //! Bind this VAO and remember the previously bound VAO diff --git a/include/ACGL/Utils/Log.hh b/include/ACGL/Utils/Log.hh index d110b44a..573c5cbd 100644 --- a/include/ACGL/Utils/Log.hh +++ b/include/ACGL/Utils/Log.hh @@ -70,11 +70,10 @@ private: virtual int sync(); private: - char *mBuffer; - int mBufferSize; // how many bytes are used - int mBufferMaxSize; // size of the buffer - - std::string mPrefix; + char *mBuffer; + std::string mPrefix; + size_t mBufferSize; // how many bytes are used + size_t mBufferMaxSize; // size of the buffer bool mNewLineIsAboutToStart; }; -- GitLab