light/Engine/src/Platform/GraphicsAPI/OpenGL/glGraphicsContext.cpp

31 lines
904 B
C++
Raw Normal View History

2021-05-26 18:39:40 +04:30
#include "ltpch.h"
#include "glGraphicsContext.h"
2021-05-27 18:55:30 +04:30
// Required for forward declaration
2021-05-30 16:45:54 +04:30
#include "Graphics/Renderer.h"
2021-05-27 18:55:30 +04:30
#include "Graphics/RenderCommand.h"
2021-05-30 16:45:54 +04:30
#include "Graphics/Shader.h"
#include "Graphics/Buffers.h"
#include "Graphics/VertexLayout.h"
2021-05-27 18:55:30 +04:30
#include "UserInterface/UserInterface.h"
2021-05-26 18:39:40 +04:30
#include <glad/glad.h>
2021-05-30 16:45:54 +04:30
#include <glfw/glfw3.h>
2021-05-26 18:39:40 +04:30
namespace Light {
glGraphicsContext::glGraphicsContext(GLFWwindow* windowHandle)
: m_WindowHandle(windowHandle)
{
m_GraphicsAPI = GraphicsAPI::OpenGL;
glfwMakeContextCurrent(windowHandle);
2021-05-27 19:54:05 +04:30
LT_ENGINE_ASSERT(gladLoadGLLoader((GLADloadproc)glfwGetProcAddress),
"glGraphicsContext::glGraphicsContext: gladLoadGLLoader: failed to initialize opengl context");
2021-05-26 18:39:40 +04:30
LT_ENGINE_INFO("glGraphicsContext:");
LT_ENGINE_INFO(" Renderer: {}", glGetString(GL_RENDERER));
LT_ENGINE_INFO(" Version: {}", glGetString(GL_VERSION));
}
}