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:
$(CC) -o glonkers main.c $(pkg-config --cflags --libs sdl3 opengl)
$(CC) $(CFLAGS) $(LDFLAGS) -o glonkers main.c
run: all
./glonkers

View file

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

2
main.c
View file

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