summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-01-23 20:58:26 +0100
committerxengineering <me@xengineering.eu>2023-01-23 20:58:26 +0100
commitff549f22682b81d0ed859510173e728dac09b8b9 (patch)
tree9600635942148dbea3acd10f79c5406bdde1aef6
parent85b9e3531416f5075c85869e6b915fa48e214689 (diff)
downloadlimox-ff549f22682b81d0ed859510173e728dac09b8b9.tar
limox-ff549f22682b81d0ed859510173e728dac09b8b9.tar.zst
limox-ff549f22682b81d0ed859510173e728dac09b8b9.zip
gui.c: Remove inline comments
Not that helpful. Should be replaced by easy to read code and well written function docstrings.
-rw-r--r--gui.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/gui.c b/gui.c
index 1c107da..1b3606e 100644
--- a/gui.c
+++ b/gui.c
@@ -49,6 +49,13 @@ struct GuiContext *init() {
}
void deinit(struct GuiContext *ctx) {
+
+ // TODO this seems to end in memory access errors but ... why?
+ //SDL_DestroyTexture(texture);
+ //SDL_DestroyRenderer(renderer);
+
+ SDL_Quit();
+
free(ctx->pixels);
free(ctx);
}
@@ -57,22 +64,18 @@ void gui_run(void) {
struct GuiContext *ctx = init();
- // init SDL2 and create window
SDL_Init(SDL_INIT_VIDEO);
ctx->window = SDL_CreateWindow("LimoX",
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480,
SDL_WINDOW_RESIZABLE
);
- // output video driver to stderr
fprintf(stderr, "SDL2 video driver: %s\n", SDL_GetCurrentVideoDriver());
- // create and initialize renderer, texture and pixel buffer
ctx->renderer = SDL_CreateRenderer(ctx->window, -1, 0);
ctx->texture = SDL_CreateTexture(ctx->renderer, SDL_PIXELFORMAT_ARGB8888,
SDL_TEXTUREACCESS_STATIC, 640, 480);
- // handle failed window creation
if (ctx->window == NULL) {
fprintf(stderr, "Failed to create SDL2 window!\n");
return;
@@ -103,10 +106,4 @@ void gui_run(void) {
deinit(ctx);
- // TODO this seems to end in memory access errors but ... why?
- //SDL_DestroyTexture(texture);
- //SDL_DestroyRenderer(renderer);
-
- SDL_Quit();
-
}