summaryrefslogtreecommitdiff
path: root/examples/glue.c
diff options
context:
space:
mode:
authorTom Harley2020-01-11 19:46:15 +0000
committerTom Harley2020-01-11 19:46:15 +0000
commit9e87372371794bc3e7d46698141966c00acaad0e (patch)
tree068da13d97cefed2e49ab06843e1dd9d97c32f6a /examples/glue.c
parentAdded int width specifiers (diff)
downloadsinter-9e87372371794bc3e7d46698141966c00acaad0e.tar.gz
sinter-9e87372371794bc3e7d46698141966c00acaad0e.zip

Tidying up

  • Removed unused example files
  • Removed redundant common.c
  • Added extra files to make sure the current version compiles the nqueens solution correctly
  • Added extensionless files to .gitignore
  • Added a way to install sinter
Diffstat (limited to 'examples/glue.c')
-rw-r--r--examples/glue.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/examples/glue.c b/examples/glue.c
deleted file mode 100644
index 33e44bd..0000000
--- a/examples/glue.c
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <stdio.h>
-
-#include <SDL2/SDL.h>
-
-void *on_click(void *x, void *y);
-
-void *init_sdl() {
- return (void *) SDL_Init(SDL_INIT_VIDEO);
-}
-
-void *create_window(void *init, void *xv, void *yv, void *wv, void *hv) {
- int x = (int) xv, y = (int) yv, w = (int) wv, h = (int) hv;
- int window_flags = SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE;
- SDL_Window *window = SDL_CreateWindow("window", x, y, w, h, window_flags);
- int rend_flags = SDL_RENDERER_ACCELERATED;
- SDL_Renderer *rend = SDL_CreateRenderer(window, -1, rend_flags);
- printf("window created\n");
- return (void *) window;
-}
-
-void *loop(void *window) {
- int running = 1;
- SDL_Event e;
- while (running) {
- while (SDL_PollEvent(&e)) {
- printf("event\n");
- switch (e.type) {
- case SDL_QUIT:
- running = 0;
- break;
- case SDL_MOUSEBUTTONDOWN: {
- SDL_MouseButtonEvent mbe = e.button;
- if (mbe.button == SDL_BUTTON_LEFT) {
- on_click((void *) mbe.x, (void *) mbe.y);
- }
- break;
- }
- }
- }
- }
- return 0;
-}