Misc. code cosmetics and improvements

This commit is contained in:
Alex Szpakowski
2013-04-18 02:14:35 -03:00
parent 6fd3038405
commit bf6d1c258b
7 changed files with 27 additions and 29 deletions
+1
View File
@@ -45,6 +45,7 @@ Graphics::Graphics()
, lineWidth(1)
, matrixLimit(0)
, userMatrices(0)
, colorMask()
{
currentWindow = love::window::sdl::Window::getSingleton();
}
+8 -8
View File
@@ -35,11 +35,8 @@ namespace graphics
namespace opengl
{
// OpenGL class instance singleton.
OpenGL gl;
OpenGL::OpenGL()
: contexInitialized(false)
: contextInitialized(false)
, maxAnisotropy(1.0f)
, state()
{
@@ -47,7 +44,7 @@ OpenGL::OpenGL()
void OpenGL::initContext()
{
if (contexInitialized)
if (contextInitialized)
return;
initOpenGLFunctions();
@@ -99,15 +96,15 @@ void OpenGL::initContext()
createDefaultTexture();
contexInitialized = true;
contextInitialized = true;
}
void OpenGL::deInitContext()
{
if (!contexInitialized)
if (!contextInitialized)
return;
contexInitialized = false;
contextInitialized = false;
}
void OpenGL::initOpenGLFunctions()
@@ -396,6 +393,9 @@ graphics::Image::Wrap OpenGL::getTextureWrap()
return w;
}
// OpenGL class instance singleton.
OpenGL gl;
} // opengl
} // graphics
} // love
+5 -5
View File
@@ -103,22 +103,22 @@ public:
/**
* Sets the image filter mode for the currently bound texture.
* Returns the actual amount of anisotropic filtering set.
*/
**/
float setTextureFilter(const graphics::Image::Filter &f);
/**
* Returns the image filter mode for the currently bound texture.
*/
**/
graphics::Image::Filter getTextureFilter();
/**
* Sets the image wrap mode for the currently bound texture.
*/
**/
void setTextureWrap(const graphics::Image::Wrap &w);
/**
* Returns the image wrap mode for the currently bound texture.
*/
**/
graphics::Image::Wrap getTextureWrap();
private:
@@ -126,7 +126,7 @@ private:
void initOpenGLFunctions();
void createDefaultTexture();
bool contexInitialized;
bool contextInitialized;
float maxAnisotropy;
// Tracked OpenGL state.
+2 -2
View File
@@ -54,8 +54,8 @@ int w_getDimensions(lua_State *L);
int w_isCreated(lua_State *L);
int w_setScissor(lua_State *L);
int w_getScissor(lua_State *L);
int w_defineMask(lua_State *L);
int w_setMask(lua_State *L);
int w_newStencil(lua_State *L);
int w_setStencil(lua_State *L);
int w_setAlphaTest(lua_State *L);
int w_getAlphaTest(lua_State *L);
int w_newImage(lua_State *L);
@@ -40,6 +40,7 @@ int w_ParticleSystem_setEmissionRate(lua_State *L);
int w_ParticleSystem_setLifetime(lua_State *L);
int w_ParticleSystem_setParticleLife(lua_State *L);
int w_ParticleSystem_setPosition(lua_State *L);
int w_ParticleSystem_setAreaSpread(lua_State *L);
int w_ParticleSystem_setDirection(lua_State *L);
int w_ParticleSystem_setSpread(lua_State *L);
int w_ParticleSystem_setRelativeDirection(lua_State *L);
@@ -58,6 +59,7 @@ int w_ParticleSystem_setOffset(lua_State *L);
int w_ParticleSystem_getX(lua_State *L);
int w_ParticleSystem_getY(lua_State *L);
int w_ParticleSystem_getPosition(lua_State *L);
int w_ParticleSystem_getAreaSpread(lua_State *L);
int w_ParticleSystem_getDirection(lua_State *L);
int w_ParticleSystem_getSpread(lua_State *L);
int w_ParticleSystem_getOffsetX(lua_State *L);