summaryrefslogtreecommitdiff
path: root/src/vk
diff options
context:
space:
mode:
authorFrederico Linhares <fred@linhares.blue>2022-10-10 16:13:12 -0300
committerFrederico Linhares <fred@linhares.blue>2022-10-10 16:15:09 -0300
commit9d6d723846d737b0bcc6b51afefcf313f723dcd0 (patch)
treed4b6ea5556fc9c56e28ea01ffe8375bee0a464bb /src/vk
parent63d7d305da643ec20fed3cdd60c4daec29272c41 (diff)
feat Move configuration from YAML file to game
Diffstat (limited to 'src/vk')
-rw-r--r--src/vk/graphics_pipeline_2d.cpp10
-rw-r--r--src/vk/graphics_pipeline_3d.cpp14
-rw-r--r--src/vk/renderer.cpp8
-rw-r--r--src/vk/swapchain.cpp2
4 files changed, 17 insertions, 17 deletions
diff --git a/src/vk/graphics_pipeline_2d.cpp b/src/vk/graphics_pipeline_2d.cpp
index 1509d2f..734a509 100644
--- a/src/vk/graphics_pipeline_2d.cpp
+++ b/src/vk/graphics_pipeline_2d.cpp
@@ -42,8 +42,8 @@ load_framebuffer(void *obj)
cg_core.vk_graphics_pipeline_2d_layout->render_pass;
framebuffer_info.attachmentCount = attachments.size();
framebuffer_info.pAttachments = attachments.data();
- framebuffer_info.width = cg_core.screen_width;
- framebuffer_info.height = cg_core.screen_height;
+ framebuffer_info.width = cg_core.display_width;
+ framebuffer_info.height = cg_core.display_height;
framebuffer_info.layers = 1;
if(vkCreateFramebuffer(
@@ -130,14 +130,14 @@ load_pipeline(void *obj)
VkViewport viewport = {};
viewport.x = 0;
viewport.y = 0;
- viewport.width = cg_core.screen_width;
- viewport.height = cg_core.screen_height;
+ viewport.width = cg_core.display_width;
+ viewport.height = cg_core.display_height;
viewport.minDepth = 0.0f;
viewport.maxDepth = 1.0f;
VkRect2D scissor = {};
scissor.offset = {0, 0};
- scissor.extent = {cg_core.screen_width, cg_core.screen_height};
+ scissor.extent = {cg_core.display_width, cg_core.display_height};
VkPipelineViewportStateCreateInfo viewport_state = {};
viewport_state.sType =
diff --git a/src/vk/graphics_pipeline_3d.cpp b/src/vk/graphics_pipeline_3d.cpp
index f3a54e7..f08e43a 100644
--- a/src/vk/graphics_pipeline_3d.cpp
+++ b/src/vk/graphics_pipeline_3d.cpp
@@ -187,8 +187,8 @@ load_depth_image(void *obj)
auto self = static_cast<VK::GraphicsPipeline3D*>(obj);
VkExtent3D extent3d{};
- extent3d.width = cg_core.screen_width;
- extent3d.height = cg_core.screen_height;
+ extent3d.width = cg_core.display_width;
+ extent3d.height = cg_core.display_height;
extent3d.depth = 1;
try
@@ -273,8 +273,8 @@ load_framebuffer(void *obj)
cg_core.vk_graphics_pipeline_3d_layout->render_pass;
framebuffer_info.attachmentCount = attachments.size();
framebuffer_info.pAttachments = attachments.data();
- framebuffer_info.width = cg_core.screen_width;
- framebuffer_info.height = cg_core.screen_height;
+ framebuffer_info.width = cg_core.display_width;
+ framebuffer_info.height = cg_core.display_height;
framebuffer_info.layers = 1;
@@ -371,14 +371,14 @@ load_pipeline(void *obj)
VkViewport viewport = {};
viewport.x = 0;
viewport.y = 0;
- viewport.width = cg_core.screen_width;
- viewport.height = cg_core.screen_height;
+ viewport.width = cg_core.display_width;
+ viewport.height = cg_core.display_height;
viewport.minDepth = 0.0f;
viewport.maxDepth = 1.0f;
VkRect2D scissor = {};
scissor.offset = {0, 0};
- scissor.extent = {cg_core.screen_width, cg_core.screen_height};
+ scissor.extent = {cg_core.display_width, cg_core.display_height};
VkPipelineViewportStateCreateInfo viewport_state = {};
viewport_state.sType =
diff --git a/src/vk/renderer.cpp b/src/vk/renderer.cpp
index 5ebc271..7492cce 100644
--- a/src/vk/renderer.cpp
+++ b/src/vk/renderer.cpp
@@ -212,8 +212,8 @@ Renderer::draw()
cg_core.vk_graphics_pipeline_3d->swapchain_framebuffers[image_index];
render_pass_begin.renderArea.offset = {0, 0};
render_pass_begin.renderArea.extent = {
- static_cast<uint32_t>(cg_core.screen_width),
- static_cast<uint32_t>(cg_core.screen_height)};
+ static_cast<uint32_t>(cg_core.display_width),
+ static_cast<uint32_t>(cg_core.display_height)};
render_pass_begin.clearValueCount = clear_values.size();
render_pass_begin.pClearValues = clear_values.data();
@@ -239,8 +239,8 @@ Renderer::draw()
cg_core.vk_graphics_pipeline_2d->swapchain_framebuffers[image_index];
render_pass_begin.renderArea.offset = {0, 0};
render_pass_begin.renderArea.extent = {
- static_cast<uint32_t>(cg_core.screen_width),
- static_cast<uint32_t>(cg_core.screen_height)};
+ static_cast<uint32_t>(cg_core.display_width),
+ static_cast<uint32_t>(cg_core.display_height)};
render_pass_begin.clearValueCount = 0;
render_pass_begin.pClearValues = nullptr;
diff --git a/src/vk/swapchain.cpp b/src/vk/swapchain.cpp
index 1dd19d9..2c67ebd 100644
--- a/src/vk/swapchain.cpp
+++ b/src/vk/swapchain.cpp
@@ -51,7 +51,7 @@ load_swapchain(void *obj)
swapchain_create_info.imageColorSpace = vk_surface_formats[0].colorSpace;
swapchain_create_info.imageExtent = {
- cg_core.screen_width, cg_core.screen_height};
+ cg_core.display_width, cg_core.display_height};
swapchain_create_info.imageArrayLayers = 1;
swapchain_create_info.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
swapchain_create_info.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE;