Move C code to directory

This commit is contained in:
Joseph Ferano 2024-11-15 11:50:37 +07:00
parent b8770d04e3
commit 3b0ee06adc
19 changed files with 42 additions and 5 deletions

View File

@ -1,6 +1,5 @@
#+begin_src shell #+begin_src shell
gcc -lecl ecl_test.c -o test-game libtest-game.a gcc -lecl ecl_test.c -o test-game libtest-game.a
#+end_src #+end_src
@ -10,3 +9,12 @@ gcc -lecl ecl_test.c -o test-game libtest-game.a
(compile-file "game.lisp" :system-p t) (compile-file "game.lisp" :system-p t)
(c:build-static-library "test-game" :lisp-files '("game.o") :init-name "game") (c:build-static-library "test-game" :lisp-files '("game.o") :init-name "game")
#+end_src #+end_src
#+begin_src shell
emcc -o ecl_test.html ecl_test.c -Os -Wall USE_GLFW=3 --shell-file ~/Repositories/raylib/src/minshell.html -DPLATFORM_WEB
emcc -lecl -o ecl_test.html ecl_test.c -Os -Wall --shell-file ~/Repositories/raylib/src/minshell.html -DPLATFORM_WEB
emcc -I -o why.html ecl_test.c -Os -Wall --shell-file ~/Repositories/raylib/src/minshell.html -DPLATFORM_WEB
#+end_src

29
c-version/base.c Normal file
View File

@ -0,0 +1,29 @@
#include "include/raylib.h"
#include "include/raymath.h"
#include <stdio.h>
#include "lib.h"
#define SCREEN_WIDTH 1300
#define SCREEN_HEIGHT 1000
#define TARGET_FPS 60
int main(void) {
InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT, "Boids");
SetTargetFPS(TARGET_FPS);
while (!WindowShouldClose()) {
float dt = GetFrameTime();
// Update
BeginDrawing();
{
ClearBackground(RAYWHITE);
}
EndDrawing();
}
CloseWindow();
}

View File

@ -75,11 +75,11 @@ Assets Init() {
Assets assets = {0}; Assets assets = {0};
assets.textures = malloc(sizeof(Texture2D) * TEXTURES_BUF_SIZE); assets.textures = malloc(sizeof(Texture2D) * TEXTURES_BUF_SIZE);
assets.textures[TEX_GROUND] = LoadTexture("assets/Terrain/Ground/Tilemap_Flat.png"); assets.textures[TEX_GROUND] = LoadTexture(../"assets/Terrain/Ground/Tilemap_Flat.png");
assets.textures[TEX_KNIGHT] = assets.textures[TEX_KNIGHT] =
LoadTexture("assets/Factions/Knights/Troops/Warrior/Blue/Warrior_Blue.png"); LoadTexture("../assets/Factions/Knights/Troops/Warrior/Blue/Warrior_Blue.png");
assets.textures[TEX_MOUSE_CURSOR] = LoadTexture("assets/UI/Pointers/01.png"); assets.textures[TEX_MOUSE_CURSOR] = LoadTexture("../assets/UI/Pointers/01.png");
assets.textures[TEX_TARGET_RETICLE] = LoadTexture("assets/UI/Pointers/02.png"); assets.textures[TEX_TARGET_RETICLE] = LoadTexture("../assets/UI/Pointers/02.png");
return assets; return assets;
} }