From d195c0e39051204f1fe146b825087c5a0c5ec3ca Mon Sep 17 00:00:00 2001 From: John McCardle Date: Sat, 7 Feb 2026 20:15:43 -0500 Subject: [PATCH] Add warning when RenderTexture creation fails, closes #227 Previously enableRenderTexture() silently failed. Now emits a stderr warning with the requested dimensions, consistent with the engine's logging pattern. Co-Authored-By: Claude Opus 4.6 --- src/UIDrawable.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/UIDrawable.cpp b/src/UIDrawable.cpp index 996e1bf..346364a 100644 --- a/src/UIDrawable.cpp +++ b/src/UIDrawable.cpp @@ -1,4 +1,5 @@ #include "UIDrawable.h" +#include #include "UIFrame.h" #include "UICaption.h" #include "UISprite.h" @@ -428,6 +429,8 @@ void UIDrawable::enableRenderTexture(unsigned int width, unsigned int height) { if (!render_texture || render_texture->getSize().x != width || render_texture->getSize().y != height) { render_texture = std::make_unique(); if (!render_texture->create(width, height)) { + std::cerr << "[McRogueFace] Warning: Failed to create RenderTexture (" + << width << "x" << height << ")" << std::endl; render_texture.reset(); use_render_texture = false; return;