Fixing Andrzej's comments

This commit is contained in:
Sam Gateau 2014-10-09 17:18:51 -07:00
parent 86c20b26eb
commit 1fc78e4277
3 changed files with 9 additions and 9 deletions

View file

@ -59,7 +59,7 @@ protected:
public: public:
Sysmem(); Sysmem();
Sysmem(Size size , const Byte* bytes); Sysmem(Size size, const Byte* bytes);
~Sysmem(); ~Sysmem();
Size getSize() const { return _size; } Size getSize() const { return _size; }
@ -74,12 +74,12 @@ protected:
Size resize(Size pSize); Size resize(Size pSize);
// Assign data bytes and size (allocate for size, then copy bytes if exists) // Assign data bytes and size (allocate for size, then copy bytes if exists)
Size setData( Size size, const Byte* bytes ); Size setData(Size size, const Byte* bytes );
// Update Sub data, // Update Sub data,
// doesn't allocate and only copy size * bytes at the offset location // doesn't allocate and only copy size * bytes at the offset location
// only if all fits in the existing allocated buffer // only if all fits in the existing allocated buffer
Size setSubData( Size offset, Size size, const Byte* bytes); Size setSubData(Size offset, Size size, const Byte* bytes);
// Append new data at the end of the current buffer // Append new data at the end of the current buffer
// do a resize( size + getSIze) and copy the new data // do a resize( size + getSIze) and copy the new data
@ -117,7 +117,7 @@ class Buffer : public Resource {
public: public:
Buffer(); Buffer();
Buffer(const Buffer& buf ); Buffer(const Buffer& buf);
~Buffer(); ~Buffer();
// The size in bytes of data stored in the buffer // The size in bytes of data stored in the buffer
@ -143,7 +143,7 @@ public:
// this is a temporary hack so the current rendering code can access the underneath gl Buffer Object // this is a temporary hack so the current rendering code can access the underneath gl Buffer Object
// TODO: remove asap, when the backend is doing more of the gl features // TODO: remove asap, when the backend is doing more of the gl features
inline GLuint getGLBufferObject() const { backend::syncGPUObject(*this); return getGPUObject()->_buffer; } inline GLuint getGLBufferObject() const { backend::syncGPUObject(*this); return getGPUObject()->_buffer; }
protected: protected:

View file

@ -128,8 +128,8 @@ int TextRenderer::draw(int x, int y, const char* str) {
const int NUM_COLOR_SCALARS_PER_GLYPH = 4; const int NUM_COLOR_SCALARS_PER_GLYPH = 4;
unsigned int colorBuffer[NUM_COLOR_SCALARS_PER_GLYPH] = { compactColor, compactColor, compactColor, compactColor }; unsigned int colorBuffer[NUM_COLOR_SCALARS_PER_GLYPH] = { compactColor, compactColor, compactColor, compactColor };
gpu::Buffer::Size offset = sizeof(vertexBuffer)*_numGlyphsBatched; gpu::Buffer::Size offset = sizeof(vertexBuffer) * _numGlyphsBatched;
gpu::Buffer::Size colorOffset = sizeof(colorBuffer)*_numGlyphsBatched; gpu::Buffer::Size colorOffset = sizeof(colorBuffer) * _numGlyphsBatched;
if ((offset + sizeof(vertexBuffer)) > _glyphsBuffer.getSize()) { if ((offset + sizeof(vertexBuffer)) > _glyphsBuffer.getSize()) {
_glyphsBuffer.append(sizeof(vertexBuffer), (gpu::Buffer::Byte*) vertexBuffer); _glyphsBuffer.append(sizeof(vertexBuffer), (gpu::Buffer::Byte*) vertexBuffer);
_glyphsColorBuffer.append(sizeof(colorBuffer), (gpu::Buffer::Byte*) colorBuffer); _glyphsColorBuffer.append(sizeof(colorBuffer), (gpu::Buffer::Byte*) colorBuffer);
@ -275,7 +275,7 @@ const Glyph& TextRenderer::getGlyph(char c) {
} }
void TextRenderer::drawBatch() { void TextRenderer::drawBatch() {
if (_numGlyphsBatched<=0) { if (_numGlyphsBatched <= 0) {
return; return;
} }

View file

@ -107,7 +107,7 @@ private:
// Graphics Buffer containing the current accumulated glyphs to render // Graphics Buffer containing the current accumulated glyphs to render
gpu::Buffer _glyphsBuffer; gpu::Buffer _glyphsBuffer;
gpu::Buffer _glyphsColorBuffer; gpu::Buffer _glyphsColorBuffer;
int _numGlyphsBatched; int _numGlyphsBatched;
static QHash<Properties, TextRenderer*> _instances; static QHash<Properties, TextRenderer*> _instances;
}; };