mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Refactor Buffer internals.
Allows buffers created with love.graphics.newBuffer to only allocate VRAM data. Previously they had a copy of their contents in RAM. Also makes it easier to implement Buffers in other graphics APIs and to implement more types of Buffers in the future.
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
|
||||
// LOVE
|
||||
#include "common/config.h"
|
||||
#include "common/Range.h"
|
||||
#include "Drawable.h"
|
||||
#include "Font.h"
|
||||
#include "Buffer.h"
|
||||
@@ -73,9 +74,9 @@ private:
|
||||
Font::ColoredCodepoints codepoints;
|
||||
float wrap;
|
||||
Font::AlignMode align;
|
||||
Font::TextInfo text_info;
|
||||
bool use_matrix;
|
||||
bool append_vertices;
|
||||
Font::TextInfo textInfo;
|
||||
bool useMatrix;
|
||||
bool appendVertices;
|
||||
Matrix4 matrix;
|
||||
};
|
||||
|
||||
@@ -88,16 +89,18 @@ private:
|
||||
VertexAttributes vertexAttributes;
|
||||
BufferBindings vertexBuffers;
|
||||
|
||||
StrongRef<Buffer> vertex_buffer;
|
||||
StrongRef<Buffer> vertexBuffer;
|
||||
uint8 *vertexData;
|
||||
Range modifiedVertices;
|
||||
|
||||
std::vector<Font::DrawCommand> draw_commands;
|
||||
std::vector<Font::DrawCommand> drawCommands;
|
||||
|
||||
std::vector<TextData> text_data;
|
||||
std::vector<TextData> textData;
|
||||
|
||||
size_t vert_offset;
|
||||
size_t vertOffset;
|
||||
|
||||
// Used so we know when the font's texture cache is invalidated.
|
||||
uint32 texture_cache_id;
|
||||
uint32 textureCacheID;
|
||||
|
||||
}; // Text
|
||||
|
||||
|
||||
Reference in New Issue
Block a user