summaryrefslogtreecommitdiffstats
path: root/src/render.c
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2024-06-16 20:27:29 +0300
committergramanas <anastasis.gramm2@gmail.com>2024-06-16 20:27:29 +0300
commitfb9a5b153f16d8c8fe961b6af0f54a7178e032a6 (patch)
tree5077e787017a0d3cde8d2e625d1e82d183421033 /src/render.c
parent5c2677df733fc7f8a5d12ae3d0e1e648566db2bb (diff)
downloadcgame-fb9a5b153f16d8c8fe961b6af0f54a7178e032a6.tar.gz
cgame-fb9a5b153f16d8c8fe961b6af0f54a7178e032a6.tar.bz2
cgame-fb9a5b153f16d8c8fe961b6af0f54a7178e032a6.zip
Add pds
Diffstat (limited to 'src/render.c')
-rw-r--r--src/render.c39
1 files changed, 36 insertions, 3 deletions
diff --git a/src/render.c b/src/render.c
index cb4203b..9b7541f 100644
--- a/src/render.c
+++ b/src/render.c
@@ -1136,7 +1136,11 @@ vulkan_create_texture_image()
&stagingBuffer.allocation,
NULL);
- vmaCopyMemoryToAllocation(s.vk.allocator, pixels, stagingBuffer.allocation, 0, (size_t)imageSize);
+ vmaCopyMemoryToAllocation(s.vk.allocator,
+ pixels,
+ stagingBuffer.allocation,
+ 0,
+ (size_t)imageSize);
stbi_image_free(pixels);
@@ -1164,6 +1168,7 @@ vulkan_create_texture_image()
s.texture_image.handle,
(uint32_t)texWidth,
(uint32_t)texHeight);
+
vks_generate_mipmaps(s.vk, s.texture_image.handle, VK_FORMAT_R8G8B8A8_SRGB, texWidth, texHeight, s.vk_mip_levels);
transition_info.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
@@ -1680,12 +1685,42 @@ draw_frame()
prev_time = time;
}
+#define PDS_IMPLEMENTATION
+#include "pds.h"
+
int
main(int argc, char* argv[])
{
(void) argc;
(void)argv;
+ int* lst = pstack_create(int);
+ pstack_push(lst, 1);
+ pstack_push(lst, 2);
+
+ int i;
+ while (!pstack_pop(lst, &i)) {
+ printf("%d\n", i);
+ }
+ pstack_destroy(lst);
+
+ phash tbl;
+ int mem[2];
+ phash_create(sizeof(int), 2, &mem, 0, &tbl);
+
+ int x = 2;
+ phash_set(&tbl, "Val", &x);
+ x = 3;
+ phash_set(&tbl, "Val1", &x);
+
+ int y;
+ phash_get(&tbl, "Val", &y);
+ printf("%d\n", y);
+ phash_get(&tbl, "Val1", &y);
+ printf("%d\n", y);
+
+ phash_destroy(&tbl);
+
init_state(&s);
if (!init()) {
vk_log(VK_INFO, "Failed to initialize!\n");
@@ -1696,8 +1731,6 @@ main(int argc, char* argv[])
bool quit = false;
- // At the end, don't forget to:
-
update_camera(0, 0);
// Game loop