3D viewport, milestone 1

This commit is contained in:
John McCardle 2026-02-04 13:33:14 -05:00
commit e277663ba0
27 changed files with 7389 additions and 8 deletions

View file

@ -7,6 +7,7 @@
#include "Animation.h"
#include "Timer.h"
#include "BenchmarkLogger.h"
#include "platform/GLContext.h"
// ImGui is only available for SFML builds (not headless, not SDL2)
#if !defined(MCRF_HEADLESS) && !defined(MCRF_SDL2)
#include "imgui.h"
@ -87,6 +88,12 @@ GameEngine::GameEngine(const McRogueFaceConfig& cfg)
window->setFramerateLimit(60);
render_target = window.get();
// Initialize OpenGL function pointers via GLAD for 3D rendering
if (!mcrf::gl::initGL()) {
// Non-fatal: 3D features will be unavailable but 2D still works
fprintf(stderr, "Warning: OpenGL initialization failed. 3D features disabled.\n");
}
#if !defined(MCRF_HEADLESS) && !defined(MCRF_SDL2)
// Initialize ImGui for the window (SFML builds only)
if (ImGui::SFML::Init(*window)) {