some fixes
This commit is contained in:
@@ -205,8 +205,10 @@ namespace Game
|
||||
init.platformData.type = bgfx::NativeWindowHandleType::Default;
|
||||
init.resolution.width = shared.Window.WindowWidth;
|
||||
init.resolution.height = shared.Window.WindowHeight;
|
||||
init.resolution.reset = BGFX_RESET_VSYNC;
|
||||
init.resolution.reset = ResetFlags;
|
||||
|
||||
LastWidth = shared.Window.WindowWidth;
|
||||
LastHeight = shared.Window.WindowHeight;
|
||||
Log("%i by %i", init.resolution.width, init.resolution.height);
|
||||
|
||||
if (!bgfx::init(init))
|
||||
@@ -217,7 +219,7 @@ namespace Game
|
||||
{
|
||||
Log("BGFX setup succeded!");
|
||||
}
|
||||
bgfx::setDebug(BGFX_DEBUG_TEXT);
|
||||
// bgfx::setDebug(BGFX_DEBUG_TEXT);
|
||||
bgfx::setViewClear(0, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH, 0x303030ff, 1.0f, 0);
|
||||
|
||||
DefaultSampler = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler);
|
||||
@@ -263,7 +265,8 @@ namespace Game
|
||||
|
||||
ImGui_ImplSDL3_NewFrame();
|
||||
imguiBeginFrame(0, 0, 0, 0, shared.Window.WindowWidth, shared.Window.WindowHeight);
|
||||
ImGui::DockSpaceOverViewport();
|
||||
// TODO: why does this break stuff??
|
||||
// ImGui::DockSpaceOverViewport();
|
||||
ImGui::ShowDemoWindow();
|
||||
|
||||
// Reload shaders if necessary
|
||||
@@ -289,6 +292,13 @@ namespace Game
|
||||
}
|
||||
}
|
||||
}
|
||||
if (shared.Window.WindowWidth != LastWidth || shared.Window.WindowHeight != LastHeight)
|
||||
{
|
||||
bgfx::reset(shared.Window.WindowWidth, shared.Window.WindowHeight, ResetFlags);
|
||||
|
||||
LastWidth = shared.Window.WindowWidth;
|
||||
LastHeight = shared.Window.WindowHeight;
|
||||
}
|
||||
|
||||
{
|
||||
GetInstance().GameLevel.Update();
|
||||
|
||||
Reference in New Issue
Block a user