mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +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
|
||||
{
|
||||
GLfloat limits[2];
|
||||
|
||||
switch (limittype)
|
||||
{
|
||||
case Graphics::LIMIT_POINT_SIZE:
|
||||
glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, limits);
|
||||
return (double) limits[1];
|
||||
return (double) gl.getMaxPointSize();
|
||||
case Graphics::LIMIT_TEXTURE_SIZE:
|
||||
return (double) gl.getMaxTextureSize();
|
||||
case Graphics::LIMIT_MULTI_CANVAS:
|
||||
|
||||
@@ -289,6 +289,10 @@ void OpenGL::initMaxValues()
|
||||
maxRenderbufferSamples = 0;
|
||||
|
||||
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxTextureUnits);
|
||||
|
||||
GLfloat limits[2];
|
||||
glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, limits);
|
||||
maxPointSize = limits[1];
|
||||
}
|
||||
|
||||
void OpenGL::initMatrices()
|
||||
|
||||
@@ -377,6 +377,12 @@ public:
|
||||
**/
|
||||
int getMaxTextureUnits() const;
|
||||
|
||||
/**
|
||||
* Returns the maximum point size.
|
||||
**/
|
||||
float getMaxPointSize() const;
|
||||
|
||||
|
||||
void updateTextureMemorySize(size_t oldsize, size_t newsize);
|
||||
|
||||
/**
|
||||
@@ -408,6 +414,7 @@ private:
|
||||
int maxRenderTargets;
|
||||
int maxRenderbufferSamples;
|
||||
int maxTextureUnits;
|
||||
float maxPointSize;
|
||||
|
||||
Vendor vendor;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user