aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/pugl_cursor_demo.c2
-rw-r--r--examples/pugl_shader_demo.c2
-rw-r--r--examples/pugl_vulkan_cpp_demo.cpp8
-rw-r--r--examples/pugl_vulkan_demo.c26
4 files changed, 18 insertions, 20 deletions
diff --git a/examples/pugl_cursor_demo.c b/examples/pugl_cursor_demo.c
index ba9c54f..bc219f0 100644
--- a/examples/pugl_cursor_demo.c
+++ b/examples/pugl_cursor_demo.c
@@ -19,7 +19,7 @@ typedef struct {
} PuglTestApp;
static void
-onConfigure(const double width, const double height)
+onConfigure(const PuglSpan width, const PuglSpan height)
{
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
diff --git a/examples/pugl_shader_demo.c b/examples/pugl_shader_demo.c
index 2cdcb6e..4d6821a 100644
--- a/examples/pugl_shader_demo.c
+++ b/examples/pugl_shader_demo.c
@@ -75,7 +75,7 @@ static void
teardownGl(PuglTestApp* app);
static void
-onConfigure(PuglView* view, double width, double height)
+onConfigure(PuglView* view, PuglSpan width, PuglSpan height)
{
(void)view;
diff --git a/examples/pugl_vulkan_cpp_demo.cpp b/examples/pugl_vulkan_cpp_demo.cpp
index 5e30b88..fd93394 100644
--- a/examples/pugl_vulkan_cpp_demo.cpp
+++ b/examples/pugl_vulkan_cpp_demo.cpp
@@ -1512,11 +1512,9 @@ pugl::Status
View::onEvent(const pugl::ConfigureEvent& event)
{
// We just record the size here and lazily resize the surface when exposed
- _app.extent = {static_cast<uint32_t>(event.width),
- static_cast<uint32_t>(event.height)};
-
- _app.mode = (event.style & PUGL_VIEW_STYLE_RESIZING) ? RenderMode::resizing
- : RenderMode::normal;
+ _app.extent = {event.width, event.height};
+ _app.mode = (event.style & PUGL_VIEW_STYLE_RESIZING) ? RenderMode::resizing
+ : RenderMode::normal;
return pugl::Status::success;
}
diff --git a/examples/pugl_vulkan_demo.c b/examples/pugl_vulkan_demo.c
index 2f9eaff..35be97f 100644
--- a/examples/pugl_vulkan_demo.c
+++ b/examples/pugl_vulkan_demo.c
@@ -83,8 +83,8 @@ typedef struct {
PuglView* view;
VulkanState vk;
uint32_t framesDrawn;
- uint32_t width;
- uint32_t height;
+ PuglSpan width;
+ PuglSpan height;
bool quit;
} VulkanApp;
@@ -569,8 +569,8 @@ configureSurface(VulkanState* const vk)
static VkResult
createRawSwapchain(VulkanState* const vk,
- const uint32_t width,
- const uint32_t height)
+ const PuglSpan width,
+ const PuglSpan height)
{
VkSurfaceCapabilitiesKHR surfaceCapabilities;
VkResult vr = VK_SUCCESS;
@@ -583,12 +583,12 @@ createRawSwapchain(VulkanState* const vk,
/* There is a known race condition with window/surface sizes, so we clamp
to what Vulkan reports and hope for the best. */
- vk->swapchain->extent.width = CLAMP(width,
+ vk->swapchain->extent.width = CLAMP((uint32_t)width,
surfaceCapabilities.minImageExtent.width,
surfaceCapabilities.maxImageExtent.width);
vk->swapchain->extent.height =
- CLAMP(height,
+ CLAMP((uint32_t)height,
surfaceCapabilities.minImageExtent.height,
surfaceCapabilities.maxImageExtent.height);
@@ -707,8 +707,8 @@ recordCommandBuffers(VulkanState* const vk)
static VkResult
createSwapchain(VulkanState* const vk,
- const uint32_t width,
- const uint32_t height)
+ const PuglSpan width,
+ const PuglSpan height)
{
VkResult vr = VK_SUCCESS;
@@ -895,21 +895,21 @@ destroyWorld(VulkanApp* const app)
}
static PuglStatus
-onConfigure(PuglView* const view, const double width, const double height)
+onConfigure(PuglView* const view, const PuglSpan width, const PuglSpan height)
{
VulkanApp* const app = (VulkanApp*)puglGetHandle(view);
// We just record the size here and lazily resize the surface when exposed
- app->width = (uint32_t)width;
- app->height = (uint32_t)height;
+ app->width = width;
+ app->height = height;
return PUGL_SUCCESS;
}
static PuglStatus
recreateSwapchain(VulkanState* const vk,
- const uint32_t width,
- const uint32_t height)
+ const PuglSpan width,
+ const PuglSpan height)
{
vkDeviceWaitIdle(vk->device);
destroySwapchain(vk, vk->swapchain);