Using WindowManager to begin and end frame

This commit is contained in:
2025-12-19 22:47:18 +08:00
parent c8ab71738a
commit 96b005e2ef
9 changed files with 19 additions and 11 deletions

View File

@@ -36,7 +36,7 @@ TTF_Font* FontManager::loadFont(const std::string& fontID, int ptSize) {
// 字体加载失败,抛出异常
throw std::runtime_error("无法加载字体: " + fontID);
}
TTF_SetFontHinting(font, TTF_HINTING_MONO); // 单色渲染,不抗锯齿
// 将新加载的字体存入缓存
m_fonts[key] = font;
return font;

View File

@@ -91,7 +91,7 @@ TextRenderer::CachedText TextRenderer::createAndCacheTexture(const std::string&
SDL_Log("错误:无法创建纹理\n");
return result;
}
SDL_SetTextureScaleMode(texture, SDL_SCALEMODE_NEAREST);
// 保存结果
result.texture = texture;
result.width = width;