mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Merged love.graphics.origin into default (issue #124)
This commit is contained in:
@@ -231,7 +231,6 @@ void Graphics::reset()
|
||||
void Graphics::clear()
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glLoadIdentity();
|
||||
}
|
||||
|
||||
void Graphics::present()
|
||||
@@ -1318,6 +1317,11 @@ void Graphics::shear(float kx, float ky)
|
||||
glMultMatrixf((const GLfloat *)t.getElements());
|
||||
}
|
||||
|
||||
void Graphics::origin()
|
||||
{
|
||||
glLoadIdentity();
|
||||
}
|
||||
|
||||
bool Graphics::hasFocus() const
|
||||
{
|
||||
return currentWindow->hasFocus();
|
||||
|
||||
@@ -531,6 +531,7 @@ public:
|
||||
void scale(float x, float y = 1.0f);
|
||||
void translate(float x, float y);
|
||||
void shear(float kx, float ky);
|
||||
void origin();
|
||||
|
||||
bool hasFocus() const;
|
||||
private:
|
||||
|
||||
@@ -1539,6 +1539,12 @@ int w_shear(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_origin(lua_State *L)
|
||||
{
|
||||
instance->origin();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_hasFocus(lua_State *L)
|
||||
{
|
||||
luax_pushboolean(L, instance->hasFocus());
|
||||
@@ -1647,6 +1653,7 @@ static const luaL_Reg functions[] =
|
||||
{ "scale", w_scale },
|
||||
{ "translate", w_translate },
|
||||
{ "shear", w_shear },
|
||||
{ "origin", w_origin },
|
||||
|
||||
{ "hasFocus", w_hasFocus },
|
||||
|
||||
|
||||
@@ -114,6 +114,7 @@ int w_rotate(lua_State *L);
|
||||
int w_scale(lua_State *L);
|
||||
int w_translate(lua_State *L);
|
||||
int w_shear(lua_State *L);
|
||||
int w_origin(lua_State *L);
|
||||
int w_hasFocus(lua_State *L);
|
||||
extern "C" LOVE_EXPORT int luaopen_love_graphics(lua_State *L);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user