mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Fixed Geometry:flip when the Geometry was created with newQuad (resolves issue #671)
This commit is contained in:
@@ -77,10 +77,10 @@ Geometry::Geometry(float x, float y, float w, float h, float sw, float sh)
|
||||
, vertexCount(4)
|
||||
, elementArray(NULL)
|
||||
, elementCount(0)
|
||||
, x_min(x)
|
||||
, x_max(x+w)
|
||||
, y_min(y)
|
||||
, y_max(y+h)
|
||||
, x_min(0)
|
||||
, x_max(w)
|
||||
, y_min(0)
|
||||
, y_max(h)
|
||||
, vertexColors(false)
|
||||
, drawMode(DRAW_MODE_FAN)
|
||||
{
|
||||
|
||||
@@ -184,6 +184,7 @@ void Shader::createProgram(const std::vector<GLuint> &shaderids)
|
||||
{
|
||||
std::string warnings = getProgramWarnings();
|
||||
glDeleteProgram(program);
|
||||
program = 0;
|
||||
|
||||
throw love::Exception("Cannot link shader program object:\n%s", warnings.c_str());
|
||||
}
|
||||
@@ -265,9 +266,10 @@ void Shader::unloadVolatile()
|
||||
glUseProgram(0);
|
||||
|
||||
if (program != 0)
|
||||
{
|
||||
glDeleteProgram(program);
|
||||
|
||||
program = 0;
|
||||
program = 0;
|
||||
}
|
||||
|
||||
// decrement global texture id counters for texture units which had textures bound from this shader
|
||||
for (size_t i = 0; i < activeTextureUnits.size(); ++i)
|
||||
@@ -324,9 +326,10 @@ std::string Shader::getWarnings() const
|
||||
void Shader::attach(bool temporary)
|
||||
{
|
||||
if (current != this)
|
||||
{
|
||||
glUseProgram(program);
|
||||
|
||||
current = this;
|
||||
current = this;
|
||||
}
|
||||
|
||||
if (!temporary)
|
||||
{
|
||||
@@ -337,6 +340,8 @@ void Shader::attach(bool temporary)
|
||||
if (activeTextureUnits[i] > 0)
|
||||
gl.bindTextureToUnit(activeTextureUnits[i], i + 1, false);
|
||||
}
|
||||
|
||||
// We always want to use texture unit 0 for everyhing else.
|
||||
gl.setActiveTextureUnit(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ int w_newGeometry(lua_State *L)
|
||||
{
|
||||
lua_rawgeti(L, 1, i+1);
|
||||
if (!lua_istable(L, -1))
|
||||
return luaL_typerror(L, 1, "table of tables");
|
||||
return luax_typerror(L, 1, "table of tables");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user