mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Added love.window.setScreenSaverEnabled and love.window.isScreenSaverEnabled (resolves issue #1088.)
This commit is contained in:
@@ -53,23 +53,9 @@ SpriteBatch::SpriteBatch(Texture *texture, int size, Mesh::Usage usage)
|
||||
throw love::Exception("Invalid SpriteBatch size.");
|
||||
|
||||
GLenum gl_usage = Mesh::getGLBufferUsage(usage);
|
||||
size_t vertex_size = sizeof(Vertex) * 4 * size;
|
||||
|
||||
const size_t vertex_size = sizeof(Vertex) * 4 * size;
|
||||
|
||||
try
|
||||
{
|
||||
array_buf = new GLBuffer(vertex_size, nullptr, GL_ARRAY_BUFFER, gl_usage, GLBuffer::MAP_EXPLICIT_RANGE_MODIFY);
|
||||
}
|
||||
catch (love::Exception &)
|
||||
{
|
||||
delete array_buf;
|
||||
throw;
|
||||
}
|
||||
catch (std::bad_alloc &)
|
||||
{
|
||||
delete array_buf;
|
||||
throw love::Exception("Out of memory.");
|
||||
}
|
||||
array_buf = new GLBuffer(vertex_size, nullptr, GL_ARRAY_BUFFER, gl_usage, GLBuffer::MAP_EXPLICIT_RANGE_MODIFY);
|
||||
}
|
||||
|
||||
SpriteBatch::~SpriteBatch()
|
||||
|
||||
Reference in New Issue
Block a user