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 #ifndef IMPORTVBO_H_INCLUDED
6 #define IMPORTVBO_H_INCLUDED
7 
8 #include <GL/gl.h>
9 #include <GL/glext.h>
10 
11 #ifndef IMPORTVBO_API
12 #define IMPORTVBO_API extern
13 #endif  // IMPORTVBO_API
14 
15 #ifndef IMPORTVBO_FNPTRINIT
16 #define IMPORTVBO_FNPTRINIT
17 #endif  // IMPORTVBO_FNPTRINT
18 
19 IMPORTVBO_API void (*FP_glGenBuffersARB)(GLsizei, GLuint *) IMPORTVBO_FNPTRINIT;
20 IMPORTVBO_API void (*FP_glBindBufferARB)(GLenum, GLuint) IMPORTVBO_FNPTRINIT;
21 IMPORTVBO_API void (*FP_glBufferDataARB)(GLenum, GLsizeiptrARB, const GLvoid *, GLenum) IMPORTVBO_FNPTRINIT;
22 IMPORTVBO_API void (*FP_glBufferSubDataARB)(GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *) IMPORTVBO_FNPTRINIT;
23 IMPORTVBO_API void (*FP_glDeleteBuffersARB)(GLsizei, const GLuint *) IMPORTVBO_FNPTRINIT;
24 
25 typedef void (*FT_glGenBuffersARB)(GLsizei, GLuint *);
26 typedef void (*FT_glBindBufferARB)(GLenum, GLuint);
27 typedef void (*FT_glBufferDataARB)(GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
28 typedef void (*FT_glBufferSubDataARB)(GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *);
29 typedef void (*FT_glDeleteBuffersARB)(GLsizei, const GLuint *);
30 
31 // We define gl functions without the ARB postfix so GL and GLES code
32 // will have the same look.
33 #define glGenBuffers FP_glGenBuffersARB
34 #define glBindBuffer FP_glBindBufferARB
35 #define glBufferData FP_glBufferDataARB
36 #define glBufferSubData FP_glBufferSubDataARB
37 #define glDeleteBuffers FP_glDeleteBuffersARB
38 
39 extern int loadVBOProcs();
40 
41 #endif  // IMPORTVBO_H_INCLUDED
42 
43