File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#include < glatter/glatter.h>
22#include < stdio.h>
33
4+ // This test verifies the primary purpose of glatter: loading a modern,
5+ // dynamically-resolved OpenGL function.
6+ //
7+ // We use glGenBuffers because it is not an OpenGL 1.1
8+ // function and must be resolved by the loader's getProcAddress mechanism.
9+ //
10+ // We only need this code to COMPILE and LINK successfully in the CI.
11+ //
412int main () {
5- glatter_set_wsi (GLATTER_WSI_AUTO_VALUE);
6- printf (" Glatter integration test compiled and linked successfully.\n " );
7-
8- if (glatter_glGetString) {
9- printf (" A glatter function pointer is available.\n " );
10- }
13+ printf (" Attempting to link against a modern OpenGL function (glGenBuffers)...\n " );
14+
15+ // These are the arguments needed to call glGenBuffers.
16+ // Their values are irrelevant; they just need to satisfy the compiler.
17+ GLuint buffer_id = 0 ;
18+ GLsizei n = 1 ;
19+
20+ // This is the real test. If this line compiles and links, it proves
21+ // the glatter macro and the underlying function pointer resolution work.
22+ glGenBuffers (n, &buffer_id);
23+
24+ printf (" Glatter modern OpenGL call integration test built successfully.\n " );
1125
1226 return 0 ;
13- }
27+ }
You can’t perform that action at this time.
0 commit comments