main
fanta 3 weeks ago
parent 26df91636d
commit 17bd1b66a7

BIN
bocm

Binary file not shown.

@ -0,0 +1,39 @@
#include <SDL.h>
#include <stdbool.h>
const int screenWidth = 800;
const int screenHeight = 600;
int main(void) {
SDL_Window *window;
SDL_Renderer *render;
SDL_Event event;
SDL_Init(SDL_INIT_VIDEO);
window = SDL_CreateWindow("BOCM",100,100,screenWidth,screenHeight,SDL_WINDOW_OPENGL);
render = SDL_CreateRenderer(window, -1, 0);
SDL_SetRenderDrawColor(render, 255, 0, 0, 255);
SDL_RenderClear(render);
SDL_RenderPresent(render);
bool q = false;
while (!q) {
SDL_WaitEvent(&event);
switch (event.type) {
case SDL_QUIT:
q = true;
break;
case SDL_KEYDOWN:
switch (event.key.keysym.sym) {
case SDLK_ESCAPE:
q = true;
break;
}
}
}
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 KiB

@ -0,0 +1,16 @@
CC := gcc
CFLAGS := -Wall
LINKER_FLAGS = `sdl2-config --cflags --libs`
test:
make clean
make build
build:
$(CC) $(CFLAGS) -o bocm bocm.c $(LINKER_FLAGS)
run:
./bocm
clean:
-rm bocm
Loading…
Cancel
Save