mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Fixed rendering when a SpriteBatch is bound
This commit is contained in:
@@ -165,8 +165,11 @@ void VBO::unmap()
|
|||||||
|
|
||||||
// VBO::bind is a no-op when the VBO is mapped, so we have to make sure it's
|
// VBO::bind is a no-op when the VBO is mapped, so we have to make sure it's
|
||||||
// bound here.
|
// bound here.
|
||||||
if (is_bound)
|
if (!is_bound)
|
||||||
|
{
|
||||||
glBindBufferARB(getTarget(), vbo);
|
glBindBufferARB(getTarget(), vbo);
|
||||||
|
is_bound = true;
|
||||||
|
}
|
||||||
|
|
||||||
// "orphan" current buffer to avoid implicit synchronisation on the gpu:
|
// "orphan" current buffer to avoid implicit synchronisation on the gpu:
|
||||||
// http://www.seas.upenn.edu/~pcozzi/OpenGLInsights/OpenGLInsights-AsynchronousBufferTransfers.pdf
|
// http://www.seas.upenn.edu/~pcozzi/OpenGLInsights/OpenGLInsights-AsynchronousBufferTransfers.pdf
|
||||||
@@ -179,14 +182,15 @@ void VBO::unmap()
|
|||||||
void VBO::bind()
|
void VBO::bind()
|
||||||
{
|
{
|
||||||
if (!is_mapped)
|
if (!is_mapped)
|
||||||
|
{
|
||||||
glBindBufferARB(getTarget(), vbo);
|
glBindBufferARB(getTarget(), vbo);
|
||||||
|
is_bound = true;
|
||||||
is_bound = true;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VBO::unbind()
|
void VBO::unbind()
|
||||||
{
|
{
|
||||||
if (!is_mapped)
|
if (is_bound)
|
||||||
glBindBufferARB(getTarget(), 0);
|
glBindBufferARB(getTarget(), 0);
|
||||||
|
|
||||||
is_bound = false;
|
is_bound = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user