12 #include <GLFW/glfw3.h> 21 GLVersion::GLVersion() : major{1},
minor{0}
36 return (*
this < other) || (*
this == other);
44 return !(*
this == other);
48 return (*
this > other) || (*
this == other);
58 glfwDefaultWindowHints();
59 glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
60 GLFWwindow* context = glfwCreateWindow(1, 1,
"", NULL, NULL);
66 glfwMakeContextCurrent(context);
70 glewExperimental = GL_TRUE;
71 if (glewInit() != GLEW_OK) {
78 if (GLEW_VERSION_3_2) {
82 Logger::logError(
"OpenGL 3.2 is not supported, you may want to update your graphics driver.");
88 if (GLEW_ARB_vertex_buffer_object) {
96 if (GLEW_ARB_map_buffer_range) {
104 if (GLEW_ARB_vertex_array_object) {
112 if (GLEW_ARB_shader_objects) {
120 if (GLEW_ARB_vertex_shader) {
128 if (GLEW_ARB_fragment_shader) {
136 if (GLEW_ARB_framebuffer_object) {
144 glfwDestroyWindow(context);
static void logInfo(std::string message)
Logs an information string to cout.
static void logError(std::string message)
Logs an error string to cerr.
const int major
Constant for the major version.
const int minor
Constant for the minor version.
bool operator<(const GLVersion &other)
Overloaded less than operator.
Generic namespace for the SimpleGL framework.
bool operator>=(const GLVersion &other)
Overloaded greater than or equal to operator.
bool operator!=(const GLVersion &other)
Overloaded unequal to operator.
bool operator==(const GLVersion &other)
Overloaded equal to operator.
GLVersion()
Default constructor.
bool operator>(const GLVersion &other)
Overloaded greater than operator.
bool operator<=(const GLVersion &other)
Overloaded less than or equal to operator.
SIMPLEGL_GL_EXPORT GLVersion contextVersion
Stores the OpenGL version structure.
Structure for saving the OpenGL version.
SIMPLEGL_GL_EXPORT void initGL()
Initializes the OpenGL backend, this will also check available extensions and should be called after ...