mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Change the internal constant color from a (per-draw) vertex attribute to a uniform. Pack most built-in uniforms into a single vec4 array and update them all with a single glUniform call.
--HG-- branch : minor
This commit is contained in:
@@ -309,7 +309,7 @@ void Graphics::setActive(bool enable)
|
||||
|
||||
void Graphics::draw(const DrawCommand &cmd)
|
||||
{
|
||||
gl.prepareDraw();
|
||||
gl.prepareDraw(this);
|
||||
gl.setVertexAttributes(*cmd.attributes, *cmd.buffers);
|
||||
gl.bindTextureToUnit(cmd.texture, 0, false);
|
||||
gl.setCullMode(cmd.cullMode);
|
||||
@@ -326,7 +326,7 @@ void Graphics::draw(const DrawCommand &cmd)
|
||||
|
||||
void Graphics::draw(const DrawIndexedCommand &cmd)
|
||||
{
|
||||
gl.prepareDraw();
|
||||
gl.prepareDraw(this);
|
||||
gl.setVertexAttributes(*cmd.attributes, *cmd.buffers);
|
||||
gl.bindTextureToUnit(cmd.texture, 0, false);
|
||||
gl.setCullMode(cmd.cullMode);
|
||||
@@ -373,7 +373,7 @@ void Graphics::drawQuads(int start, int count, const vertex::Attributes &attribu
|
||||
const int MAX_VERTICES_PER_DRAW = LOVE_UINT16_MAX;
|
||||
const int MAX_QUADS_PER_DRAW = MAX_VERTICES_PER_DRAW / 4;
|
||||
|
||||
gl.prepareDraw();
|
||||
gl.prepareDraw(this);
|
||||
gl.bindTextureToUnit(texture, 0, false);
|
||||
gl.setCullMode(CULL_NONE);
|
||||
|
||||
@@ -1223,8 +1223,6 @@ void Graphics::setColor(Colorf c)
|
||||
c.b = std::min(std::max(c.b, 0.0f), 1.0f);
|
||||
c.a = std::min(std::max(c.a, 0.0f), 1.0f);
|
||||
|
||||
gl.setConstantColor(c);
|
||||
|
||||
states.back().color = c;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user