mirror of
https://github.com/love2d/love.git
synced 2026-08-19 12:14:20 +02:00
Don't call glGetFloat every time love.graphics.getSystemLimits is called.
This commit is contained in:
@@ -1661,13 +1661,10 @@ Graphics::Stats Graphics::getStats() const
|
|||||||
|
|
||||||
double Graphics::getSystemLimit(SystemLimit limittype) const
|
double Graphics::getSystemLimit(SystemLimit limittype) const
|
||||||
{
|
{
|
||||||
GLfloat limits[2];
|
|
||||||
|
|
||||||
switch (limittype)
|
switch (limittype)
|
||||||
{
|
{
|
||||||
case Graphics::LIMIT_POINT_SIZE:
|
case Graphics::LIMIT_POINT_SIZE:
|
||||||
glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, limits);
|
return (double) gl.getMaxPointSize();
|
||||||
return (double) limits[1];
|
|
||||||
case Graphics::LIMIT_TEXTURE_SIZE:
|
case Graphics::LIMIT_TEXTURE_SIZE:
|
||||||
return (double) gl.getMaxTextureSize();
|
return (double) gl.getMaxTextureSize();
|
||||||
case Graphics::LIMIT_MULTI_CANVAS:
|
case Graphics::LIMIT_MULTI_CANVAS:
|
||||||
|
|||||||
@@ -289,6 +289,10 @@ void OpenGL::initMaxValues()
|
|||||||
maxRenderbufferSamples = 0;
|
maxRenderbufferSamples = 0;
|
||||||
|
|
||||||
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxTextureUnits);
|
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxTextureUnits);
|
||||||
|
|
||||||
|
GLfloat limits[2];
|
||||||
|
glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, limits);
|
||||||
|
maxPointSize = limits[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGL::initMatrices()
|
void OpenGL::initMatrices()
|
||||||
|
|||||||
@@ -377,6 +377,12 @@ public:
|
|||||||
**/
|
**/
|
||||||
int getMaxTextureUnits() const;
|
int getMaxTextureUnits() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the maximum point size.
|
||||||
|
**/
|
||||||
|
float getMaxPointSize() const;
|
||||||
|
|
||||||
|
|
||||||
void updateTextureMemorySize(size_t oldsize, size_t newsize);
|
void updateTextureMemorySize(size_t oldsize, size_t newsize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -408,6 +414,7 @@ private:
|
|||||||
int maxRenderTargets;
|
int maxRenderTargets;
|
||||||
int maxRenderbufferSamples;
|
int maxRenderbufferSamples;
|
||||||
int maxTextureUnits;
|
int maxTextureUnits;
|
||||||
|
float maxPointSize;
|
||||||
|
|
||||||
Vendor vendor;
|
Vendor vendor;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user