mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Rename Attributes struct to VertexAttributes
This commit is contained in:
@@ -385,13 +385,13 @@ void Graphics::draw(const DrawIndexedCommand &cmd)
|
||||
++drawCalls;
|
||||
}
|
||||
|
||||
static inline void advanceVertexOffsets(const Attributes &attributes, BufferBindings &buffers, int vertexcount)
|
||||
static inline void advanceVertexOffsets(const VertexAttributes &attributes, BufferBindings &buffers, int vertexcount)
|
||||
{
|
||||
// TODO: Figure out a better way to avoid touching the same buffer multiple
|
||||
// times, if multiple attributes share the buffer.
|
||||
uint32 touchedbuffers = 0;
|
||||
|
||||
for (unsigned int i = 0; i < Attributes::MAX; i++)
|
||||
for (unsigned int i = 0; i < VertexAttributes::MAX; i++)
|
||||
{
|
||||
if (!attributes.isEnabled(i))
|
||||
continue;
|
||||
@@ -408,7 +408,7 @@ static inline void advanceVertexOffsets(const Attributes &attributes, BufferBind
|
||||
}
|
||||
}
|
||||
|
||||
void Graphics::drawQuads(int start, int count, const Attributes &attributes, const BufferBindings &buffers, love::graphics::Texture *texture)
|
||||
void Graphics::drawQuads(int start, int count, const VertexAttributes &attributes, const BufferBindings &buffers, love::graphics::Texture *texture)
|
||||
{
|
||||
const int MAX_VERTICES_PER_DRAW = LOVE_UINT16_MAX;
|
||||
const int MAX_QUADS_PER_DRAW = MAX_VERTICES_PER_DRAW / 4;
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
|
||||
void draw(const DrawCommand &cmd) override;
|
||||
void draw(const DrawIndexedCommand &cmd) override;
|
||||
void drawQuads(int start, int count, const Attributes &attributes, const BufferBindings &buffers, Texture *texture) override;
|
||||
void drawQuads(int start, int count, const VertexAttributes &attributes, const BufferBindings &buffers, Texture *texture) override;
|
||||
|
||||
void clear(OptionalColorf color, OptionalInt stencil, OptionalDouble depth) override;
|
||||
void clear(const std::vector<OptionalColorf> &colors, OptionalInt stencil, OptionalDouble depth) override;
|
||||
|
||||
@@ -186,7 +186,7 @@ void OpenGL::setupContext()
|
||||
state.enabledAttribArrays = (uint32) ((1ull << uint32(maxvertexattribs)) - 1);
|
||||
state.instancedAttribArrays = 0;
|
||||
|
||||
setVertexAttributes(Attributes(), BufferBindings());
|
||||
setVertexAttributes(VertexAttributes(), BufferBindings());
|
||||
|
||||
// Get the current viewport.
|
||||
glGetIntegerv(GL_VIEWPORT, (GLint *) &state.viewport.x);
|
||||
@@ -713,7 +713,7 @@ void OpenGL::deleteBuffer(GLuint buffer)
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGL::setVertexAttributes(const Attributes &attributes, const BufferBindings &buffers)
|
||||
void OpenGL::setVertexAttributes(const VertexAttributes &attributes, const BufferBindings &buffers)
|
||||
{
|
||||
uint32 enablediff = attributes.enableBits ^ state.enabledAttribArrays;
|
||||
uint32 instanceattribbits = 0;
|
||||
|
||||
@@ -238,7 +238,7 @@ public:
|
||||
/**
|
||||
* Set all vertex attribute state.
|
||||
**/
|
||||
void setVertexAttributes(const Attributes &attributes, const BufferBindings &buffers);
|
||||
void setVertexAttributes(const VertexAttributes &attributes, const BufferBindings &buffers);
|
||||
|
||||
/**
|
||||
* Wrapper for glCullFace which eliminates redundant state setting.
|
||||
|
||||
Reference in New Issue
Block a user