Add easy way to check gl version >= something

This commit is contained in:
Henrik Rydgard committed 2013-12-07 12:24:09 +01:00
1 parent 567998672e
commit bc1ad342e7
2 files changed
+16

No files matched your search

+12
View File
@@ -1,5 +1,17 @@
#include "gfx_es2/gpu_features.h"
bool GLExtensions::VersionGEThan(int major, int minor, int sub) {
if (gl_extensions.ver[0] > major)
return true;
if (gl_extensions.ver[0] < major)
return false;
if (gl_extensions.ver[1] > minor)
return true;
if (gl_extensions.ver[1] < minor)
return false;
return gl_extensions.ver[2] >= sub;
}
void ProcessGPUFeatures() {
gl_extensions.bugs = 0;
// Should be table driven instead, this is a quick hack for Galaxy Y
+4
View File
@@ -29,6 +29,7 @@ enum {
struct GLExtensions {
int ver[3];
int gpuVendor;
bool GLES3; // true if the full OpenGL ES 3.0 is supported
bool OES_depth24;
bool OES_packed_depth_stencil;
@@ -55,6 +56,9 @@ struct GLExtensions {
// Bugs
int bugs;
// greater-or-equal than
bool VersionGEThan(int major, int minor, int sub = 0);
};
extern GLExtensions gl_extensions;