Debian Codegraph @

utils/glcaps.c

raw symbols SCIP
1 #cxx . . $ `<file>/utils/glcaps.c`/ifdef _WINDOWS
2 #define WIN32_LEAN_AND_MEAN 1
3 #include <windows.h>
4 #endif
5
6 #include <stdio.h>
7 #define GL_GLEXT_LEGACYcxx . . $ `utils/glcaps.c:7:9`! 1
8 #include "GL/gl.h"
9 #include "GL/glext.h"cxx . . $ `<file>/GL/glext.h`/
10 #include "SDL.h"
11
12 #ifndef WINGDIAPI
13 #define WINGDIAPIcxx . . $ `utils/glcaps.c:13:9`!
14 #endif
15
16 typedef WINGDIAPIcxx . . $ `utils/glcaps.c:13:9`! void (APIENTRYPcxx . . $ `<external>/11565930711847777359/gl.h:88:9`! PFNGLGETINTEGERVPROCcxx . . $ PFNGLGETINTEGERVPROC#) (GLenumcxx . . $ GLenum# pname, GLintcxx . . $ GLint# *params);
17 typedef WINGDIAPIcxx . . $ `utils/glcaps.c:13:9`! const GLubytecxx . . $ GLubyte# * (APIENTRYPcxx . . $ `<external>/11565930711847777359/gl.h:88:9`! PFNGLGETSTRINGPROCcxx . . $ PFNGLGETSTRINGPROC#) (GLenumcxx . . $ GLenum# name);
18
19 #ifndef GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXTcxx . . $ `GL/glext.h:4750:9`!
20 #define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2
21 #endif
22 #ifndef GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXTcxx . . $ `GL/glext.h:4751:9`!
23 #define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3
24 #endif
25 #ifndef GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXTcxx . . $ `GL/glext.h:4752:9`!
26 #define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4
27 #endif
28 #ifndef GL_MAX_BINDABLE_UNIFORM_SIZE_EXTcxx . . $ `GL/glext.h:4753:9`!
29 #define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED
30 #endif
31
32 static int is_atleast_gl3cxx . . $ is_atleast_gl3(5c4306d8553b3696).(const char *str)
33 {
34 int maj, min;
35 sscanfcxx . . $ sscanf(5e8a2c12db2ea735).(str, "%d.%d", &maj, &min);
36 return ( ((maj << 16) | min) >= ((3 << 16) | 0) );
37 }
38
39 int maincxx . . $ main(afcd3168fc1188a4).(int argc, char **argv)
40 {
41 int retval = 1;
42 GLintcxx . . $ GLint# val = 0;
43 const char *str = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
44 SDL_Windowcxx . . $ SDL_Window# *sdlwindow = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
45
46 if (SDL_Initcxx . . $ SDL_Init(4c679297bf94b9eb).(SDL_INIT_VIDEOcxx . . $ `<external>/13597568925221565411/SDL.h:85:9`!) == -1)
47 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "SDL_Init() error: %s\n", SDL_GetErrorcxx . . $ SDL_GetError(33a1f659e94feb42).());
48 else if (SDL_GL_LoadLibrarycxx . . $ SDL_GL_LoadLibrary(5c4306d8553b3696).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) == -1)
49 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "SDL_GL_LoadLibrary() error: %s\n", SDL_GetErrorcxx . . $ SDL_GetError(33a1f659e94feb42).());
50 else if ((sdlwindow = SDL_CreateWindowcxx . . $ SDL_CreateWindow(2360bbcd09caf609).(argv[0], SDL_WINDOWPOS_UNDEFINEDcxx . . $ `<external>/14887343297790812595/SDL_video.h:138:9`!, SDL_WINDOWPOS_UNDEFINEDcxx . . $ `<external>/14887343297790812595/SDL_video.h:138:9`!, 640, 480, SDL_WINDOW_OPENGLcxx . . $ SDL_WINDOW_OPENGL.)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
51 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "SDL_CreateWindow() error: %s\n", SDL_GetErrorcxx . . $ SDL_GetError(33a1f659e94feb42).());
52 if (SDL_GL_CreateContextcxx . . $ SDL_GL_CreateContext(f7c79fd5aa0bf365).(sdlwindow) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
53 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "SDL_GL_CreateContext() error: %s\n", SDL_GetErrorcxx . . $ SDL_GetError(33a1f659e94feb42).());
54 else
55 retval = 0;
56
57 if (retval != 0)
58 {
59 SDL_Quitcxx . . $ SDL_Quit(49f6e7a06ebc5aa8).();
60 return retval;
61 } // if
62
63 PFNGLGETSTRINGPROCcxx . . $ PFNGLGETSTRINGPROC# pglGetString = (PFNGLGETSTRINGPROCcxx . . $ PFNGLGETSTRINGPROC#) SDL_GL_GetProcAddresscxx . . $ SDL_GL_GetProcAddress(42228c1987407501).("glGetString");
64 PFNGLGETINTEGERVPROCcxx . . $ PFNGLGETINTEGERVPROC# pglGetIntegerv = (PFNGLGETINTEGERVPROCcxx . . $ PFNGLGETINTEGERVPROC#) SDL_GL_GetProcAddresscxx . . $ SDL_GL_GetProcAddress(42228c1987407501).("glGetIntegerv");
65 PFNGLGETPROGRAMIVARBPROCcxx . . $ PFNGLGETPROGRAMIVARBPROC# pglGetProgramivARB = (PFNGLGETPROGRAMIVARBPROCcxx . . $ PFNGLGETPROGRAMIVARBPROC#) SDL_GL_GetProcAddresscxx . . $ SDL_GL_GetProcAddress(42228c1987407501).("glGetProgramivARB");
66 PFNGLGETSTRINGIPROCcxx . . $ PFNGLGETSTRINGIPROC# pglGetStringi = (PFNGLGETSTRINGIPROCcxx . . $ PFNGLGETSTRINGIPROC#) SDL_GL_GetProcAddresscxx . . $ SDL_GL_GetProcAddress(42228c1987407501).("glGetStringi");
67
68 printfcxx . . $ printf(581fddd72a8db8fc).("Basic strings...\n\n");
69
70 #define getvalcxx . . $ `utils/glcaps.c:70:13`!(x) printf(#x ": %s\n", pglGetString(x))
71
72 getvalcxx . . $ `utils/glcaps.c:70:13`!(GL_RENDERERcxx . . $ `<external>/11565930711847777359/gl.h:654:9`!);
73 getvalcxx . . $ `utils/glcaps.c:70:13`!(GL_VERSIONcxx . . $ `<external>/11565930711847777359/gl.h:655:9`!);
74 getvalcxx . . $ `utils/glcaps.c:70:13`!(GL_VENDORcxx . . $ `<external>/11565930711847777359/gl.h:653:9`!);
75
76 #undef getvalcxx . . $ `utils/glcaps.c:70:13`!
77
78 printfcxx . . $ printf(581fddd72a8db8fc).("\nExtensions...\n\n");
79
80 if (is_atleast_gl3cxx . . $ is_atleast_gl3(5c4306d8553b3696).((const char *) pglGetString(GL_VERSIONcxx . . $ `<external>/11565930711847777359/gl.h:655:9`!)))
81 {
82 GLintcxx . . $ GLint# i;
83 GLintcxx . . $ GLint# num_exts = 0;
84 pglGetIntegerv(GL_NUM_EXTENSIONScxx . . $ `GL/glext.h:517:9`!, &num_exts);
85 for (i = 0; i < num_exts; i++)
86 printfcxx . . $ printf(581fddd72a8db8fc).("%s\n", (const char *) pglGetStringi(GL_EXTENSIONScxx . . $ `<external>/11565930711847777359/gl.h:656:9`!, i));
87 }
88 else
89 {
90 const GLubytecxx . . $ GLubyte# *ext = pglGetString(GL_EXTENSIONScxx . . $ `<external>/11565930711847777359/gl.h:656:9`!);
91 while (*ext)
92 {
93 fputccxx . . $ fputc(b1cd03d6c470d1bd).((*ext == ' ') ? '\n' : ((int) *ext), stdoutcxx . . $ `<external>/232824719582829767/stdio.h:154:9`!);
94 ext++;
95 } // while
96
97 ext--;
98 if (*ext != ' ')
99 printfcxx . . $ printf(581fddd72a8db8fc).("\n");
100 }
101
102 printfcxx . . $ printf(581fddd72a8db8fc).("\nARB1 values...\n\n");
103
104 if (pglGetProgramivARB == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
105 printfcxx . . $ printf(581fddd72a8db8fc).(" (unsupported.)\n");
106 else
107 {
108 #define getvalcxx . . $ `utils/glcaps.c:108:17`!(x) \
109 val = -1; \
110 pglGetProgramivARB(GL_VERTEX_PROGRAM_ARBcxx . . $ `GL/glext.h:1384:9`!, x, &val); \
111 printf(#x ": %d\n", (int) val);
112
113 getvalcxx . . $ `utils/glcaps.c:108:17`!(GL_MAX_PROGRAM_INSTRUCTIONS_ARBcxx . . $ `GL/glext.h:1407:9`!);
114 getvalcxx . . $ `utils/glcaps.c:108:17`!(GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARBcxx . . $ `GL/glext.h:1409:9`!);
115 getvalcxx . . $ `utils/glcaps.c:108:17`!(GL_MAX_PROGRAM_TEMPORARIES_ARBcxx . . $ `GL/glext.h:1411:9`!);
116 getvalcxx . . $ `utils/glcaps.c:108:17`!(GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARBcxx . . $ `GL/glext.h:1413:9`!);
117 getvalcxx . . $ `utils/glcaps.c:108:17`!(GL_MAX_PROGRAM_PARAMETERS_ARBcxx . . $ `GL/glext.h:1415:9`!);
118 getvalcxx . . $ `utils/glcaps.c:108:17`!(GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARBcxx . . $ `GL/glext.h:1417:9`!);
119 getvalcxx . . $ `utils/glcaps.c:108:17`!(GL_MAX_PROGRAM_ATTRIBS_ARBcxx . . $ `GL/glext.h:1419:9`!);
120 getvalcxx . . $ `utils/glcaps.c:108:17`!(GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARBcxx . . $ `GL/glext.h:1421:9`!);
121 getvalcxx . . $ `utils/glcaps.c:108:17`!(GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARBcxx . . $ `GL/glext.h:1423:9`!);
122 getvalcxx . . $ `utils/glcaps.c:108:17`!(GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARBcxx . . $ `GL/glext.h:1425:9`!);
123 getvalcxx . . $ `utils/glcaps.c:108:17`!(GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARBcxx . . $ `GL/glext.h:1426:9`!);
124 getvalcxx . . $ `utils/glcaps.c:108:17`!(GL_MAX_PROGRAM_ENV_PARAMETERS_ARBcxx . . $ `GL/glext.h:1427:9`!);
125 getvalcxx . . $ `utils/glcaps.c:108:17`!(GL_MAX_PROGRAM_PARAMETERS_ARBcxx . . $ `GL/glext.h:1415:9`!);
126
127 #undef getvalcxx . . $ `utils/glcaps.c:108:17`!
128 } // else
129
130 printfcxx . . $ printf(581fddd72a8db8fc).("\nGLSL values...\n\n");
131
132 #define getvalcxx . . $ `utils/glcaps.c:132:13`!(x) \
133 val = -1; \
134 pglGetIntegerv(x, &val); \
135 printf(#x ": %d\n", (int) val);
136
137 str = (const char *) pglGetString(GL_SHADING_LANGUAGE_VERSION_ARBcxx . . $ `GL/glext.h:1578:9`!);
138 printfcxx . . $ printf(581fddd72a8db8fc).("GL_SHADING_LANGUAGE_VERSION_ARB: %s\n", str);
139 getvalcxx . . $ `utils/glcaps.c:132:13`!(GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARBcxx . . $ `GL/glext.h:1563:9`!);
140 getvalcxx . . $ `utils/glcaps.c:132:13`!(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARBcxx . . $ `GL/glext.h:1573:9`!);
141 getvalcxx . . $ `utils/glcaps.c:132:13`!(GL_MAX_VARYING_FLOATS_ARBcxx . . $ `GL/glext.h:1564:9`!);
142 getvalcxx . . $ `utils/glcaps.c:132:13`!(GL_MAX_VERTEX_ATTRIBS_ARBcxx . . $ `GL/glext.h:1401:9`!);
143 getvalcxx . . $ `utils/glcaps.c:132:13`!(GL_MAX_TEXTURE_IMAGE_UNITS_ARBcxx . . $ `GL/glext.h:1479:9`!);
144 getvalcxx . . $ `utils/glcaps.c:132:13`!(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARBcxx . . $ `GL/glext.h:1565:9`!);
145 getvalcxx . . $ `utils/glcaps.c:132:13`!(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARBcxx . . $ `GL/glext.h:1566:9`!);
146 getvalcxx . . $ `utils/glcaps.c:132:13`!(GL_MAX_TEXTURE_COORDS_ARBcxx . . $ `GL/glext.h:1478:9`!);
147
148 printfcxx . . $ printf(581fddd72a8db8fc).("\nGL_EXT_bindable_uniform values...\n\n");
149
150 getvalcxx . . $ `utils/glcaps.c:132:13`!(GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXTcxx . . $ `GL/glext.h:4750:9`!);
151 getvalcxx . . $ `utils/glcaps.c:132:13`!(GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXTcxx . . $ `GL/glext.h:4751:9`!);
152 getvalcxx . . $ `utils/glcaps.c:132:13`!(GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXTcxx . . $ `GL/glext.h:4752:9`!);
153 getvalcxx . . $ `utils/glcaps.c:132:13`!(GL_MAX_BINDABLE_UNIFORM_SIZE_EXTcxx . . $ `GL/glext.h:4753:9`!);
154
155 #undef getvalcxx . . $ `utils/glcaps.c:132:13`!
156
157 SDL_Quitcxx . . $ SDL_Quit(49f6e7a06ebc5aa8).();
158 printfcxx . . $ printf(581fddd72a8db8fc).("\n");
159
160 return 0;
161 }
162
163