GLExtensions.hpp
1 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24 
25 #ifndef CPP3DS_GLEXTENSIONS_HPP
26 #define CPP3DS_GLEXTENSIONS_HPP
27 
29 // Headers
31 #include <cpp3ds/Config.hpp>
32 #include <cpp3ds/OpenGL.hpp>
33 
34 #ifdef EMULATION
35 
36  #define GLEXT_blend_func_separate GLEW_EXT_blend_func_separate
37  #define GLEXT_blend_equation_separate GLEW_EXT_blend_equation_separate
38  #define GLEXT_glBlendFuncSeparate glBlendFuncSeparateEXT
39  #define GLEXT_glBlendEquationSeparate glBlendEquationSeparateEXT
40  #define GLEXT_framebuffer_object GLEW_EXT_framebuffer_object
41  #define GLEXT_glGenFramebuffers glGenFramebuffersEXT
42  #define GLEXT_glGenRenderbuffers glGenRenderbuffersEXT
43  #define GLEXT_glBindFramebuffer glBindFramebufferEXT
44  #define GLEXT_glBindRenderbuffer glBindRenderbufferEXT
45  #define GLEXT_glDeleteFramebuffers glDeleteFramebuffersEXT
46  #define GLEXT_glDeleteRenderbuffers glDeleteRenderbuffersEXT
47  #define GLEXT_glRenderbufferStorage glRenderbufferStorageEXT
48  #define GLEXT_glFramebufferRenderbuffer glFramebufferRenderbufferEXT
49  #define GLEXT_glFramebufferTexture2D glFramebufferTexture2DEXT
50  #define GLEXT_glCheckFramebufferStatus glCheckFramebufferStatusEXT
51  #define GLEXT_GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT
52  #define GLEXT_GL_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING_EXT
53  #define GLEXT_GL_RENDERBUFFER GL_RENDERBUFFER_EXT
54  #define GLEXT_GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
55  #define GLEXT_GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_EXT
56  #define GLEXT_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_EXT
57  #define GLEXT_GL_DEPTH_COMPONENT GL_DEPTH_COMPONENT
58  #define GLEXT_GL_INVALID_FRAMEBUFFER_OPERATION GL_INVALID_FRAMEBUFFER_OPERATION_EXT
59  #define GLEXT_texture_non_power_of_two GLEW_ARB_texture_non_power_of_two
60  #define GLEXT_multitexture GLEW_ARB_multitexture
61  #define GLEXT_glClientActiveTexture glClientActiveTextureARB
62  #define GLEXT_glActiveTexture glActiveTextureARB
63  #define GLEXT_GL_TEXTURE0 GL_TEXTURE0_ARB
64  #define GLEXT_glBlendEquation glBlendEquation
65  #define GLEXT_GL_FUNC_ADD GL_FUNC_ADD
66  #define GLEXT_GL_FUNC_SUBTRACT GL_FUNC_SUBTRACT
67 
68 #else
69 
70  #define GL_GLEXT_PROTOTYPES
71 
72  #define GLEXT_blend_func_separate GL_OES_blend_func_separate
73  #define GLEXT_blend_equation_separate GL_OES_blend_equation_separate
74  #define GLEXT_glBlendFuncSeparate glBlendFuncSeparate
75  #define GLEXT_glBlendEquationSeparate glBlendEquationSeparate
76  #define GLEXT_framebuffer_object GL_OES_framebuffer_object
77  #define GLEXT_glGenFramebuffers glGenFramebuffers
78  #define GLEXT_glGenRenderbuffers glGenRenderbuffers
79  #define GLEXT_glBindFramebuffer glBindFramebuffer
80  #define GLEXT_glBindRenderbuffer glBindRenderbuffer
81  #define GLEXT_glDeleteFramebuffers glDeleteFramebuffers
82  #define GLEXT_glDeleteRenderbuffers glDeleteRenderbuffers
83  #define GLEXT_glRenderbufferStorage glRenderbufferStorage
84  #define GLEXT_glFramebufferRenderbuffer glFramebufferRenderbuffer
85  #define GLEXT_glFramebufferTexture2D glFramebufferTexture2D
86  #define GLEXT_glCheckFramebufferStatus glCheckFramebufferStatus
87  #define GLEXT_GL_FRAMEBUFFER GL_FRAMEBUFFER
88  #define GLEXT_GL_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING_EXT
89  #define GLEXT_GL_RENDERBUFFER GL_RENDERBUFFER
90  #define GLEXT_GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
91  #define GLEXT_GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_EXT
92  #define GLEXT_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_EXT
93  #define GLEXT_GL_DEPTH_COMPONENT GL_DEPTH_COMPONENT16_EXT
94  #define GLEXT_GL_INVALID_FRAMEBUFFER_OPERATION GL_INVALID_FRAMEBUFFER_OPERATION
95  #define GLEXT_texture_non_power_of_two false
96  #define GLEXT_multitexture true
97  #define GLEXT_glClientActiveTexture glClientActiveTexture
98  #define GLEXT_glActiveTexture glActiveTexture
99  #define GLEXT_GL_TEXTURE0 GL_TEXTURE0
100  #define GLEXT_glBlendEquation glBlendEquation
101  #define GLEXT_GL_FUNC_ADD GL_FUNC_ADD
102  #define GLEXT_GL_FUNC_SUBTRACT GL_FUNC_SUBTRACT
103 
104 #endif
105 
106 
107 namespace cpp3ds
108 {
109 namespace priv
110 {
111 
116 void ensureExtensionsInit();
117 
118 } // namespace priv
119 
120 } // namespace cpp3ds
121 
122 
123 #endif