mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 15:59:57 +02:00
Fixing Andrzej's comments
This commit is contained in:
parent
86c20b26eb
commit
1fc78e4277
3 changed files with 9 additions and 9 deletions
|
@ -59,7 +59,7 @@ protected:
|
|||
public:
|
||||
|
||||
Sysmem();
|
||||
Sysmem(Size size , const Byte* bytes);
|
||||
Sysmem(Size size, const Byte* bytes);
|
||||
~Sysmem();
|
||||
|
||||
Size getSize() const { return _size; }
|
||||
|
@ -74,12 +74,12 @@ protected:
|
|||
Size resize(Size pSize);
|
||||
|
||||
// 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,
|
||||
// doesn't allocate and only copy size * bytes at the offset location
|
||||
// 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
|
||||
// do a resize( size + getSIze) and copy the new data
|
||||
|
@ -117,7 +117,7 @@ class Buffer : public Resource {
|
|||
public:
|
||||
|
||||
Buffer();
|
||||
Buffer(const Buffer& buf );
|
||||
Buffer(const Buffer& buf);
|
||||
~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
|
||||
// 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:
|
||||
|
||||
|
|
|
@ -128,8 +128,8 @@ int TextRenderer::draw(int x, int y, const char* str) {
|
|||
const int NUM_COLOR_SCALARS_PER_GLYPH = 4;
|
||||
unsigned int colorBuffer[NUM_COLOR_SCALARS_PER_GLYPH] = { compactColor, compactColor, compactColor, compactColor };
|
||||
|
||||
gpu::Buffer::Size offset = sizeof(vertexBuffer)*_numGlyphsBatched;
|
||||
gpu::Buffer::Size colorOffset = sizeof(colorBuffer)*_numGlyphsBatched;
|
||||
gpu::Buffer::Size offset = sizeof(vertexBuffer) * _numGlyphsBatched;
|
||||
gpu::Buffer::Size colorOffset = sizeof(colorBuffer) * _numGlyphsBatched;
|
||||
if ((offset + sizeof(vertexBuffer)) > _glyphsBuffer.getSize()) {
|
||||
_glyphsBuffer.append(sizeof(vertexBuffer), (gpu::Buffer::Byte*) vertexBuffer);
|
||||
_glyphsColorBuffer.append(sizeof(colorBuffer), (gpu::Buffer::Byte*) colorBuffer);
|
||||
|
@ -275,7 +275,7 @@ const Glyph& TextRenderer::getGlyph(char c) {
|
|||
}
|
||||
|
||||
void TextRenderer::drawBatch() {
|
||||
if (_numGlyphsBatched<=0) {
|
||||
if (_numGlyphsBatched <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ private:
|
|||
// Graphics Buffer containing the current accumulated glyphs to render
|
||||
gpu::Buffer _glyphsBuffer;
|
||||
gpu::Buffer _glyphsColorBuffer;
|
||||
int _numGlyphsBatched;
|
||||
int _numGlyphsBatched;
|
||||
|
||||
static QHash<Properties, TextRenderer*> _instances;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue