Skip to content

Commit dbbca29

Browse files
committed
updated the test with something more useful
1 parent 57277bf commit dbbca29

1 file changed

Lines changed: 21 additions & 7 deletions

File tree

tests/main.cpp

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
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+
//
412
int 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+
}

0 commit comments

Comments
 (0)