mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Merged default into minor
--HG-- branch : minor
This commit is contained in:
@@ -43,26 +43,17 @@ Volatile::~Volatile()
|
||||
bool Volatile::loadAll()
|
||||
{
|
||||
bool success = true;
|
||||
std::list<Volatile *>::iterator i = all.begin();
|
||||
|
||||
while (i != all.end())
|
||||
{
|
||||
success = success && (*i)->loadVolatile();
|
||||
i++;
|
||||
}
|
||||
for (Volatile *v : all)
|
||||
success = success && v->loadVolatile();
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
void Volatile::unloadAll()
|
||||
{
|
||||
std::list<Volatile *>::iterator i = all.begin();
|
||||
|
||||
while (i != all.end())
|
||||
{
|
||||
(*i)->unloadVolatile();
|
||||
i++;
|
||||
}
|
||||
for (Volatile *v : all)
|
||||
v->unloadVolatile();
|
||||
}
|
||||
|
||||
} // graphics
|
||||
|
||||
@@ -468,11 +468,10 @@ void OpenGL::deleteTexture(GLuint texture)
|
||||
{
|
||||
// glDeleteTextures binds texture 0 to all texture units the deleted texture
|
||||
// was bound to before deletion.
|
||||
std::vector<GLuint>::iterator it;
|
||||
for (it = state.textureUnits.begin(); it != state.textureUnits.end(); ++it)
|
||||
for (GLuint &texid : state.textureUnits)
|
||||
{
|
||||
if (*it == texture)
|
||||
*it = 0;
|
||||
if (texid == texture)
|
||||
texid = 0;
|
||||
}
|
||||
|
||||
glDeleteTextures(1, &texture);
|
||||
@@ -609,40 +608,6 @@ void OpenGL::setTextureWrap(const graphics::Texture::Wrap &w)
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, gt);
|
||||
}
|
||||
|
||||
graphics::Texture::Wrap OpenGL::getTextureWrap()
|
||||
{
|
||||
GLint gs, gt;
|
||||
|
||||
glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, &gs);
|
||||
glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, >);
|
||||
|
||||
Texture::Wrap w;
|
||||
|
||||
switch (gs)
|
||||
{
|
||||
case GL_CLAMP_TO_EDGE:
|
||||
w.s = Texture::WRAP_CLAMP;
|
||||
break;
|
||||
case GL_REPEAT:
|
||||
default:
|
||||
w.s = Texture::WRAP_REPEAT;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (gt)
|
||||
{
|
||||
case GL_CLAMP_TO_EDGE:
|
||||
w.t = Texture::WRAP_CLAMP;
|
||||
break;
|
||||
case GL_REPEAT:
|
||||
default:
|
||||
w.t = Texture::WRAP_REPEAT;
|
||||
break;
|
||||
}
|
||||
|
||||
return w;
|
||||
}
|
||||
|
||||
int OpenGL::getMaxTextureSize() const
|
||||
{
|
||||
return maxTextureSize;
|
||||
|
||||
@@ -286,11 +286,6 @@ public:
|
||||
**/
|
||||
void setTextureWrap(const graphics::Texture::Wrap &w);
|
||||
|
||||
/**
|
||||
* Returns the texture wrap mode for the currently bound texture.
|
||||
**/
|
||||
graphics::Texture::Wrap getTextureWrap();
|
||||
|
||||
/**
|
||||
* Returns the maximum supported width or height of a texture.
|
||||
**/
|
||||
|
||||
Reference in New Issue
Block a user