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;
|
||||
}
|
||||
Reference in New Issue
Block a user