Skip to content

feature: Wayland initialization and resource cleanup - #1

Closed
CartridgeSmoker wants to merge 2 commits into
podomy:mainfrom
CartridgeSmoker:main
Closed

CartridgeSmoker wants to merge 2 commits into
podomy:mainfrom
CartridgeSmoker:main

Conversation

@CartridgeSmoker

Copy link
Copy Markdown
Contributor

basic window functionality done through wl_init() and resource cleanup through wl_finish()

@glenv1ew

Copy link
Copy Markdown
Contributor

@CartridgeSmoker you need to explain the changes in person, only then we'll merge them

And why did you make changes on topic that you haven't picked ?

Comment thread src/wl.c

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wl.h, wl.c are my part, I'll implement it myself

Comment thread src/wl.c
#include <stdio.h>
#include <string.h>

/* ------------------------------------------------------------

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These columns and comments are too large. Please shorten or remove it

Comment thread src/wl.h
#include <vulkan/vulkan.h>

#include <wayland-client.h>
#include "xdg-shell-client-protocol.h" // generated by wayland scanner

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be removed

Comment thread src/wl.h
// window
struct wl_surface* surface;
struct xdg_surface* xdg_surface;
struct xdg_toplevel* xdg_toplevel;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be removed

Comment thread src/wl.h

// window
struct wl_surface* surface;
struct xdg_surface* xdg_surface;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be removed

Comment thread src/vk.c
* VkDevice
* |
* VkQueue
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

squash it

Comment thread src/vk.c
"vkCreateInstance failed with error code %d\n",
result);
return false;
goto fail;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactor code. do not use goto

Comment thread src/vk.c
void vk_finish(struct Vk* vk) {
if (vk->dev != VK_NULL_HANDLE) {
vkDeviceWaitIdle(vk->dev);
vkDestroyDevice(vk->dev, NULL);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

figure out why pAllocator is NULL

Comment thread src/vk.c
}

if (vk->surf != VK_NULL_HANDLE) {
vkDestroySurfaceKHR(vk->inst, vk->surf, NULL);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

figure out why pAllocator is NULL

Comment thread src/vk.c
// Logical device and queue.
/*
* --------------------------------------------------------
* Logical device

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

squash it

Comment thread src/vk.c
return false;
}
/*
* --------------------------------------------------------

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

squash that

Comment thread src/vk.c
* Vulkan images to VkSurfaceKHR.
*/
const char* device_exts[] = {
VK_KHR_SWAPCHAIN_EXTENSION_NAME,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clarify what the swapchain is

@CartridgeSmoker CartridgeSmoker closed this by deleting the head repository Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants