projects
/
test_compression
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4000d85
)
added check for compressed format support (ARB_internalformat_query2.txt)
author
Eleni Maria Stea
<estea@igalia.com>
Fri, 4 May 2018 17:46:31 +0000
(20:46 +0300)
committer
Eleni Maria Stea
<estea@igalia.com>
Fri, 4 May 2018 17:46:31 +0000
(20:46 +0300)
Makefile
patch
|
blob
|
history
main.c
patch
|
blob
|
history
diff --git
a/Makefile
b/Makefile
index
84363ff
..
cd3d9e2
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-2,7
+2,7
@@
obj = main.o
bin = test
CFLAGS = -pedantic -Wall -g
bin = test
CFLAGS = -pedantic -Wall -g
-LDFLAGS = -lGL -lglut
+LDFLAGS = -lGLEW -lGL -lglut
$(bin): $(obj)
$(CC) -o $@ $(obj) $(LDFLAGS)
$(bin): $(obj)
$(CC) -o $@ $(obj) $(LDFLAGS)
diff --git
a/main.c
b/main.c
index
32da284
..
a023307
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-3,6
+3,7
@@
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
+#include <GL/glew.h>
#include <GL/freeglut.h>
#undef USE_SRGB
#include <GL/freeglut.h>
#undef USE_SRGB
@@
-45,6
+46,8
@@
int main(int argc, char **argv)
glutReshapeFunc(reshape);
glutKeyboardFunc(keyb);
glutReshapeFunc(reshape);
glutKeyboardFunc(keyb);
+ glewInit();
+
if(init() == -1) {
return 1;
}
if(init() == -1) {
return 1;
}
@@
-353,7
+356,11
@@
void print_compressed_formats(void)
glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, fmtlist);
for(i=0; i<num_fmt; i++) {
glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, fmtlist);
for(i=0; i<num_fmt; i++) {
+ printf("\n");
printf(" %05x: %s\n", fmtlist[i], fmtstr(fmtlist[i]));
printf(" %05x: %s\n", fmtlist[i], fmtstr(fmtlist[i]));
+ GLint params;
+ glGetInternalformativ(GL_TEXTURE_2D, fmtlist[i], GL_TEXTURE_COMPRESSED, 1, ¶ms);
+ printf("the format is %s\n", params == GL_TRUE ? "compressed" : "not compressed");
}
free(fmtlist);
}
}
free(fmtlist);
}