diff options
| author | hachem <im@hachem.wtf> | 2025-08-13 18:39:13 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2025-08-13 18:39:13 +0200 |
| commit | 8a0b2a59c9809d5fc8e6a30c2abc4d5af21aa39e (patch) | |
| tree | 41adf621418b790100d207c1534236945b431d1e /src/Platform/OpenGL/OpenGLRendererAPI.cpp | |
| parent | f1517709556827fb8b7bab00bdee4a9794d88dd1 (diff) | |
[fix]: More consistent formatting
Diffstat (limited to 'src/Platform/OpenGL/OpenGLRendererAPI.cpp')
| -rw-r--r-- | src/Platform/OpenGL/OpenGLRendererAPI.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Platform/OpenGL/OpenGLRendererAPI.cpp b/src/Platform/OpenGL/OpenGLRendererAPI.cpp index 5ee7d8d..7957fa0 100644 --- a/src/Platform/OpenGL/OpenGLRendererAPI.cpp +++ b/src/Platform/OpenGL/OpenGLRendererAPI.cpp @@ -1,10 +1,24 @@ #include "OpenGLRendererAPI.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); |
