From 23086a5d33acc66414f1169bf22abe78b3383f94 Mon Sep 17 00:00:00 2001 From: hachem Date: Wed, 13 Aug 2025 18:39:13 +0200 Subject: fix: more consistent formatting --- src/platform/opengl/opengl_renderer_api.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/platform/opengl/opengl_renderer_api.cpp') 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 +#include +#include 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); -- cgit v1.3