hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/src/platform/opengl/opengl_renderer_api.cpp
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2025-08-13 18:39:13 +0200
committerhachem <im@hachem.wtf>2025-08-13 18:39:13 +0200
commit23086a5d33acc66414f1169bf22abe78b3383f94 (patch)
treea895c3e3ab8074118a84aada97ea990b60fba556 /src/platform/opengl/opengl_renderer_api.cpp
parent2d8f706efe6e0a02b3238c2f22e7cdce620e9807 (diff)
fix: more consistent formatting
Diffstat (limited to 'src/platform/opengl/opengl_renderer_api.cpp')
-rw-r--r--src/platform/opengl/opengl_renderer_api.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/platform/opengl/opengl_renderer_api.cpp b/src/platform/opengl/opengl_renderer_api.cpp
index 3a147b9..1d41735 100644
--- a/src/platform/opengl/opengl_renderer_api.cpp
+++ b/src/platform/opengl/opengl_renderer_api.cpp
@@ -1,10 +1,24 @@
#include "opengl_renderer_api.h"
#include <glad/glad.h>
+#include <GLFW/glfw3.h>
+#include <iostream>
namespace Donut
{
void OpenGLRendererAPI::init()
{
+ if (!glfwGetCurrentContext())
+ {
+ std::cout << "No OpenGL context is current! Cannot initialize GLAD." << std::endl;
+ return;
+ }
+
+ if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress))
+ {
+ std::cout << "Failed to initialize GLAD!" << std::endl;
+ return;
+ }
+
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_DEPTH_TEST);