- Can set glCapabilities.compatible = false on top level Window to request a core profile
- Setting up a VAO per display
- Renamed glcaps -> glCaps
public class GLCapabilities : uint
{
public:
+ // Expect reloading graphics
+ bool compatible :1;
+ bool vertexBuffer :1;
+ bool quads :1;
+ bool intAndDouble :1;
+ bool legacyFormats :1;
+ bool nonPow2Textures :1;
+ bool vertexPointer :1;
+
+ // Should be able to toggle without reloading
bool legacy :1;
bool shaders :1;
- bool nonPow2Textures :1;
- bool vertexBuffer :1;
+ bool fixedFunction :1;
+ bool immediate :1;
bool frameBuffer :1;
bool pointSize :1;
-
- // To be able to disable these at runtime independently...
- bool immediate :1;
- bool fixedFunction :1;
- bool quads :1;
- bool intAndDouble :1;
+ bool vao :1;
+ bool select :1;
// bool mapBuffer :1;
+
+ bool debug :1;
};
public enum RenderState { fillMode = 1, depthTest, depthWrite, fogDensity, fogColor, blend, ambient, alphaWrite, antiAlias, vSync };
public PixelFormat pixelFormat;
public DisplayFlags flags;
int numDisplays;
+ GLCapabilities glCapabilities;
OldList resources;
default:
// Capabilities Global set to capabilities of Display being rendered to
-GLCapabilities glcaps;
+GLCapabilities glCaps;
// Requiring Graphics Reload:
-bool glcaps_nonPow2Textures, glcaps_vertexBuffer, glcaps_quads, glcaps_intAndDouble;
+bool glCaps_nonPow2Textures, glCaps_vertexBuffer, glCaps_quads, glCaps_intAndDouble, glCaps_legacyFormats, glCaps_compatible, glCaps_vertexPointer;
// Might toggle without Reload:
-bool glcaps_shaders, glcaps_fixedFunction, glcaps_immediate, glcaps_legacy, glcaps_pointSize, glcaps_frameBuffer;
+bool glCaps_core, glCaps_shaders, glCaps_fixedFunction, glCaps_immediate, glCaps_legacy, glCaps_pointSize, glCaps_frameBuffer, glCaps_vao, glCaps_select;
// bool mapBuffer;
private:
static GLuint stippleTexture;
static bool stippleEnabled;
- // TOCHECK: Do we really need to pass glcaps_shaders?
-public void glsupLineStipple( int i, unsigned short j )
+public void glsupLineStipple( int i, uint16 j )
{
uint texture[1*16];
int x;
GL_LINE_STRIP
};
// NOTE: This will only work for single quads
- return (type == quads && !glcaps_quads) ? GL_TRIANGLE_FAN : primitiveTypes[type];
+ return (type == quads && !glCaps_quads) ? GL_TRIANGLE_FAN : primitiveTypes[type];
}
public void GLSetupTexturing(bool enable)
{
#if ENABLE_GL_SHADERS
- if(glcaps_shaders)
+ if(glCaps_shaders)
shader_texturing(enable);
#endif
#if ENABLE_GL_FFP
- if(!glcaps_shaders)
+ if(!glCaps_shaders)
(enable ? glEnable : glDisable)(GL_TEXTURE_2D);
#endif
}
public void GLSetupFog(bool enable)
{
#if ENABLE_GL_SHADERS
- if(glcaps_shaders)
+ if(glCaps_shaders)
shader_fog(enable);
#endif
#if ENABLE_GL_FFP
- if(!glcaps_shaders)
+ if(!glCaps_shaders)
(enable ? glEnable : glDisable)(GL_FOG);
#endif
}
{
lightingEnabled = enable;
#if ENABLE_GL_SHADERS
- if(glcaps_shaders)
+ if(glCaps_shaders)
shader_lighting(enable);
#endif
#if ENABLE_GL_FFP
- if(!glcaps_shaders)
+ if(!glCaps_shaders)
(enable ? glEnable : glDisable)(GL_LIGHTING);
#endif
}
#endif
GLCapabilities capabilities, originalCapabilities;
+ bool compat;
+ int version;
ColorAlpha * flippingBuffer;
int flipBufH, flipBufW;
bool depthWrite;
int x, y;
+ uint vao;
};
class OGLSystem : struct
GLXDrawable glxDrawable;
#endif
GLCapabilities capabilities;
+ bool compat;
+ int version;
// Buffer Data
uint16 *shortBDBuffer;
void * previous;
#if defined(__WIN32__)
-static HGLRC winCreateContext(HDC hdc, int * contextVersion, bool * isCompatible)
+static HGLRC winCreateContext(HDC hdc, int * contextVersion, bool * isCompatible, bool compatible)
{
HGLRC result = 0;
if(wglCreateContextAttribsARB)
{ 2, 1 }, { 2, 0 }
};
- bool tryingCompat = true;
+ bool tryingCompat = compatible;
int v = 0;
while(!result)
{
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &oglSystem.maxTextureSize);
#if defined(_GLES)
- capabilities = { fixedFunction = true, vertexBuffer = true, pointSize = true, frameBuffer = extensions && strstr(extensions, "GL_OES_framebuffer_object") };
+ capabilities = { fixedFunction = true, vertexPointer = true, vertexBuffer = true, pointSize = true, legacyFormats = true, frameBuffer = extensions && strstr(extensions, "GL_OES_framebuffer_object") };
#elif defined(_GLES2)
- capabilities = { glcaps_shaders = true, vertexBuffer = true, pointSize = true, frameBuffer = true };
+ capabilities = { glCaps_shaders = true, vertexBuffer = true, pointSize = true, frameBuffer = true, legacyFormats = true };
#else
capabilities =
{
nonPow2Textures = extensions && strstr(extensions, "GL_ARB_texture_non_power_of_two");
intAndDouble = true;
- pointSize = true;
+#ifdef GL_DEBUGGING
+ debug = true;
+#endif
+ compatible = oglDisplay.compat;
+ pointSize = oglDisplay.compat;
#if ENABLE_GL_LEGACY
- legacy = glBegin != null;
- immediate = glBegin != null;
- fixedFunction = glBegin != null;
- quads = glBegin != null;
+ legacy = glBegin != null && oglDisplay.compat;
+ legacyFormats = glBegin != null && oglDisplay.compat;
+ immediate = glBegin != null && oglDisplay.compat;
+ fixedFunction = glBegin != null && oglDisplay.compat;
+ quads = glBegin != null && oglDisplay.compat;
+ select = glSelectBuffer != null && oglDisplay.compat;
#endif
#if ENABLE_GL_SHADERS
shaders = glCreateProgram != null;
#endif
+#if ENABLE_GL_POINTER
+ vertexPointer = oglDisplay.compat;
+#endif
+#if ENABLE_GL_VAO
+ vao = glBindVertexArray != null && !oglDisplay.compat;
+#endif
#if ENABLE_GL_FBO
shaders = glBindFramebuffer != null;
#endif
#elif defined(_GLES2)
oglSystem.capabilities = { shaders = true, vertexBuffer = true, frameBuffer = true, pointSize = true };
#else
- oglSystem.capabilities = { shaders = true, fixedFunction = true, immediate = true, legacy = true, pointSize = true, quads = true, intAndDouble = true, vertexBuffer = true, frameBuffer = true, nonPow2Textures = true };
+ oglSystem.capabilities = { compatible = glCaps_compatible, shaders = true, fixedFunction = true, immediate = true, legacy = true, pointSize = true, quads = true, intAndDouble = true, vertexBuffer = true, frameBuffer = true, vao = true, nonPow2Textures = true };
#endif
#ifdef DIAGNOSTICS
#ifdef DIAGNOSTICS
PrintLn("winCreateContext()");
#endif
- oglSystem.glrc = winCreateContext(oglSystem.hdc, null, null);
+ oglSystem.glrc = winCreateContext(oglSystem.hdc, &oglSystem.version, &oglSystem.compat, displaySystem.glCapabilities.compatible);
#ifdef DIAGNOSTICS
PrintLn("wglMakeCurrent()");
#endif
glShadeModel(GL_FLAT);
#if !defined(_GLES)
- if(!glcaps_shaders)
+ if(!glCaps_shaders)
GLLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);
#endif
glFogi(GL_FOG_MODE, GL_EXP);
SETCAPS(oglDisplay.capabilities);
#if ENABLE_GL_SHADERS
- if(glcaps_shaders)
+ if(glCaps_shaders)
{
#if ENABLE_GL_LEGACY
- glDisableClientState(GL_VERTEX_ARRAY);
- glDisableClientState(GL_NORMAL_ARRAY);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisableClientState(GL_COLOR_ARRAY);
+ if(oglDisplay.compat)
+ {
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_NORMAL_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ glDisableClientState(GL_COLOR_ARRAY);
+ }
#endif
loadShaders(display.displaySystem, "<:ecere>shaders/fixed.vertex", "<:ecere>shaders/fixed.frag");
}
glDisableVertexAttribArray(GLBufferContents::normal);
glDisableVertexAttribArray(GLBufferContents::texCoord);
glDisableVertexAttribArray(GLBufferContents::vertex);
+ glBindVertexArray(0);
glUseProgram(0);
}
#endif
#endif
+
+#if ENABLE_GL_VAO
+ if(glCaps_vao)
+ glBindVertexArray(oglDisplay.vao);
+#endif
+
GLEnableClientState(VERTICES);
GLABBindBuffer(GL_ARRAY_BUFFER, 0);
GLOrtho(0,display.width,display.height,0,0.0,1.0);
#if ENABLE_GL_FFP
- if(!glcaps_shaders)
+ if(!glCaps_shaders)
{
glShadeModel(GL_FLAT);
/*
#if defined(__WIN32__)
oglDisplay.hdc = GetDC(display.window);
SetPixelFormat(oglDisplay.hdc, oglSystem.format, &oglSystem.pfd);
- if((oglDisplay.glrc = winCreateContext(oglDisplay.hdc, null, null)))
+ if((oglDisplay.glrc = winCreateContext(oglDisplay.hdc, &oglDisplay.version, &oglDisplay.compat, (*&display.glCapabilities).compatible)))
{
wglShareLists(oglSystem.glrc, oglDisplay.glrc);
wglMakeCurrent(oglDisplay.hdc, oglDisplay.glrc);
// visualInfo = oglSystem.visualInfo;
//#endif
*/
+#if !defined(__APPLE__)
+ oglDisplay.compat = true;
+ oglDisplay.version = 4;
+#endif
+
if(visualInfo)
{
//printf("visualInfo is not null\n");
#endif
# ifdef GL_DEBUGGING
- setupDebugging();
+ if(oglDisplay.capabilities.debug)
+ setupDebugging();
+#else
+ oglDisplay.capabilities.debug = false;
# endif
#endif
oglDisplay.originalCapabilities = oglDisplay.capabilities;
- // Re-enable glcaps_shaders if no fixed function support
+ // Re-enable glCaps_shaders if no fixed function support
if(!oglDisplay.capabilities.fixedFunction)
capabilities.shaders = true;
- // Re-enable fixed function if no glcaps_shaders support
+ // Re-enable fixed function if no glCaps_shaders support
if(!oglDisplay.capabilities.shaders)
{
capabilities.fixedFunction = true;
capabilities.shaders = false;
}
- // Disable things that don't work with glcaps_shaders
+ // Disable things that don't work with glCaps_shaders
if(capabilities.shaders)
{
capabilities.fixedFunction = false;
oglSystem.capabilities = oglDisplay.capabilities;
}
+#if ENABLE_GL_VAO
+ if(oglDisplay.capabilities.vao)
+ {
+ glGenVertexArrays(1, &oglDisplay.vao);
+ glBindVertexArray(oglDisplay.vao);
+ }
+#endif
+
initialDisplaySetup(display);
}
oglDisplay.pBuffer = wglCreatePbufferARB(oglSystem.hdc, pixelFormat, width, height, attributes);
oglDisplay.hdc = wglGetPbufferDCARB(oglDisplay.pBuffer);
- if((oglDisplay.glrc = winCreateContext(oglDisplay.hdc, null, null)))
+ if((oglDisplay.glrc = winCreateContext(oglDisplay.hdc, null, null, oglDisplay.capabilities.compatible)))
{
BITMAPINFO * info;
HDC hdc = GetDC(display.window);
void StartUpdate(Display display)
{
+#if ENABLE_GL_VAO
+ if(glCaps_vao)
+ {
+ OGLDisplay oglDisplay = display.driverData;
+ glBindVertexArray(oglDisplay.vao);
+ }
+#endif
+ GLABBindBuffer(GL_ARRAY_BUFFER, 0);
+ GLABBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}
void EndUpdate(Display display)
{
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
#if ENABLE_GL_LEGACY
- if(glcaps_legacy)
+ if(glCaps_legacy)
{
glPixelStorei(GL_UNPACK_ROW_LENGTH, bitmap.stride);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, sx);
{
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
#if ENABLE_GL_LEGACY
- if(glcaps_legacy)
+ if(glCaps_legacy)
{
glPixelStorei(GL_UNPACK_ROW_LENGTH, bitmap.stride);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, sx);
if(stipple)
{
#if ENABLE_GL_LEGACY
- if(glcaps_legacy)
+ if(glCaps_legacy)
{
glLineStipple(1, (uint16)stipple);
glEnable(GL_LINE_STIPPLE);
else
{
#if ENABLE_GL_LEGACY
- if(glcaps_legacy)
+ if(glCaps_legacy)
glDisable(GL_LINE_STIPPLE);
else
#endif
break;
case fillMode:
#if ENABLE_GL_LEGACY
- if(glcaps_legacy)
+ if(glCaps_legacy)
glPolygonMode(GL_FRONT_AND_BACK, ((FillModeValue)value == solid) ? GL_FILL : GL_LINE);
#endif
break;
{
float color[4] = { ((Color)value).r/255.0f, ((Color)value).g/255.0f, ((Color)value).b/255.0f, 1.0f };
#if ENABLE_GL_SHADERS
- if(glcaps_shaders)
+ if(glCaps_shaders)
shader_fogColor(color[0], color[1], color[2]);
#endif
#if ENABLE_GL_FFP
- if(!glcaps_shaders)
+ if(!glCaps_shaders)
glFogfv(GL_FOG_COLOR, (float *)&color);
#endif
break;
}
case fogDensity:
#if ENABLE_GL_SHADERS
- if(glcaps_shaders)
+ if(glCaps_shaders)
shader_fogDensity((float)(RenderStateFloat { ui = value }.f * nearPlane));
#endif
#if ENABLE_GL_FFP
- if(!glcaps_shaders)
+ if(!glCaps_shaders)
glFogf(GL_FOG_DENSITY, (float)(RenderStateFloat { ui = value }.f * nearPlane));
#endif
break;
case ambient:
{
#if ENABLE_GL_SHADERS
- if(glcaps_shaders)
+ if(glCaps_shaders)
shader_setGlobalAmbient(((Color)value).r / 255.0f, ((Color)value).g / 255.0f, ((Color)value).b / 255.0f, 1.0f);
#endif
#if ENABLE_GL_FFP
- if(!glcaps_shaders)
+ if(!glCaps_shaders)
{
float ambient[4] = { ((Color)value).r/255.0f, ((Color)value).g/255.0f, ((Color)value).b/255.0f, 1.0f };
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient);
void SetLight(Display display, int id, Light light)
{
#if ENABLE_GL_SHADERS
- if(glcaps_shaders)
+ if(glCaps_shaders)
shader_setLight(display, id, light);
#endif
#if ENABLE_GL_FFP
- if(!glcaps_shaders)
+ if(!glCaps_shaders)
{
if(light != null)
{
GLSetupLighting(true);
#if ENABLE_GL_FFP
- if(!glcaps_shaders)
+ if(!glCaps_shaders)
glShadeModel(GL_SMOOTH);
#endif
glDepthMask((byte)bool::true);
GLDisableClientState(COLORS);
#if ENABLE_GL_SHADERS
- if(glcaps_shaders)
+ if(glCaps_shaders)
shader_setPerVertexColor(false);
#endif
#if ENABLE_GL_FFP
- if(!glcaps_shaders)
+ if(!glCaps_shaders)
glShadeModel(GL_FLAT);
#endif
glEnable(GL_BLEND);
if(material.flags.doubleSided)
{
#if ENABLE_GL_FFP
- if(!glcaps_shaders)
+ if(!glCaps_shaders)
GLLightModeli(GL_LIGHT_MODEL_TWO_SIDE, !material.flags.singleSideLight);
#endif
glDisable(GL_CULL_FACE);
else
{
#if ENABLE_GL_FFP
- if(!glcaps_shaders)
+ if(!glCaps_shaders)
GLLightModeli(GL_LIGHT_MODEL_TWO_SIDE, bool::false);
#endif
glEnable(GL_CULL_FACE);
GLSetupTexturing(false);
#if ENABLE_GL_SHADERS
- if(glcaps_shaders)
+ if(glCaps_shaders)
shader_setMaterial(material, mesh.flags.colors);
#endif
#if ENABLE_GL_FFP
- if(!glcaps_shaders)
+ if(!glCaps_shaders)
{
if(mesh.flags.colors)
{
SETCAPS(oglSystem.capabilities);
if(!mesh.flags.vertices)
{
- oglMesh.vertices.free(glcaps_vertexBuffer);
+ oglMesh.vertices.free(glCaps_vertexBuffer);
delete mesh.vertices;
}
if(!mesh.flags.normals)
{
- oglMesh.normals.free(glcaps_vertexBuffer);
+ oglMesh.normals.free(glCaps_vertexBuffer);
delete mesh.normals;
}
if(!mesh.flags.texCoords1)
{
- oglMesh.texCoords.free(glcaps_vertexBuffer);
+ oglMesh.texCoords.free(glCaps_vertexBuffer);
delete mesh.texCoords;
}
if(!mesh.flags.texCoords2)
{
- oglMesh.texCoords2.free(glcaps_vertexBuffer);
+ oglMesh.texCoords2.free(glCaps_vertexBuffer);
// delete mesh.texCoords2;
}
if(!mesh.flags.colors)
{
- oglMesh.colors.free(glcaps_vertexBuffer);
+ oglMesh.colors.free(glCaps_vertexBuffer);
delete mesh.colors;
}
if(!mesh.flags)
{
OGLSystem oglSystem = displaySystem.driverData;
SETCAPS(oglSystem.capabilities);
- if(glcaps_vertexBuffer)
+ if(glCaps_vertexBuffer)
{
OGLMesh oglMesh = mesh.data;
if(!flags) flags = mesh.flags;
SETCAPS(oglSystem.capabilities);
if(oglIndices)
{
- oglIndices.buffer.free(glcaps_vertexBuffer);
+ oglIndices.buffer.free(glCaps_vertexBuffer);
delete oglIndices.indices;
delete oglIndices;
}
{
OGLSystem oglSystem = displaySystem.driverData;
SETCAPS(oglSystem.capabilities);
- if(glcaps_vertexBuffer)
+ if(glCaps_vertexBuffer)
{
-#if !ENABLE_GL_INTDBL
- if(indices32bit)
+ if(!glCaps_intAndDouble && indices32bit)
{
if(!oglIndices.buffer.buffer)
glGenBuffers(1, &oglIndices.buffer.buffer);
b[i] = (uint16)pointer[i];
glBufferData(GL_ELEMENT_ARRAY_BUFFER, nIndices * sizeof(uint16), b, GL_STATIC_DRAW);
+ }
}
else
-#endif
- oglIndices.buffer.allocate(
- nIndices * (indices32bit ? sizeof(uint32) : sizeof(uint16)),
- oglIndices.indices, staticDraw);
+ oglIndices.buffer.allocate(
+ nIndices * (indices32bit ? sizeof(uint32) : sizeof(uint16)),
+ oglIndices.indices, staticDraw);
}
}
#if defined(__WIN32__)
if(glUnlockArraysEXT)
#endif
- if(!glcaps_vertexBuffer && display.display3D.mesh)
+ if(!glCaps_vertexBuffer && display.display3D.mesh)
glUnlockArraysEXT();
#endif
if(mesh)
#if defined(__WIN32__)
if(glLockArraysEXT)
#endif
- if(!glcaps_vertexBuffer)
+ if(!glCaps_vertexBuffer)
glLockArraysEXT(0, mesh.nVertices);
#endif
}
else
{
OGLIndices oglIndices = primitive->data;
- GLEAB eab = ((!display.display3D.collectingHits && oglIndices && glcaps_vertexBuffer) ? oglIndices.buffer : noEAB);
-#if !ENABLE_GL_INTDBL
- if(!glcaps_vertexBuffer && primitive->type.indices32bit)
+ GLEAB eab = ((!display.display3D.collectingHits && oglIndices && glCaps_vertexBuffer) ? oglIndices.buffer : noEAB);
+ if(!glCaps_intAndDouble && !glCaps_vertexBuffer && primitive->type.indices32bit)
{
uint16 * temp = new uint16[primitive->nIndices];
uint32 * src = (uint32 *)(oglIndices ? oglIndices.indices : primitive->indices);
delete temp;
}
else
-#endif
eab.draw(getPrimitiveType(primitive->type.primitiveType), primitive->nIndices,
primitive->type.indices32bit ? GL_UNSIGNED_INT : GL_UNSIGNED_SHORT,
eab.buffer ? 0 : (oglIndices ? oglIndices.indices : primitive->indices));
#define ENABLE_GL_INTDBL (!defined(_GLES) && !defined(_GLES2))
#define ENABLE_GL_MAPBUF (!defined(_GLES) && !defined(_GLES2))
#define ENABLE_GL_SELECT (!defined(_GLES) && !defined(_GLES2))
+#define ENABLE_GL_VAO (!defined(_GLES) && !defined(_GLES2))
#define ENABLE_GL_COLORMAT (ENABLE_GL_FFP && !defined(_GLES))
#if ENABLE_GL_SHADERS && ENABLE_GL_FFP
- #define GLEnableClientState (glcaps_shaders ? glEnableVertexAttribArray : glEnableClientState)
- #define GLDisableClientState (glcaps_shaders ? glDisableVertexAttribArray : glDisableClientState)
- #define VERTICES (glcaps_shaders ? GLBufferContents::vertex : GL_VERTEX_ARRAY)
- #define NORMALS (glcaps_shaders ? GLBufferContents::normal : GL_NORMAL_ARRAY)
- #define TEXCOORDS (glcaps_shaders ? GLBufferContents::texCoord : GL_TEXTURE_COORD_ARRAY)
- #define COLORS (glcaps_shaders ? GLBufferContents::color : GL_COLOR_ARRAY)
- #define GLVertexPointer(n, t, s, p) (glcaps_shaders ? glVertexAttribPointer(GLBufferContents::vertex, n, t, GL_FALSE, s, p) : glVertexPointer(n, t, s, p))
- #define GLColorPointer(n, t, s, p) (glcaps_shaders ? glVertexAttribPointer(GLBufferContents::color, n, t, GL_FALSE, s, p) : glColorPointer(n, t, s, p))
- #define GLTexCoordPointer(n, t, s, p) (glcaps_shaders ? glVertexAttribPointer(GLBufferContents::texCoord, n, t, GL_FALSE, s, p) : glTexCoordPointer(n, t, s, p))
+ #define GLEnableClientState (glCaps_shaders ? glEnableVertexAttribArray : glEnableClientState)
+ #define GLDisableClientState (glCaps_shaders ? glDisableVertexAttribArray : glDisableClientState)
+ #define VERTICES (glCaps_shaders ? GLBufferContents::vertex : GL_VERTEX_ARRAY)
+ #define NORMALS (glCaps_shaders ? GLBufferContents::normal : GL_NORMAL_ARRAY)
+ #define TEXCOORDS (glCaps_shaders ? GLBufferContents::texCoord : GL_TEXTURE_COORD_ARRAY)
+ #define COLORS (glCaps_shaders ? GLBufferContents::color : GL_COLOR_ARRAY)
+ #define GLVertexPointer(n, t, s, p) (glCaps_shaders ? glVertexAttribPointer(GLBufferContents::vertex, n, t, GL_FALSE, s, p) : glVertexPointer(n, t, s, p))
+ #define GLColorPointer(n, t, s, p) (glCaps_shaders ? glVertexAttribPointer(GLBufferContents::color, n, t, GL_FALSE, s, p) : glColorPointer(n, t, s, p))
+ #define GLTexCoordPointer(n, t, s, p) (glCaps_shaders ? glVertexAttribPointer(GLBufferContents::texCoord, n, t, GL_FALSE, s, p) : glTexCoordPointer(n, t, s, p))
#elif ENABLE_GL_SHADERS
#define GLEnableClientState glEnableVertexAttribArray
#define GLDisableClientState glDisableVertexAttribArray
#endif
#if ENABLE_GL_INTDBL && ENABLE_GL_SHADERS
- #define GLLoadMatrixd(m) (glcaps_fixedFunction ? glLoadMatrixd(m) : glmsLoadMatrixd(m))
- #define GLMultMatrixd(m) (glcaps_fixedFunction ? glMultMatrixd(m) : glmsMultMatrixd(m))
- #define GLFrustum(a,b,c,d,e,f) (glcaps_fixedFunction ? glFrustum(a,b,c,d,e,f) : glmsFrustum(a,b,c,d,e,f))
- #define GLOrtho(a,b,c,d,e,f) (glcaps_fixedFunction ? glOrtho(a,b,c,d,e,f) : glmsOrtho(a,b,c,d,e,f))
- #define GLScaled(x, y, z) (glcaps_fixedFunction ? glScaled(x, y, z) : glmsScaled(x,y,z))
- #define GLScalef(x, y, z) (glcaps_fixedFunction ? glScalef(x, y, z) : glmsScaled(x,y,z))
- #define GLTranslated(x, y, z) (glcaps_fixedFunction ? glTranslated(x,y,z) : glmsTranslated(x,y,z))
- #define GLRotated(a, x, y, z) (glcaps_fixedFunction ? glRotated(a, x,y,z) : glmsRotated(a,x,y,z))
- #define GLMatrixMode(m) (glcaps_fixedFunction ? glMatrixMode(m) : glmsMatrixMode(m))
- #define GLLoadIdentity() (glcaps_fixedFunction ? glLoadIdentity() : glmsLoadIdentity())
- #define GLPushMatrix() (glcaps_fixedFunction ? glPushMatrix() : glmsPushMatrix())
- #define GLPopMatrix() (glcaps_fixedFunction ? glPopMatrix() : glmsPopMatrix())
- #define GLFlushMatrices() (glcaps_fixedFunction ? (void)0 : glmsFlushMatrices())
+ #define GLLoadMatrixd(m) (glCaps_fixedFunction ? glLoadMatrixd(m) : glmsLoadMatrixd(m))
+ #define GLMultMatrixd(m) (glCaps_fixedFunction ? glMultMatrixd(m) : glmsMultMatrixd(m))
+ #define GLFrustum(a,b,c,d,e,f) (glCaps_fixedFunction ? glFrustum(a,b,c,d,e,f) : glmsFrustum(a,b,c,d,e,f))
+ #define GLOrtho(a,b,c,d,e,f) (glCaps_fixedFunction ? glOrtho(a,b,c,d,e,f) : glmsOrtho(a,b,c,d,e,f))
+ #define GLScaled(x, y, z) (glCaps_fixedFunction ? glScaled(x, y, z) : glmsScaled(x,y,z))
+ #define GLScalef(x, y, z) (glCaps_fixedFunction ? glScalef(x, y, z) : glmsScaled(x,y,z))
+ #define GLTranslated(x, y, z) (glCaps_fixedFunction ? glTranslated(x,y,z) : glmsTranslated(x,y,z))
+ #define GLRotated(a, x, y, z) (glCaps_fixedFunction ? glRotated(a, x,y,z) : glmsRotated(a,x,y,z))
+ #define GLMatrixMode(m) (glCaps_fixedFunction ? glMatrixMode(m) : glmsMatrixMode(m))
+ #define GLLoadIdentity() (glCaps_fixedFunction ? glLoadIdentity() : glmsLoadIdentity())
+ #define GLPushMatrix() (glCaps_fixedFunction ? glPushMatrix() : glmsPushMatrix())
+ #define GLPopMatrix() (glCaps_fixedFunction ? glPopMatrix() : glmsPopMatrix())
+ #define GLFlushMatrices() (glCaps_fixedFunction ? (void)0 : glmsFlushMatrices())
#define GLLoadMatrix(m) (glmsLoadMatrix(m), glmsFlushMatrices())
#elif ENABLE_GL_INTDBL
#define GLLoadMatrixd glLoadMatrixd
#endif
#if ENABLE_GL_LEGACY
- #define GLRecti(x1, y1, x2, y2) (glcaps_immediate ? glRecti(x1, y1, x2, y2) : glimtkRecti(x1, y1, x2, y2))
- #define GLBegin(m) (glcaps_immediate ? glBegin(m) : glimtkBegin(m))
- #define GLEnd() (glcaps_immediate ? glEnd() : glimtkEnd())
- #define GLVertex2i(x,y) (glcaps_immediate ? glVertex2i(x,y) : glimtkVertex2i(x,y))
- #define GLVertex2f(x,y) (glcaps_immediate ? glVertex2f(x,y) : glimtkVertex2f(x,y))
- #define GLVertex2d(x,y) (glcaps_immediate ? glVertex2d(x,y) : glimtkVertex2d(x,y))
- #define GLVertex3f(x,y,z) (glcaps_immediate ? glVertex3f(x,y,z) : glimtkVertex3f(x,y,z))
- #define GLVertex3d(x,y,z) (glcaps_immediate ? glVertex3d(x,y,z) : glimtkVertex3d(x,y,z))
- #define GLVertex3fv(v) (glcaps_immediate ? glVertex3fv(v) : glimtkVertex3fv(v))
- #define GLVertex3dv(v) (glcaps_immediate ? glVertex3dv(v) : glimtkVertex3dv(v))
- #define GLTexCoord2i(x,y) (glcaps_immediate ? glTexCoord2i(x,y) : glimtkTexCoord2i(x,y))
- #define GLTexCoord2f(x,y) (glcaps_immediate ? glTexCoord2f(x,y) : glimtkTexCoord2f(x,y))
- #define GLTexCoord2d(x,y) (glcaps_immediate ? glTexCoord2d(x,y) : glimtkTexCoord2d(x,y))
- #define GLTexCoord2fv(v) (glcaps_immediate ? glTexCoord2fv(v) : glimtkTexCoord2fv(v))
- #define GLNormal3f(x,y,z) (glcaps_immediate ? glNormal3f : glimtkNormal3f)
- #define GLNormal3d(x,y,z) (glcaps_immediate ? glNormal3d : glimtkNormal3d)
- #define GLNormal3fv(v) (glcaps_immediate ? glNormal3fv(v) : glimtkNormal3fv(v))
- #define GLNormal3dv(v) (glcaps_immediate ? glNormal3dv(v) : glimtkNormal3dv(v))
- #define GLColor3f(a,b,c) (glcaps_immediate ? glColor3f(a,b,c) : glimtkColor3f(a,b,c))
- #define GLColor4ub(a,b,c,d) (glcaps_immediate ? glColor4ub(a,b,c,d) : glimtkColor4ub(a,b,c,d))
- #define GLColor4f(a,b,c,d) (glcaps_immediate ? glColor4f(a,b,c,d) : glimtkColor4f(a,b,c,d))
- #define GLColor4fv(v) (glcaps_immediate ? glColor4fv(v) : glimtkColor4fv(v))
+ #define GLRecti(x1, y1, x2, y2) (glCaps_immediate ? glRecti(x1, y1, x2, y2) : glimtkRecti(x1, y1, x2, y2))
+ #define GLBegin(m) (glCaps_immediate ? glBegin(m) : glimtkBegin(m))
+ #define GLEnd() (glCaps_immediate ? glEnd() : glimtkEnd())
+ #define GLVertex2i(x,y) (glCaps_immediate ? glVertex2i(x,y) : glimtkVertex2i(x,y))
+ #define GLVertex2f(x,y) (glCaps_immediate ? glVertex2f(x,y) : glimtkVertex2f(x,y))
+ #define GLVertex2d(x,y) (glCaps_immediate ? glVertex2d(x,y) : glimtkVertex2d(x,y))
+ #define GLVertex3f(x,y,z) (glCaps_immediate ? glVertex3f(x,y,z) : glimtkVertex3f(x,y,z))
+ #define GLVertex3d(x,y,z) (glCaps_immediate ? glVertex3d(x,y,z) : glimtkVertex3d(x,y,z))
+ #define GLVertex3fv(v) (glCaps_immediate ? glVertex3fv(v) : glimtkVertex3fv(v))
+ #define GLVertex3dv(v) (glCaps_immediate ? glVertex3dv(v) : glimtkVertex3dv(v))
+ #define GLTexCoord2i(x,y) (glCaps_immediate ? glTexCoord2i(x,y) : glimtkTexCoord2i(x,y))
+ #define GLTexCoord2f(x,y) (glCaps_immediate ? glTexCoord2f(x,y) : glimtkTexCoord2f(x,y))
+ #define GLTexCoord2d(x,y) (glCaps_immediate ? glTexCoord2d(x,y) : glimtkTexCoord2d(x,y))
+ #define GLTexCoord2fv(v) (glCaps_immediate ? glTexCoord2fv(v) : glimtkTexCoord2fv(v))
+ #define GLNormal3f(x,y,z) (glCaps_immediate ? glNormal3f : glimtkNormal3f)
+ #define GLNormal3d(x,y,z) (glCaps_immediate ? glNormal3d : glimtkNormal3d)
+ #define GLNormal3fv(v) (glCaps_immediate ? glNormal3fv(v) : glimtkNormal3fv(v))
+ #define GLNormal3dv(v) (glCaps_immediate ? glNormal3dv(v) : glimtkNormal3dv(v))
+ #define GLColor3f(a,b,c) (glCaps_immediate ? glColor3f(a,b,c) : glimtkColor3f(a,b,c))
+ #define GLColor4ub(a,b,c,d) (glCaps_immediate ? glColor4ub(a,b,c,d) : glimtkColor4ub(a,b,c,d))
+ #define GLColor4f(a,b,c,d) (glCaps_immediate ? glColor4f(a,b,c,d) : glimtkColor4f(a,b,c,d))
+ #define GLColor4fv(v) (glCaps_immediate ? glColor4fv(v) : glimtkColor4fv(v))
#else
#define GLRecti glimtkRecti
#define GLBegin glimtkBegin
#endif
#define SETCAPS(caps) \
- glcaps = caps; \
- glcaps_shaders = glcaps.shaders; \
- glcaps_fixedFunction = glcaps.fixedFunction; \
- glcaps_nonPow2Textures = glcaps.nonPow2Textures; \
- glcaps_vertexBuffer = glcaps.vertexBuffer; \
- glcaps_quads = glcaps.quads; \
- glcaps_intAndDouble = glcaps.intAndDouble; \
- glcaps_immediate = glcaps.immediate; \
- glcaps_legacy = glcaps.legacy; \
- glcaps_pointSize = glcaps.pointSize; \
- glcaps_frameBuffer = glcaps.frameBuffer;
+ glCaps = caps; \
+ glCaps_shaders = glCaps.shaders; \
+ glCaps_fixedFunction = glCaps.fixedFunction; \
+ glCaps_nonPow2Textures = glCaps.nonPow2Textures; \
+ glCaps_vertexBuffer = glCaps.vertexBuffer; \
+ glCaps_quads = glCaps.quads; \
+ glCaps_intAndDouble = glCaps.intAndDouble; \
+ glCaps_immediate = glCaps.immediate; \
+ glCaps_legacy = glCaps.legacy; \
+ glCaps_legacyFormats = glCaps.legacyFormats; \
+ glCaps_pointSize = glCaps.pointSize; \
+ glCaps_frameBuffer = glCaps.frameBuffer; \
+ glCaps_vao = glCaps.vao; \
+ glCaps_compatible = glCaps.compatible; \
+ glCaps_select = glCaps.select; \
+ glCaps_vertexPointer = glCaps.vertexPointer
-extern GLCapabilities glcaps;
-extern bool glcaps_nonPow2Textures, glcaps_vertexBuffer, glcaps_quads, glcaps_intAndDouble;
-extern bool glcaps_shaders, glcaps_fixedFunction, glcaps_immediate, glcaps_legacy, glcaps_pointSize, glcaps_frameBuffer;
+extern GLCapabilities glCaps;
+extern bool glCaps_nonPow2Textures, glCaps_vertexBuffer, glCaps_quads, glCaps_intAndDouble, glCaps_legacyFormats, glCaps_compatible, glCaps_vertexPointer;
+extern bool glCaps_shaders, glCaps_fixedFunction, glCaps_immediate, glCaps_legacy, glCaps_pointSize, glCaps_frameBuffer, glCaps_vao, glCaps_select;
#if ENABLE_GL_INTDBL
#define GL_INDEX_INT GL_UNSIGNED_INT
public void GLABDeleteBuffers(int count, GLAB * buffers)
{
- if(glcaps_vertexBuffer)
+ if(glCaps_vertexBuffer)
{
int i;
for(i = 0; i < count; i++)
// NOTE: Don't call if without vertexBuffer
void GLABBindBuffer(int target, uint buffer)
{
- if(glcaps_vertexBuffer)
+ if(glCaps_vertexBuffer)
{
glBindBuffer(target, buffer);
if(target == GL_ARRAY_BUFFER)
public enum GLBufferUsage { staticDraw, dynamicDraw, streamDraw };
-static GLint bufferUsages[] = { GL_DYNAMIC_DRAW, GL_STATIC_DRAW, GL_STREAM_DRAW };
+static GLint bufferUsages[] = { GL_DYNAMIC_DRAW, GL_STATIC_DRAW, 0x88E0 /*GL_STREAM_DRAW*/ };
public define noAB = GLAB { 0 };
{
if(this != null)
{
- if(glcaps_vertexBuffer)
+ if(glCaps_vertexBuffer)
{
if(!buffer)
glGenBuffers(1, &buffer);
void upload(uint offset, uint size, void * data)
{
- if(this != null && glcaps_vertexBuffer)
+ if(this != null && glCaps_vertexBuffer)
{
if(glabCurArrayBuffer != buffer)
GLABBindBuffer(GL_ARRAY_BUFFER, buffer);
{
if(this != null && buffer)
{
- if(glcaps_vertexBuffer)
+ if(glCaps_vertexBuffer)
GLABDeleteBuffers(1, this);
buffer = 0;
}
void use(GLBufferContents contents, int n, int type, uint stride, void * pointer)
{
- if(glabCurArrayBuffer != ((this != null) ? buffer : 0) && glcaps_vertexBuffer)
+ if(glabCurArrayBuffer != ((this != null) ? buffer : 0) && glCaps_vertexBuffer)
GLABBindBuffer(GL_ARRAY_BUFFER, ((this != null) ? buffer : 0));
#if ENABLE_GL_SHADERS
- if(glcaps_shaders)
+ if(glCaps_shaders)
glVertexAttribPointer(contents, n, type, GL_FALSE, stride, pointer);
#endif
#if ENABLE_GL_FFP
- if(!glcaps_shaders)
+ if(!glCaps_shaders)
switch(contents)
{
case normal: glNormalPointer (type, stride, pointer); break;
void useVertTrans(uint count, int n, int type, uint stride, void * pointer)
{
-#if !ENABLE_GL_INTDBL
- if(glabCurArrayBuffer != ((this != null) ? buffer : 0) && glcaps_vertexBuffer)
- GLABBindBuffer(GL_ARRAY_BUFFER, ((this != null) ? buffer : 0));
- if(type == GL_INT)
+ if(!glCaps_intAndDouble)
{
- if(pointer)
+ if(glabCurArrayBuffer != ((this != null) ? buffer : 0) && glCaps_vertexBuffer)
+ GLABBindBuffer(GL_ARRAY_BUFFER, ((this != null) ? buffer : 0));
+ if(type == GL_INT)
{
- int i;
- if(count*n > shortVPSize)
+ if(pointer)
{
- shortVPSize = count*n;
- shortVPBuffer = renew shortVPBuffer short[shortVPSize];
+ int i;
+ if(count*n > shortVPSize)
+ {
+ shortVPSize = count*n;
+ shortVPBuffer = renew shortVPBuffer short[shortVPSize];
+ }
+ for(i = 0; i < count*n; i++)
+ shortVPBuffer[i] = (short)((int *)pointer)[i];
+
+ GLVertexPointer(n, GL_SHORT, stride, shortVPBuffer);
}
- for(i = 0; i < count*n; i++)
- shortVPBuffer[i] = (short)pointer[i];
-
- GLVertexPointer(n, GL_SHORT, stride, shortVPBuffer);
+ else
+ GLVertexPointer(n, GL_SHORT, stride, 0);
+ }
+ else if(type == GL_DOUBLE)
+ {
+ #if ENABLE_GL_SHADERS
+ if(glCaps_shaders)
+ glVertexAttribPointer(GLBufferContents::vertex, n, GL_DOUBLE, GL_FALSE, stride, pointer);
+ #endif
+
+ #if ENABLE_GL_FFP
+ if(!glCaps_shaders)
+ glVertexPointer(n, GL_DOUBLE, stride, pointer);
+ #endif
}
- else
- GLVertexPointer(n, GL_SHORT, stride, 0);
- }
- else if(type == GL_DOUBLE)
- {
-#if ENABLE_GL_SHADERS
- if(glcaps_shaders)
- glVertexAttribPointer(GLBufferContents::vertex, n, GL_DOUBLE, GL_FALSE, stride, pointer);
-#endif
-
-#if ENABLE_GL_FFP
- if(!glcaps_shaders)
- glVertexPointer(n, GL_DOUBLE, stride, pointer);
-#endif
}
-#else
- use(vertex, n, type, stride, pointer);
-#endif
+ else
+ use(vertex, n, type, stride, pointer);
}
};
{
if(this != null)
{
- if(glcaps_vertexBuffer)
+ if(glCaps_vertexBuffer)
{
if(!buffer)
glGenBuffers(1, &buffer);
- if(glcaps_vertexBuffer && glabCurElementBuffer != buffer)
+ if(glCaps_vertexBuffer && glabCurElementBuffer != buffer)
GLABBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffer);
if(size)
glBufferData(GL_ELEMENT_ARRAY_BUFFER, size, data, bufferUsages[usage]);
void upload(uint offset, uint size, void * data)
{
- if(this != null && glcaps_vertexBuffer)
+ if(this != null && glCaps_vertexBuffer)
{
if(glabCurArrayBuffer != buffer)
GLABBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffer);
{
if(this != null && buffer)
{
- if(glcaps_vertexBuffer)
+ if(glCaps_vertexBuffer)
GLABDeleteBuffers(1, (GLAB *)this);
buffer = 0;
}
void draw(int primType, int count, int type, void * indices)
{
- if(glcaps_vertexBuffer
+ if(glCaps_vertexBuffer
#if ENABLE_GL_POINTER
- || (!buffer && indices)
+ || (glCaps_vertexPointer && !buffer && indices)
#endif
)
{
- if(glcaps_vertexBuffer && glabCurElementBuffer != ((this != null) ? buffer : 0))
+ if(glCaps_vertexBuffer && glabCurElementBuffer != ((this != null) ? buffer : 0))
GLABBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ((this != null) ? buffer : 0));
-#if !ENABLE_GL_INTDBL
- type = GL_UNSIGNED_SHORT;
-#endif
+ if(!glCaps_intAndDouble)
+ type = GL_UNSIGNED_SHORT;
GLFlushMatrices();
glDrawElements(primType, count, type, indices);
}
public void glimtkTexCoord2f(float x, float y)
{
int stride = verticesBuf.stride;
- bool quadsAdd = beginMode == quads && !glcaps_quads && ((beginCount % 4) == 3);
+ bool quadsAdd = beginMode == quads && !glCaps_quads && ((beginCount % 4) == 3);
float * buf = verticesBuf.ensure(quadsAdd ? 3 : 1);
buf[0] = x;
buf[1] = y;
verticesBuf.stride = vertexOffset + numCoords;
{
int stride = verticesBuf.stride;
- bool quadsAdd = beginMode == quads && !glcaps_quads && ((beginCount % 4) == 3);
+ bool quadsAdd = beginMode == quads && !glCaps_quads && ((beginCount % 4) == 3);
float * buf = verticesBuf.ensure(quadsAdd ? 3 : 1) + vertexOffset;
buf[0] = x;
buf[1] = y;
verticesBuf.stride = vertexOffset + numCoords;
{
int stride = verticesBuf.stride;
- bool quadsAdd = beginMode == quads && !glcaps_quads && ((beginCount % 4) == 3);
+ bool quadsAdd = beginMode == quads && !glCaps_quads && ((beginCount % 4) == 3);
float * buf = verticesBuf.ensure(quadsAdd ? 3 : 1) + vertexOffset;
buf[0] = x;
buf[1] = y;
verticesBuf.stride = vertexOffset + numCoords;
{
int stride = verticesBuf.stride;
- bool quadsAdd = beginMode == quads && !glcaps_quads && ((beginCount % 4) == 3);
+ bool quadsAdd = beginMode == quads && !glCaps_quads && ((beginCount % 4) == 3);
float * buf = verticesBuf.ensure(quadsAdd ? 3 : 1) + 2;
buf[0] = r, buf[1] = g, buf[2] = b, buf[3] = a;
else
{
#if ENABLE_GL_SHADERS
- if(glcaps_shaders)
+ if(glCaps_shaders)
shader_color(r, g, b, a);
#endif
#if ENABLE_GL_FFP
- if(!glcaps_shaders)
+ if(!glCaps_shaders)
{
glColor4f(r, g, b, a);
if(lightingEnabled)
normalsBuf.count = verticesBuf.count;
{
int stride = normalsBuf.stride;
- bool quadsAdd = beginMode == quads && !glcaps_quads && ((beginCount % 4) == 3);
+ bool quadsAdd = beginMode == quads && !glCaps_quads && ((beginCount % 4) == 3);
float * buf = normalsBuf.ensure(quadsAdd ? 3 : 1) + 2;
buf[0] = x, buf[1] = y, buf[2] = z;
public void glimtkEnd()
{
GLIMTKMode mode = beginMode;
- if(!glcaps_quads)
+ if(!glCaps_quads)
{
if(mode == quads) mode = triangles;
else if(mode == polygon) mode = triangleFan;
GLEnableClientState(TEXCOORDS);
- if(glcaps_vertexBuffer)
+ if(glCaps_vertexBuffer)
{
verticesBuf.upload();
verticesBuf.use(texCoord, 2, GL_FLOAT, verticesBuf.stride * sizeof(float), 0);
if(vertexColorValues)
{
GLEnableClientState(COLORS);
- if(glcaps_vertexBuffer)
+ if(glCaps_vertexBuffer)
verticesBuf.use(color, 4, GL_FLOAT, verticesBuf.stride * sizeof(float), (void *)(2 * sizeof(float)));
else
noAB.use(color, 4, GL_FLOAT, verticesBuf.stride * sizeof(float), verticesBuf.pointer + 2);
#if ENABLE_GL_SHADERS
- if(glcaps_shaders)
+ if(glCaps_shaders)
shader_setPerVertexColor(true);
#endif
}
- if(glcaps_vertexBuffer)
+ if(glCaps_vertexBuffer)
verticesBuf.use(vertex, numCoords, GL_FLOAT, verticesBuf.stride * sizeof(float), (void *)(vertexOffset * sizeof(float)));
else
noAB.use(vertex, numCoords, GL_FLOAT, verticesBuf.stride * sizeof(float), verticesBuf.pointer + vertexOffset);
if(normalsBuf.count && normalsBuf.count == verticesBuf.count)
{
GLEnableClientState(NORMALS);
- if(glcaps_vertexBuffer)
+ if(glCaps_vertexBuffer)
{
normalsBuf.upload();
normalsBuf.use(normal, 3, GL_FLOAT, 3*sizeof(float), 0);
GLDisableClientState(COLORS);
#if ENABLE_GL_SHADERS
- if(glcaps_shaders)
+ if(glCaps_shaders)
shader_setPerVertexColor(false);
#endif
{
Matrix * matrix = &matrixStack[stack][matrixIndex[stack]];
#if ENABLE_GL_SHADERS
- if(glcaps_shaders)
+ if(glCaps_shaders)
{
if(stack == 0)
{
#endif
#if ENABLE_GL_FFP
- if(!glcaps_shaders)
+ if(!glCaps_shaders)
{
float m[16] =
{
stackModified[stack] = false;
}
#if ENABLE_GL_SHADERS
- if(glcaps_shaders && stack == 1 && prjViewModified)
+ if(glCaps_shaders && stack == 1 && prjViewModified)
{
Matrix * mv = &matrixStack[0][matrixIndex[0]];
Matrix * prj = &matrixStack[1][matrixIndex[1]];
if(!displaySystem)
{
- displaySystem = DisplaySystem {};
+ displaySystem = DisplaySystem { glCapabilities = glCapabilities };
if(!displaySystem.Create(dDriver.name, guiApp.fullScreenMode ? windowHandle : windowHandle /*null*/, guiApp.fullScreenMode))
{
delete displaySystem;
(glCapabilities.nonPow2Textures != value.nonPow2Textures ||
glCapabilities.intAndDouble != value.intAndDouble ||
glCapabilities.vertexBuffer != value.vertexBuffer ||
+ glCapabilities.compatible != value.compatible ||
+ glCapabilities.legacyFormats != value.legacyFormats ||
+ glCapabilities.debug != value.debug ||
+ glCapabilities.vertexPointer != value.vertexPointer ||
glCapabilities.quads != value.quads);
if(reload)
UnloadGraphics(false);
void * windowData;
CreationActivationOption creationActivation;
GLCapabilities glCapabilities;
- glCapabilities = { true, true, true, true, true, true, true, true, true, true };
+ glCapabilities = { true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true };
struct
{
bool active:1; // true if window and ancestors are active