Hubris Engine
Dev
A Project to learn and get into Game Engine developement.
Loading...
Searching...
No Matches
GLPlatform.cpp
Go to the documentation of this file.
1
#include "
pch.h
"
2
#include "
Core/Graphics/GL/GLPlatform.h
"
3
#include <glad/glad.h>
4
#include <GLFW/glfw3.h>
5
6
7
Hubris::ErrorCode
Hubris::Graphics::GL::GLPlatform::InitGL
()
8
{
9
Logger::Log
(
"OpenGL Backend init started"
);
10
if
(!gladLoadGL()){
11
Logger::Fatal
(
"Failed to load GLAD"
);
12
return
ErrorCode::NOT_INITIALIZED
|
ErrorCode::RUNTIME_ERROR
;
13
}
14
Logger::Log
(
"GLAD loaded successfully"
);
15
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
16
glfwInitHint(GLFW_VERSION_MAJOR, 4);
17
glfwInitHint(GLFW_VERSION_MINOR, 6);
18
19
if
(glfwInit() == GLFW_FALSE){
20
Logger::Log
(
"Failed to initalize GLFW"
);
21
return
ErrorCode::NOT_INITIALIZED
|
ErrorCode::RUNTIME_ERROR
;
22
}
23
Logger::Log
(
"GLFW successfully initalized"
);
24
Logger::Log
(
"OpenGL Backend initalized."
);
25
return
ErrorCode::OK
;
26
}
GLPlatform.h
Hubris::Graphics::GL::GLPlatform::InitGL
ErrorCode InitGL()
Definition
GLPlatform.cpp:7
Hubris::Logger::Log
static void Log(const char *message)
Definition
Logger.h:104
Hubris::Logger::Fatal
static void Fatal(fmt::format_string< Args... > message, Args &&... args)
Definition
Logger.h:147
Hubris::ErrorCode
ErrorCode
Definition
Error.h:6
Hubris::ErrorCode::NOT_INITIALIZED
@ NOT_INITIALIZED
Definition
Error.h:8
Hubris::ErrorCode::RUNTIME_ERROR
@ RUNTIME_ERROR
Definition
Error.h:19
Hubris::ErrorCode::OK
@ OK
Definition
Error.h:7
pch.h
src
Core
Graphics
GL
GLPlatform.cpp
Generated by
1.13.2