1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include <GL/glx.h>
6 
7 #define IMPORTVBO_API
8 #define IMPORTVBO_FNPTRINIT = NULL
9 #include "importvbo.h"
10 
11 #ifdef GLX_VERSION_1_4  // GLX_VERSION >= 1.4
12 #define GLEXT_GetProcAddress glXGetProcAddress
13 #else  // GLX_VERSION < 1.4
14 #define GLEXT_GetProcAddress glXGetProcAddressARB
15 #endif  // GLX_VERSION
16 
loadVBOProcs()17 int loadVBOProcs()
18 {
19     FP_glGenBuffersARB = (FT_glGenBuffersARB)GLEXT_GetProcAddress(
20                          (const GLubyte *)"glGenBuffersARB");
21     FP_glBindBufferARB = (FT_glBindBufferARB)GLEXT_GetProcAddress(
22                          (const GLubyte *)"glBindBufferARB");
23     FP_glBufferDataARB = (FT_glBufferDataARB)GLEXT_GetProcAddress(
24                          (const GLubyte *)"glBufferDataARB");
25     FP_glBufferSubDataARB = (FT_glBufferSubDataARB)GLEXT_GetProcAddress(
26                             (const GLubyte *)"glBufferSubDataARB");
27     FP_glDeleteBuffersARB = (FT_glDeleteBuffersARB)GLEXT_GetProcAddress(
28                             (const GLubyte *)"glDeleteBuffersARB");
29     if (FP_glGenBuffersARB == NULL || FP_glBindBufferARB == NULL ||
30         FP_glBufferDataARB == NULL || FP_glBufferSubDataARB == NULL ||
31         FP_glDeleteBuffersARB == NULL)
32         return 0;
33     return 1;
34 }
35 
36