fixes for vs

This commit is contained in:
Asuro
2025-02-08 02:21:52 +01:00
parent b263c3aa82
commit 14e923873a
4 changed files with 19 additions and 9 deletions

View File

@@ -9,6 +9,8 @@ namespace
void Log(const char *format, ...)
{
va_list args;
va_start(args, format);
bx::snprintf(LineBuffer, sizeof(LineBuffer), "%s\n", format);
bx::printf(LineBuffer, args);
bx::vprintf(LineBuffer, args);
va_end(args);
}

View File

@@ -83,7 +83,9 @@ namespace Game
filePath.join(fileName);
bx::FileReader fileReader;
bgfx::ShaderHandle result = bgfx::createShader(loadMem(&fileReader, filePath.getCPtr()));
const bgfx::Memory* mem = loadMem(&fileReader, filePath.getCPtr());
if (mem == nullptr) return {};
bgfx::ShaderHandle result = bgfx::createShader(mem);
return result;
}
}
@@ -97,8 +99,8 @@ namespace Game
init.platformData.nwh = (void*)window;
init.platformData.ndt = nullptr;
init.platformData.type = bgfx::NativeWindowHandleType::Default;
init.resolution.width = 1920;
init.resolution.height = 1080;
init.resolution.width = State.WindowWidth;
init.resolution.height = State.WindowHeight;
init.resolution.reset = BGFX_RESET_VSYNC;
if (!bgfx::init(init))
{
@@ -173,7 +175,6 @@ namespace Game
bgfx::setIndexBuffer(IndexBuffer);
bgfx::setState(state);
// Submit primitive for rendering to view 0.
bgfx::submit(0, Shader);
}
bgfx::dbgTextPrintf(1, 1, 0x0F, "Time: %f", time);