#include #include #include #include #define SCRW 512 #define SCRH 288 #define TITLE "Max texture size" int main(void) { if (!glfwInit()) { fprintf(stderr, "Failed to initialize GLFW\n"); exit(EXIT_FAILURE); } glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 1); // set OpenGL 1.1 glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1); GLFWwindow *window = glfwCreateWindow(SCRW, SCRH, TITLE, NULL, NULL); if (!window) { fprintf(stderr, "Failed to open GLFW window\n"); glfwTerminate(); exit(EXIT_FAILURE); } glfwMakeContextCurrent(window); // get max texture size GLint maxTextureSize; glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize); printf("Max Texture Size (width/height): %d\n", maxTextureSize); // save max texture size to log.txt FILE *fp; fp = fopen("log.txt", "w"); if (fp != NULL) { fprintf(fp, "Max Texture Size (width/height): %d\n", maxTextureSize); fclose(fp); } // main loop while (!glfwWindowShouldClose(window)) { // render glClearColor(0.2, 0.4, 0.8, 0.0); glClear(GL_COLOR_BUFFER_BIT); glfwSwapBuffers(window); glfwPollEvents(); } glfwDestroyWindow(window); glfwTerminate(); exit(EXIT_SUCCESS); }