mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Misc. code cosmetics and improvements
This commit is contained in:
@@ -45,6 +45,7 @@ Graphics::Graphics()
|
||||
, lineWidth(1)
|
||||
, matrixLimit(0)
|
||||
, userMatrices(0)
|
||||
, colorMask()
|
||||
{
|
||||
currentWindow = love::window::sdl::Window::getSingleton();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user