Initial commit

This commit is contained in:
github-classroom[bot] 2024-11-29 09:50:03 +00:00 committed by GitHub
commit 686dcaf351
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
68 changed files with 6230 additions and 0 deletions

View file

@ -0,0 +1,21 @@
#ifndef PRINT_OPENGL_INFO_H
#define PRINT_OPENGL_INFO_H
// Use glfw to print information about the current opengl context
// Should be called after glfwMakeContextCurrent(...)
void print_opengl_info(GLFWwindow * window);
// Implementation
#include <cstdio>
void print_opengl_info(GLFWwindow * window)
{
int major, minor, rev;
major = glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MAJOR);
minor = glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MINOR);
rev = glfwGetWindowAttrib(window, GLFW_CONTEXT_REVISION);
printf("OpenGL version recieved: %d.%d.%d\n", major, minor, rev);
printf("Supported OpenGL is %s\n", (const char*)glGetString(GL_VERSION));
printf("Supported GLSL is %s\n", (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION));
}
#endif