MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / BindVBAExtension

Function BindVBAExtension

src/video/opengl.cpp:299–315  ·  view source on GitHub ↗

Bind vertex array object extension functions. */

Source from the content-addressed store, hash-verified

297
298/** Bind vertex array object extension functions. */
299static bool BindVBAExtension()
300{
301 /* The APPLE and ARB variants have different semantics (that don't matter for us).
302 * Successfully getting pointers to one variant doesn't mean it is supported for
303 * the current context. Always check the extension strings as well. */
304 if (IsOpenGLVersionAtLeast(3, 0) || IsOpenGLExtensionSupported("GL_ARB_vertex_array_object")) {
305 if (!BindGLProc(_glGenVertexArrays, "glGenVertexArrays")) return false;
306 if (!BindGLProc(_glDeleteVertexArrays, "glDeleteVertexArrays")) return false;
307 if (!BindGLProc(_glBindVertexArray, "glBindVertexArray")) return false;
308 } else if (IsOpenGLExtensionSupported("GL_APPLE_vertex_array_object")) {
309 if (!BindGLProc(_glGenVertexArrays, "glGenVertexArraysAPPLE")) return false;
310 if (!BindGLProc(_glDeleteVertexArrays, "glDeleteVertexArraysAPPLE")) return false;
311 if (!BindGLProc(_glBindVertexArray, "glBindVertexArrayAPPLE")) return false;
312 }
313
314 return true;
315}
316
317/** Bind extension functions for shader support. */
318static bool BindShaderExtensions()

Callers 1

InitMethod · 0.85

Calls 3

IsOpenGLVersionAtLeastFunction · 0.85
BindGLProcFunction · 0.85

Tested by

no test coverage detected