This commit is contained in:
Rakarake 2025-12-08 04:35:35 +01:00
parent b96d90d6a3
commit 69a0733ebe
3 changed files with 9 additions and 2 deletions

View file

@ -1,5 +1,9 @@
LIBS=sdl3 opengl
CFLAGS=-g -Wall -Wextra $(shell pkg-config --cflags $(LIBS))
LDFLAGS=$(shell pkg-config --libs $(LIBS))
all: all:
$(CC) -o glonkers main.c $(pkg-config --cflags --libs sdl3 opengl) $(CC) $(CFLAGS) $(LDFLAGS) -o glonkers main.c
run: all run: all
./glonkers ./glonkers

View file

@ -10,7 +10,8 @@
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
in in
{ {
defaultPackage = pkgs.stdenv.mkDerivation { defaultPackage = pkgs.stdenv.mkDerivation rec {
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath buildInputs}";
name = "glonkers"; name = "glonkers";
src = ./.; src = ./.;
buildInputs = with pkgs; [ buildInputs = with pkgs; [

2
main.c
View file

@ -25,10 +25,12 @@ int main() {
SDL_Event e; SDL_Event e;
int running = 1; int running = 1;
while (SDL_PollEvent(&e)) { while (SDL_PollEvent(&e)) {
printf("INSgkldjsj\n");
if (e.type == SDL_EVENT_QUIT) running = false; if (e.type == SDL_EVENT_QUIT) running = false;
// Rendorrrr // Rendorrrr
glViewport(0, 0, 800, 600); glViewport(0, 0, 800, 600);
glClearColor(0.1f, 0.1f, 0.1f, 1.0f); // Dark gray background glClearColor(0.1f, 0.1f, 0.1f, 1.0f); // Dark gray background
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//SDL_GL_SwapWindow(window);
} }
} }