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
|
/monke
|
||||||
/db/*
|
/monke.exe
|
||||||
|
/db/*
|
||||||
|
/*.dll
|
||||||
|
/*.a
|
||||||
|
/*.o
|
7
Makefile
7
Makefile
|
@ -1,3 +1,6 @@
|
||||||
CC=gcc
|
|
||||||
make:
|
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
|
# 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
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define WinMain main
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
if (!glfwInit())
|
if (!glfwInit())
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -259,7 +261,7 @@ int main(void) {
|
||||||
glBufferSubData(GL_ARRAY_BUFFER, 0, (long)cube_count * sizeof(Vertex),
|
glBufferSubData(GL_ARRAY_BUFFER, 0, (long)cube_count * sizeof(Vertex),
|
||||||
cube);
|
cube);
|
||||||
if (thread_id != 0)
|
if (thread_id != 0)
|
||||||
pthread_join(thread_id,NULL);
|
pthread_join(thread_id, NULL);
|
||||||
thread_id = 0;
|
thread_id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue