SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
SDL/opengl_compat.h
1 #pragma once
2
3 #define GL_GLEXT_PROTOTYPES
4 #include <SDL_opengl.h>
5 #include <SDL_video.h>
6
7 #ifndef __APPLE__
8 #define GL_COMPAT_NAME(func) gl_compat_##func
9
10 #define GL_COMPAT_WRAPPER(func) \
11 ({ extern typeof(func) *GL_COMPAT_NAME(func); \
12 if (!GL_COMPAT_NAME(func)) GL_COMPAT_NAME(func) = SDL_GL_GetProcAddress(#func); \
13 GL_COMPAT_NAME(func); \
14 })
15
16 #define glCreateShader GL_COMPAT_WRAPPER(glCreateShader)
17 #define glGetAttribLocation GL_COMPAT_WRAPPER(glGetAttribLocation)
18 #define glGetUniformLocation GL_COMPAT_WRAPPER(glGetUniformLocation)
19 #define glUseProgram GL_COMPAT_WRAPPER(glUseProgram)
20 #define glGenVertexArrays GL_COMPAT_WRAPPER(glGenVertexArrays)
21 #define glBindVertexArray GL_COMPAT_WRAPPER(glBindVertexArray)
22 #define glGenBuffers GL_COMPAT_WRAPPER(glGenBuffers)
23 #define glBindBuffer GL_COMPAT_WRAPPER(glBindBuffer)
24 #define glBufferData GL_COMPAT_WRAPPER(glBufferData)
25 #define glEnableVertexAttribArray GL_COMPAT_WRAPPER(glEnableVertexAttribArray)
26 #define glVertexAttribPointer GL_COMPAT_WRAPPER(glVertexAttribPointer)
27 #define glCreateProgram GL_COMPAT_WRAPPER(glCreateProgram)
28 #define glAttachShader GL_COMPAT_WRAPPER(glAttachShader)
29 #define glLinkProgram GL_COMPAT_WRAPPER(glLinkProgram)
30 #define glGetProgramiv GL_COMPAT_WRAPPER(glGetProgramiv)
31 #define glGetProgramInfoLog GL_COMPAT_WRAPPER(glGetProgramInfoLog)
32 #define glDeleteShader GL_COMPAT_WRAPPER(glDeleteShader)
33 #define glUniform2f GL_COMPAT_WRAPPER(glUniform2f)
34 #define glActiveTexture GL_COMPAT_WRAPPER(glActiveTexture)
35 #define glUniform1i GL_COMPAT_WRAPPER(glUniform1i)
36 #define glBindFragDataLocation GL_COMPAT_WRAPPER(glBindFragDataLocation)
37 #define glDeleteProgram GL_COMPAT_WRAPPER(glDeleteProgram)
38 #define glShaderSource GL_COMPAT_WRAPPER(glShaderSource)
39 #define glCompileShader GL_COMPAT_WRAPPER(glCompileShader)
40 #define glGetShaderiv GL_COMPAT_WRAPPER(glGetShaderiv)
41 #define glGetShaderInfoLog GL_COMPAT_WRAPPER(glGetShaderInfoLog)
42 #endif
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.