windows cross-compliation

This commit is contained in:
onezplpl 2024-07-14 19:27:52 -04:00
parent f27d19b6c8
commit 887dfbe5c4
No known key found for this signature in database
GPG key ID: 7EC026A136F9EEC3
4 changed files with 14 additions and 5 deletions

6
.gitignore vendored
View file

@ -1,2 +1,6 @@
/monke
/db/*
/monke.exe
/db/*
/*.dll
/*.a
/*.o

View file

@ -1,3 +1,6 @@
CC=gcc
make:
$(CC) -lm -lglfw -o ./monke *.c
gcc -lm -lglfw -o ./monke *.c
windows:
x86_64-w64-mingw32-gcc -lm -o ./monke.exe ./*.c ./libglfw3.a ./libwinpthread.a ./libopengl32.a ./libgdi32.a
clean:
rm ./*.o ./*.exe ./monke

View file

@ -1,4 +1,4 @@
# VoxelTest
Another voxel engine. Only works on Linux for now because of ``#include <pthread.h>``
Another voxel engine. Designed for Linux, can compile on Windows from Linux or on Windows
Run the Makefile, create a directory "db", and run the "monke" executable

4
main.c
View file

@ -93,6 +93,8 @@ void *render_chunks(void *args) {
return NULL;
}
#define WinMain main
int main(void) {
if (!glfwInit())
exit(EXIT_FAILURE);
@ -259,7 +261,7 @@ int main(void) {
glBufferSubData(GL_ARRAY_BUFFER, 0, (long)cube_count * sizeof(Vertex),
cube);
if (thread_id != 0)
pthread_join(thread_id,NULL);
pthread_join(thread_id, NULL);
thread_id = 0;
}