mirror of
https://github.com/Kbz-8/Pulse.git
synced 2026-01-11 15:33:34 +00:00
working on command lists
This commit is contained in:
@@ -1,20 +1,31 @@
|
||||
#include <Pulse.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define CHECK_PULSE_HANDLE_RETVAL(handle, retval) \
|
||||
if(handle == PULSE_NULL_HANDLE) \
|
||||
{ \
|
||||
fprintf(stderr, "Error: %s", PulseVerbaliseErrorType(PulseGetLastErrorType())); \
|
||||
return retval; \
|
||||
} \
|
||||
void DebugCallBack(PulseDebugMessageSeverity severity, const char* message)
|
||||
{
|
||||
if(severity == PULSE_DEBUG_MESSAGE_SEVERITY_ERROR)
|
||||
{
|
||||
fprintf(stderr, "Pulse Error: %s", message);
|
||||
exit(1);
|
||||
}
|
||||
else if(severity == PULSE_DEBUG_MESSAGE_SEVERITY_WARNING)
|
||||
fprintf(stderr, "Pulse Warning: %s", message);
|
||||
else
|
||||
printf("Pulse: %s", message);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_VULKAN, PULSE_SHADER_FORMAT_SPIRV_BIT, PULSE_NO_DEBUG);
|
||||
CHECK_PULSE_HANDLE_RETVAL(backend, 1);
|
||||
if(backend == PULSE_NULL_HANDLE)
|
||||
{
|
||||
fprintf(stderr, "Pulse: could not create backend");
|
||||
return 1;
|
||||
}
|
||||
PulseSetDebugCallback(backend, DebugCallBack);
|
||||
PulseDevice device = PulseCreateDevice(backend, NULL, 0);
|
||||
CHECK_PULSE_HANDLE_RETVAL(device, 1);
|
||||
|
||||
PulseDestroyDevice(device);
|
||||
PulseUnloadBackend(backend);
|
||||
|
||||
Reference in New Issue
Block a user