mirror of
https://github.com/love2d/love.git
synced 2026-08-19 20:19:42 +02:00
Add SpriteBatch support to love.graphics.isSupported
This commit is contained in:
@@ -152,7 +152,8 @@ namespace graphics
|
|||||||
StringMap<Graphics::Support, Graphics::SUPPORT_MAX_ENUM>::Entry Graphics::supportEntries[] =
|
StringMap<Graphics::Support, Graphics::SUPPORT_MAX_ENUM>::Entry Graphics::supportEntries[] =
|
||||||
{
|
{
|
||||||
{ "framebuffers", Graphics::SUPPORT_FRAMEBUFFERS },
|
{ "framebuffers", Graphics::SUPPORT_FRAMEBUFFERS },
|
||||||
{ "pixeleffects", Graphics::SUPPORT_PIXELEFFECTS }
|
{ "pixeleffects", Graphics::SUPPORT_PIXELEFFECTS },
|
||||||
|
{ "spritebatches", Graphics::SUPPORT_SPRITEBATCHES }
|
||||||
};
|
};
|
||||||
|
|
||||||
StringMap<Graphics::Support, Graphics::SUPPORT_MAX_ENUM> Graphics::support(Graphics::supportEntries, sizeof(Graphics::supportEntries));
|
StringMap<Graphics::Support, Graphics::SUPPORT_MAX_ENUM> Graphics::support(Graphics::supportEntries, sizeof(Graphics::supportEntries));
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ namespace graphics
|
|||||||
{
|
{
|
||||||
SUPPORT_FRAMEBUFFERS = 1,
|
SUPPORT_FRAMEBUFFERS = 1,
|
||||||
SUPPORT_PIXELEFFECTS,
|
SUPPORT_PIXELEFFECTS,
|
||||||
|
SUPPORT_SPRITEBATCHES,
|
||||||
SUPPORT_MAX_ENUM
|
SUPPORT_MAX_ENUM
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,11 @@ namespace opengl
|
|||||||
delete color;
|
delete color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SpriteBatch::isSupported()
|
||||||
|
{
|
||||||
|
return (GLEE_ARB_vertex_buffer_object || GLEE_VERSION_1_5);
|
||||||
|
}
|
||||||
|
|
||||||
bool SpriteBatch::loadVolatile()
|
bool SpriteBatch::loadVolatile()
|
||||||
{
|
{
|
||||||
// Find out which OpenGL VBO usage hint to use.
|
// Find out which OpenGL VBO usage hint to use.
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ namespace opengl
|
|||||||
SpriteBatch(Image * image, int size, int usage);
|
SpriteBatch(Image * image, int size, int usage);
|
||||||
virtual ~SpriteBatch();
|
virtual ~SpriteBatch();
|
||||||
|
|
||||||
|
static bool isSupported();
|
||||||
|
|
||||||
// Implements Volatile.
|
// Implements Volatile.
|
||||||
bool loadVolatile();
|
bool loadVolatile();
|
||||||
void unloadVolatile();
|
void unloadVolatile();
|
||||||
|
|||||||
@@ -761,6 +761,10 @@ namespace opengl
|
|||||||
if (!PixelEffect::isSupported())
|
if (!PixelEffect::isSupported())
|
||||||
supported = false;
|
supported = false;
|
||||||
break;
|
break;
|
||||||
|
case Graphics::SUPPORT_SPRITEBATCHES:
|
||||||
|
if (!SpriteBatch::isSupported())
|
||||||
|
supported = false;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
supported = false;
|
supported = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user