Skip to content

Instantly share code, notes, and snippets.

@rosshinkley
Created June 25, 2016 23:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rosshinkley/b5fb5061073756e926b791a66d62b24b to your computer and use it in GitHub Desktop.
Save rosshinkley/b5fb5061073756e926b791a66d62b24b to your computer and use it in GitHub Desktop.
OpenGL max texture size
#include <stdlib.h>
#include <GL/glut.h>
#include <stdio.h>
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
glutInitWindowSize(400, 300);
glutCreateWindow("Hello World");
int max_texture_size = 0;
glGetIntegerv(0x0D33, &max_texture_size);
fprintf(stderr, "%u", max_texture_size);
glutMainLoop();
return 0;
}
GL_LIB = /usr/X11R6/lib
get-size: get-size.o
gcc -o get-size $^ -L$(GL_LIB) -lGL -lglut -lGLEW -lm
clean:
rm -f get-size get-size.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment