mirror of
https://github.com/Kbz-8/Pulse.git
synced 2026-01-11 15:33:34 +00:00
adding Vulkan device creation, adding unit tests, adding few API function declarations
This commit is contained in:
23
Examples/Vulkan/main.c
git.filemode.normal_file
23
Examples/Vulkan/main.c
git.filemode.normal_file
@@ -0,0 +1,23 @@
|
||||
#include <Pulse.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define CHECK_PULSE_HANDLE_RETVAL(handle, retval) \
|
||||
if(handle == PULSE_NULL_HANDLE) \
|
||||
{ \
|
||||
fprintf(stderr, "Error: %s", PulseVerbaliseErrorType(PulseGetLastErrorType())); \
|
||||
return retval; \
|
||||
} \
|
||||
|
||||
int main(void)
|
||||
{
|
||||
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_VULKAN, PULSE_SHADER_FORMAT_SPIRV_BIT, PULSE_NO_DEBUG);
|
||||
CHECK_PULSE_HANDLE_RETVAL(backend, 1);
|
||||
PulseDevice device = PulseCreateDevice(backend, NULL, 0);
|
||||
CHECK_PULSE_HANDLE_RETVAL(device, 1);
|
||||
|
||||
PulseDestroyDevice(device);
|
||||
PulseUnloadBackend(backend);
|
||||
puts("Successfully loaded Pulse using Vulkan !");
|
||||
return 0;
|
||||
}
|
||||
7
Examples/Vulkan/xmake.lua
git.filemode.normal_file
7
Examples/Vulkan/xmake.lua
git.filemode.normal_file
@@ -0,0 +1,7 @@
|
||||
target("VulkanExample")
|
||||
add_deps("pulse_gpu")
|
||||
if is_plat("linux") then
|
||||
set_extension(".x86_64")
|
||||
end
|
||||
add_files("*.c")
|
||||
target_end()
|
||||
Reference in New Issue
Block a user