sdl update
This commit is contained in:
parent
713c80a93d
commit
14c677a0f5
2
Makefile
2
Makefile
@ -5,7 +5,7 @@
|
|||||||
default: build_exec_dbg
|
default: build_exec_dbg
|
||||||
|
|
||||||
# creates executable using profile info generated by profile
|
# creates executable using profile info generated by profile
|
||||||
build_exec: rebuild_all # profile
|
build_exec: # profile
|
||||||
@cbuild/call_task.sh build_exec 2>&1 | tee -a make_raw.log
|
@cbuild/call_task.sh build_exec 2>&1 | tee -a make_raw.log
|
||||||
|
|
||||||
# creates executable with debug info and no optimizations
|
# creates executable with debug info and no optimizations
|
||||||
|
|||||||
24
README.md
24
README.md
@ -8,17 +8,23 @@ GUI is based on [Dear ImGui](https://github.com/ocornut/imgui) and [SDL](https:/
|
|||||||
```shell
|
```shell
|
||||||
git clone --recurse-submodules https://github.com/Timerix22/GraphC
|
git clone --recurse-submodules https://github.com/Timerix22/GraphC
|
||||||
```
|
```
|
||||||
2. Install **SDL2** from package manager or compile it from source
|
2. Install **SDL2** from package manager or compile it from source.
|
||||||
|
**If you are using msys, switch to mingw64 shell.**
|
||||||
```shell
|
```shell
|
||||||
cd SDL2
|
cd dependencies/SDL2
|
||||||
./configute
|
./configure
|
||||||
make -j [number of cpu cores]
|
make -j [number of cpu threads]
|
||||||
make install
|
|
||||||
# on windows
|
|
||||||
mkdir ../libs
|
|
||||||
cp ./build/.libs/*.dll ../libs/
|
|
||||||
```
|
```
|
||||||
If it didn't work, read [SDL docs](SDL2/docs/README.md) and [INSTALL.txt](SDL2/INSTALL.txt)).
|
Then you can install it systemwide:
|
||||||
|
```shell
|
||||||
|
make install
|
||||||
|
```
|
||||||
|
or copy to ./libs:
|
||||||
|
```shell
|
||||||
|
mkdir -p ../../libs
|
||||||
|
cp ./build/.libs/SDL2.dll ../../libs/
|
||||||
|
```
|
||||||
|
If it didn't work, read [SDL docs](dependencies/SDL2/docs/README.md) and [INSTALL.txt](dependencies/SDL2/INSTALL.txt).
|
||||||
|
|
||||||
3. Compile the program
|
3. Compile the program
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@ -40,12 +40,12 @@ case "$OS" in
|
|||||||
WINDOWS)
|
WINDOWS)
|
||||||
EXEC_FILE="$PROJECT.exe"
|
EXEC_FILE="$PROJECT.exe"
|
||||||
INCLUDE="-I./dependencies/imgui -I./dependencies/SDL2/include"
|
INCLUDE="-I./dependencies/imgui -I./dependencies/SDL2/include"
|
||||||
LINKER_LIBS="-L./$OBJDIR/libs/ -lSDL2 -lopengl32 -lpthread -lws2_32"
|
LINKER_LIBS="-L./libs/ -l:SDL2.dll -lopengl32 -lpthread -lws2_32"
|
||||||
;;
|
;;
|
||||||
LINUX)
|
LINUX)
|
||||||
EXEC_FILE="$PROJECT"
|
EXEC_FILE="$PROJECT"
|
||||||
INCLUDE="-I./dependencies/imgui -I./dependencies/SDL2/include"
|
INCLUDE="-I./dependencies/imgui -I./dependencies/SDL2/include"
|
||||||
LINKER_LIBS="-L./$OBJDIR/libs/ -lSDL2 -lGL"
|
LINKER_LIBS="-L./libs/ -lSDL2 -lGL"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
error "operating system $OS has no configuration variants"
|
error "operating system $OS has no configuration variants"
|
||||||
@ -71,7 +71,7 @@ case "$TASK" in
|
|||||||
# -flto applies more optimizations across object files
|
# -flto applies more optimizations across object files
|
||||||
# -flto=auto is needed to multithreaded copilation
|
# -flto=auto is needed to multithreaded copilation
|
||||||
# -fuse-linker-plugin is required to use static libs with lto, it strips away all
|
# -fuse-linker-plugin is required to use static libs with lto, it strips away all
|
||||||
C_ARGS="-O2 -flto=auto -fuse-linker-plugin"
|
C_ARGS="-O2 -flto=auto -fuse-linker-plugin -static"
|
||||||
#-fprofile-use -fprofile-prefix-path=$(realpath $OBJDIR)/objects
|
#-fprofile-use -fprofile-prefix-path=$(realpath $OBJDIR)/objects
|
||||||
CPP_ARGS="$C_ARGS"
|
CPP_ARGS="$C_ARGS"
|
||||||
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
LINKER_ARGS="$CPP_ARGS $LINKER_LIBS"
|
||||||
|
|||||||
2
dependencies/SDL2
vendored
2
dependencies/SDL2
vendored
@ -1 +1 @@
|
|||||||
Subproject commit c2ee45f5ffbba6ff6962eb24fd117586a38cce5e
|
Subproject commit 903d888cc31d283ccaaaa7e5b5a324c50a103e87
|
||||||
2
dependencies/imnodes
vendored
2
dependencies/imnodes
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 83af9066dbf8dceef44009ef21ac1d6d042db2a3
|
Subproject commit 63f942fae90ab787d50fe4c13c7504be7852aa1d
|
||||||
@ -21,6 +21,9 @@ f32 getMainWindowDPI(){
|
|||||||
|
|
||||||
Maybe main_window_open(const char* window_title){
|
Maybe main_window_open(const char* window_title){
|
||||||
SDL_TRY_ZERO(SDL_Init(SDL_INIT_VIDEO));
|
SDL_TRY_ZERO(SDL_Init(SDL_INIT_VIDEO));
|
||||||
|
SDL_version v;
|
||||||
|
SDL_GetVersion(&v);
|
||||||
|
kprintf("SDL version: %u.%u.%u\n", v.major, v.minor, v.patch);
|
||||||
// GL 3.0 + GLSL 130
|
// GL 3.0 + GLSL 130
|
||||||
const char* glsl_version = "#version 130";
|
const char* glsl_version = "#version 130";
|
||||||
SDL_TRY_ZERO( SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, 0));
|
SDL_TRY_ZERO( SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, 0));
|
||||||
|
|||||||
@ -7,5 +7,14 @@ if [ ! -f libs/fonts_embedded.a ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# copy all precompiled libs
|
set -x
|
||||||
cp libs/* $OBJDIR/libs/
|
# copy precompiled static libs to objects
|
||||||
|
cp libs/*.a "$OBJDIR/libs/"
|
||||||
|
|
||||||
|
# copy precompiled shared libs to outdir
|
||||||
|
if [ $OS == 'WINDOWS' ]; then
|
||||||
|
cp libs/*.dll "$OUTDIR"
|
||||||
|
else
|
||||||
|
cp libs/*.so "$OUTDIR"
|
||||||
|
fi
|
||||||
|
set +x
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user