Initial commit
This commit is contained in:
commit
686dcaf351
68 changed files with 6230 additions and 0 deletions
21
include/print_opengl_info.h
Normal file
21
include/print_opengl_info.h
Normal 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
|
Reference in a new issue