summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-01-08 22:26:07 -0500
committerJonathan Bradley <jcb@pikum.xyz>2025-01-08 22:26:07 -0500
commit5845642965a1eebaec3a1d1126445ecb459688b8 (patch)
treed3c54bec229ac4dcf7c4af349e0383130a041752 /src
parentb2548ba4ce295fcd94a50123fb543fac2ef2bc33 (diff)
first-pass replace cmake with make
Diffstat (limited to 'src')
-rw-r--r--src/asset-manager.cpp2
-rw-r--r--src/player-input.hpp4
-rw-r--r--src/window.cpp66
3 files changed, 37 insertions, 35 deletions
diff --git a/src/asset-manager.cpp b/src/asset-manager.cpp
index 2784b1e..fc24a48 100644
--- a/src/asset-manager.cpp
+++ b/src/asset-manager.cpp
@@ -27,7 +27,7 @@ void AM_Init() {
assetThreadPool = PkeThreads_Init(2, 255);
AM_Register(EngineDefinedAssets[0], PKE_ASSET_TYPE_SHADER, "assets/shaders/present.vert.spv");
AM_Register(EngineDefinedAssets[1], PKE_ASSET_TYPE_SHADER, "assets/shaders/present.frag.spv");
- AM_Register(EngineDefinedAssets[2], PKE_ASSET_TYPE_SHADER, "assets/shaders/vert.vert.spv");
+ AM_Register(EngineDefinedAssets[2], PKE_ASSET_TYPE_SHADER, "assets/shaders/vertex.vert.spv");
AM_Register(EngineDefinedAssets[3], PKE_ASSET_TYPE_SHADER, "assets/shaders/texture.frag.spv");
}
diff --git a/src/player-input.hpp b/src/player-input.hpp
index e3d3501..392e675 100644
--- a/src/player-input.hpp
+++ b/src/player-input.hpp
@@ -104,9 +104,7 @@ struct PkeInputAction {
const char *name;
union {
PkeInputEventMask masks[PKE_INPUT_ACTION_MASK_COUNT] = {{}};
- struct {
- PkeInputEventMask primaryHash;
- };
+ PkeInputEventMask primaryHash;
};
int32_t eventIndex;
};
diff --git a/src/window.cpp b/src/window.cpp
index c7963eb..1be148f 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1,3 +1,4 @@
+#include "backends/imgui_impl_vulkan.h"
#include "math-helpers.hpp"
#include "static/missing-texture.hpp"
#define GLFW_INCLUDE_NONE
@@ -2263,52 +2264,55 @@ void CreateImGui() {
vkCreateDescriptorPool(vkDevice, &descriptorPoolCreateInfo, vkAllocator, &imGuiDescriptorPool);
ImGui_ImplGlfw_InitForVulkan(window, true);
- ImGui_ImplVulkan_InitInfo initInfo;
+ ImGui_ImplVulkan_InitInfo initInfo = {};
initInfo.Allocator = vkAllocator;
initInfo.CheckVkResultFn = ImGuiCheckVkResult;
- initInfo.ColorAttachmentFormat = VkFormat::VK_FORMAT_B8G8R8A8_SRGB;
+ // initInfo.ColorAttachmentFormat = VkFormat::VK_FORMAT_B8G8R8A8_SRGB;
initInfo.DescriptorPool = imGuiDescriptorPool;
initInfo.Device = vkDevice;
- initInfo.Instance = vkInstance;
initInfo.ImageCount = MAX_FRAMES_IN_FLIGHT;
- initInfo.MinImageCount = MAX_FRAMES_IN_FLIGHT;
+ initInfo.Instance = vkInstance;
initInfo.MSAASamples = VK_SAMPLE_COUNT_1_BIT;
+ initInfo.MinImageCount = MAX_FRAMES_IN_FLIGHT;
initInfo.PhysicalDevice = vkPhysicalDevice;
initInfo.PipelineCache = {};
initInfo.Queue = graphicsQueue;
initInfo.QueueFamily = graphicsFamilyIndex;
+ initInfo.RenderPass = presentRenderPass;
initInfo.Subpass = 0;
initInfo.UseDynamicRendering = false;
- ImGui_ImplVulkan_Init(&initInfo, presentRenderPass);
+ ImGui_ImplVulkan_Init(&initInfo);
// font
- {
- VkCommandBufferBeginInfo begInfo;
- begInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
- begInfo.pNext = nullptr;
- begInfo.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
- begInfo.pInheritanceInfo = {};
- vkBeginCommandBuffer(presentCommandBuffers[0], &begInfo);
-
- ImGui_ImplVulkan_CreateFontsTexture(presentCommandBuffers[0]);
-
- vkEndCommandBuffer(presentCommandBuffers[0]);
-
- VkSubmitInfo submitInfo;
- submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
- submitInfo.pNext = nullptr;
- submitInfo.waitSemaphoreCount = 0;
- submitInfo.pWaitSemaphores = nullptr;
- submitInfo.pWaitDstStageMask = nullptr;
- submitInfo.commandBufferCount = 1;
- submitInfo.pCommandBuffers = presentCommandBuffers;
- submitInfo.signalSemaphoreCount = 0;
- submitInfo.pSignalSemaphores = nullptr;
- vkQueueSubmit(graphicsQueue, 1, &submitInfo, nullptr);
- vkQueueWaitIdle(graphicsQueue);
- }
- ImGui_ImplVulkan_DestroyFontUploadObjects();
+ // {
+ // VkCommandBufferBeginInfo begInfo;
+ // begInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
+ // begInfo.pNext = nullptr;
+ // begInfo.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
+ // begInfo.pInheritanceInfo = {};
+ // vkBeginCommandBuffer(presentCommandBuffers[0], &begInfo);
+
+ // ImGui_ImplVulkan_CreateFontsTexture();
+ // ImGui_ImplVulkan_CreateFontsTexture(presentCommandBuffers[0]);
+
+ // vkEndCommandBuffer(presentCommandBuffers[0]);
+
+ // VkSubmitInfo submitInfo;
+ // submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
+ // submitInfo.pNext = nullptr;
+ // submitInfo.waitSemaphoreCount = 0;
+ // submitInfo.pWaitSemaphores = nullptr;
+ // submitInfo.pWaitDstStageMask = nullptr;
+ // submitInfo.commandBufferCount = 1;
+ // submitInfo.pCommandBuffers = presentCommandBuffers;
+ // submitInfo.signalSemaphoreCount = 0;
+ // submitInfo.pSignalSemaphores = nullptr;
+ // vkQueueSubmit(graphicsQueue, 1, &submitInfo, nullptr);
+ // vkQueueWaitIdle(graphicsQueue);
+ // }
+ // ImGui_ImplVulkan_DestroyFontsTexture();
+ // ImGui_ImplVulkan_DestroyFontUploadObjects();
}
void RecordCommandBuffer(VkCommandBuffer commandBuffer, uint32_t imageIndex) {