NoJobEngine
2.0.7
Toggle main menu visibility
Loading...
Searching...
No Matches
OpenGLContext.cpp
Go to the documentation of this file.
1
#include "
Engine/Platform/OpenGL/OpenGLContext.h
"
2
#include <glad/gl.h>
3
#include <GLFW/glfw3.h>
4
#include <iostream>
5
#include <stdexcept>
6
7
namespace
NoJob
{
8
void
OpenGLContext::Init
(GLFWwindow* window) {
9
glfwMakeContextCurrent(window);
10
11
const
int
version = gladLoadGL(
12
reinterpret_cast<
GLADloadfunc
>
(glfwGetProcAddress));
13
14
if
(version == 0)
15
throw
std::runtime_error(
"NoJobEngine: GLAD failed to load OpenGL."
);
16
17
std::cout <<
"NoJobEngine OpenGL context\n"
18
<<
"Vendor: "
<< glGetString(GL_VENDOR) <<
'\n'
19
<<
"Renderer: "
<< glGetString(GL_RENDERER) <<
'\n'
20
<<
"Version: "
<< glGetString(GL_VERSION) <<
'\n'
;
21
}
22
}
OpenGLContext.h
OpenGLContext declarations for the OpenGL Backend subsystem.
NoJob::OpenGLContext::Init
static void Init(GLFWwindow *window)
Definition
OpenGLContext.cpp:8
NoJob
Definition
BTActionNode.h:13
Engine
Platform
OpenGL
OpenGLContext.cpp
Generated by
1.18.0