windows cross-compliation
This commit is contained in:
parent
f27d19b6c8
commit
887dfbe5c4
4 changed files with 14 additions and 5 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -1,2 +1,6 @@
|
|||
/monke
|
||||
/db/*
|
||||
/monke.exe
|
||||
/db/*
|
||||
/*.dll
|
||||
/*.a
|
||||
/*.o
|
7
Makefile
7
Makefile
|
@ -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
|
|
@ -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
4
main.c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue