Fixed compilation with MSVC.

This commit is contained in:
Patrick 2024-09-16 10:11:42 +02:00
parent 6768be18f0
commit 2819104b6a
3 changed files with 7 additions and 7 deletions

View File

@ -128,7 +128,7 @@ void TexturedQuadApp::update(const AppUpdateArgs& args)
renderPass.bindFragmentSampler({.texture = mTexture, .sampler = mSampler}); renderPass.bindFragmentSampler({.texture = mTexture, .sampler = mSampler});
renderPass.bindGraphicsPipeline(mPipeline); renderPass.bindGraphicsPipeline(mPipeline);
renderPass.bindVertexBuffer({.buffer = mVertexBuffer}); renderPass.bindVertexBuffer({.buffer = mVertexBuffer});
renderPass.drawPrimitives({.numVertices = VERTICES.size()}); renderPass.drawPrimitives({.numVertices = static_cast<Uint32>(VERTICES.size())});
renderPass.end(); renderPass.end();
cmdBuffer.submit(); cmdBuffer.submit();
} }

View File

@ -49,13 +49,13 @@ void Application::update(const AppUpdateArgs&)
void Application::run(std::span<const char*> args) void Application::run(std::span<const char*> args)
{ {
using clock_t = std::chrono::steady_clock; using app_clock_t = std::chrono::steady_clock;
init({ init({
.programArgs = args .programArgs = args
}); });
const clock_t::time_point startTime = clock_t::now(); const app_clock_t::time_point startTime = app_clock_t::now();
clock_t::time_point lastFrameTime = startTime; app_clock_t::time_point lastFrameTime = startTime;
while (mRunning) while (mRunning)
{ {
std::optional<sdlpp::sdl_event_t> event; std::optional<sdlpp::sdl_event_t> event;
@ -71,7 +71,7 @@ void Application::run(std::span<const char*> args)
}, *event); }, *event);
} }
const clock_t::time_point frameTime = clock_t::now(); const app_clock_t::time_point frameTime = app_clock_t::now();
update({ update({
.secondsSinceStart = std::chrono::duration_cast<std::chrono::duration<float>>(frameTime - startTime).count(), .secondsSinceStart = std::chrono::duration_cast<std::chrono::duration<float>>(frameTime - startTime).count(),
.tickSeconds = std::chrono::duration_cast<std::chrono::duration<float>>(frameTime - lastFrameTime).count() .tickSeconds = std::chrono::duration_cast<std::chrono::duration<float>>(frameTime - lastFrameTime).count()

View File

@ -849,7 +849,7 @@ public:
/* command_buffer = */ mHandle, /* command_buffer = */ mHandle,
/* slot_index = */ slotIndex, /* slot_index = */ slotIndex,
/* data = */ data.data(), /* data = */ data.data(),
/* length = */ data.size_bytes() /* length = */ static_cast<Uint32>(data.size_bytes())
); );
} }
@ -860,7 +860,7 @@ public:
/* command_buffer = */ mHandle, /* command_buffer = */ mHandle,
/* slot_index = */ slotIndex, /* slot_index = */ slotIndex,
/* data = */ data.data(), /* data = */ data.data(),
/* length = */ data.size_bytes() /* length = */ static_cast<Uint32>(data.size_bytes())
); );
} }