summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c
index 376e137..5309f09 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,13 +1,11 @@
#include <stdio.h>
#include <stdlib.h>
-#include <stdint.h>
#include "device.h"
#include "window.h"
#include "common.h"
// TODO: rename device.c/.h
-// TODO: fix fail gotos
window_t window;
device_t device;
@@ -20,7 +18,7 @@ int main(void)
if(SDL_Init(0)) {
err("SDL_Init: failed");
- goto sf;
+ goto f1;
}
// populate window info
@@ -33,7 +31,7 @@ int main(void)
window = window_create(&win_info);
if(!window) {
err("window_create: failed");
- goto wf;
+ goto f2;
}
// get extensions
@@ -57,7 +55,8 @@ int main(void)
device = device_create(&dev_info);
if(!device) {
err("device_create: failed");
- goto df;
+ if(extensions) free(extensions);
+ goto f3;
}
if(extensions) free(extensions);
@@ -73,10 +72,11 @@ int main(void)
}
ret = 0;
-df: device_destroy(device);
-wf: window_destroy(window);
-sf: SDL_Quit();
- return ret;
+
+ device_destroy(device);
+f3: window_destroy(window);
+f2: SDL_Quit();
+f1: return ret;
}
int _create_surface(VkInstance instance, VkSurfaceKHR *surface)