-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Code::Blocks project file for Windows, update scripts
There's one central SETUP_dev_win.sh script, which lets you choose whether you want to develop using Code::Blocks for Windows, or using Visual Studio, and downloads the respective SDK files. Also the script copies the relevant project file to the root dir.
- Loading branch information
Showing
10 changed files
with
217 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,99 @@ | |||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | |||
<CodeBlocks_project_file> | |||
<FileVersion major="1" minor="6" /> | |||
<Project> | |||
<Option title="fray" /> | |||
<Option pch_mode="2" /> | |||
<Option compiler="gcc" /> | |||
<Build> | |||
<Target title="Debug"> | |||
<Option output="bin/Debug/fray" prefix_auto="1" extension_auto="1" /> | |||
<Option object_output="obj/Debug/" /> | |||
<Option type="1" /> | |||
<Option compiler="gcc" /> | |||
<Compiler> | |||
<Add option="-g" /> | |||
</Compiler> | |||
</Target> | |||
<Target title="Release"> | |||
<Option output="bin/Release/fray" prefix_auto="1" extension_auto="1" /> | |||
<Option object_output="obj/Release/" /> | |||
<Option type="0" /> | |||
<Option compiler="gcc" /> | |||
<Compiler> | |||
<Add option="-O3" /> | |||
<Add option="-ffast-math" /> | |||
<Add option="-march=native" /> | |||
<Add option="-fno-rtti" /> | |||
</Compiler> | |||
<Linker> | |||
<Add option="-s" /> | |||
</Linker> | |||
</Target> | |||
</Build> | |||
<Compiler> | |||
<Add option="-std=c++11" /> | |||
<Add option="-Wall" /> | |||
<Add directory="SDK/SDL-1.2.15/include" /> | |||
<Add directory="SDK/OpenEXR-mingw/include/OpenEXR" /> | |||
</Compiler> | |||
<Linker> | |||
<Add library="mingw32" /> | |||
<Add library="SDLmain" /> | |||
<Add library="SDL.dll" /> | |||
<Add library="user32" /> | |||
<Add library="gdi32" /> | |||
<Add library="winmm" /> | |||
<Add library="dxguid" /> | |||
<Add library="IlmImf" /> | |||
<Add library="Imath" /> | |||
<Add library="Iex" /> | |||
<Add library="Half" /> | |||
<Add library="IlmThread" /> | |||
<Add library="zlibstatic" /> | |||
<Add directory="SDK/SDL-1.2.15/lib" /> | |||
<Add directory="SDK/OpenEXR-mingw/lib" /> | |||
</Linker> | |||
<Unit filename="src/bbox.h" /> | |||
<Unit filename="src/bitmap.cpp" /> | |||
<Unit filename="src/bitmap.h" /> | |||
<Unit filename="src/camera.cpp" /> | |||
<Unit filename="src/camera.h" /> | |||
<Unit filename="src/color.h" /> | |||
<Unit filename="src/constants.h" /> | |||
<Unit filename="src/cxxptl-sdl.cpp" /> | |||
<Unit filename="src/cxxptl-sdl.h" /> | |||
<Unit filename="src/environment.cpp" /> | |||
<Unit filename="src/environment.h" /> | |||
<Unit filename="src/geometry.cpp" /> | |||
<Unit filename="src/geometry.h" /> | |||
<Unit filename="src/heightfield.cpp" /> | |||
<Unit filename="src/heightfield.h" /> | |||
<Unit filename="src/lights.cpp" /> | |||
<Unit filename="src/lights.h" /> | |||
<Unit filename="src/main.cpp" /> | |||
<Unit filename="src/matrix.cpp" /> | |||
<Unit filename="src/matrix.h" /> | |||
<Unit filename="src/mesh.cpp" /> | |||
<Unit filename="src/mesh.h" /> | |||
<Unit filename="src/random_generator.cpp" /> | |||
<Unit filename="src/random_generator.h" /> | |||
<Unit filename="src/scene.cpp" /> | |||
<Unit filename="src/scene.h" /> | |||
<Unit filename="src/sdl.cpp" /> | |||
<Unit filename="src/sdl.h" /> | |||
<Unit filename="src/shading.cpp" /> | |||
<Unit filename="src/shading.h" /> | |||
<Unit filename="src/triangle.cpp" /> | |||
<Unit filename="src/triangle.h" /> | |||
<Unit filename="src/util.cpp" /> | |||
<Unit filename="src/util.h" /> | |||
<Unit filename="src/vector.h" /> | |||
<Extensions> | |||
<code_completion /> | |||
<envvars /> | |||
<debugger /> | |||
<lib_finder disable_auto="1" /> | |||
</Extensions> | |||
</Project> | |||
</CodeBlocks_project_file> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,52 @@ | |||
#!/bin/bash | |||
|
|||
# Usage: SETUP_dev.sh <vc|cb>" | |||
|
|||
compiler="$1" | |||
|
|||
if [ ! -f "sdl_win.sh" ]; then | |||
echo "Invalid directory, you should run this from within scripts/" | |||
exit 2 | |||
fi | |||
|
|||
if [ ! "x$compiler" == "xvc" -a ! "x$compiler" == "xcb" ]; then | |||
echo "Choose your compiler/IDE:" | |||
echo "" | |||
echo " 1) Microsoft Visual Studio 2017" | |||
echo " 2) Code::Blocks 17.12" | |||
echo "" | |||
echo -n "? " | |||
read choice | |||
if [ "x$choice" == "x1" ]; then | |||
compiler="vc" | |||
elif [ "x$choice" == "x2" ]; then | |||
compiler="cb" | |||
else | |||
echo "Invalid choice" | |||
exit 1 | |||
fi | |||
fi | |||
echo "Compiler is $compiler" | |||
|
|||
PROJ="../projfiles" | |||
|
|||
if [ $compiler == "vc" ]; then | |||
./sdl_win.sh | |||
./openexr_win.sh | |||
./zlib_win.sh | |||
|
|||
echo ">> Copying project files..." | |||
cp $PROJ/fray.vcxproj* .. | |||
|
|||
echo ">> All set up! Open fray.vcxproj (in the root project dir) and happy hacking!" | |||
fi | |||
|
|||
if [ $compiler == "cb" ]; then | |||
./sdl_win_cb.sh | |||
./openexr_win_cb.sh | |||
|
|||
echo ">> Copying project files..." | |||
cp $PROJ/CodeBlocks-win.cbp ../fray.cbp | |||
|
|||
echo ">> All set up! Open fray.cbp (in the root project dir) and happy hacking!" | |||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,27 @@ | |||
#!/bin/sh | |||
|
|||
if [ -z $BASH_SOURCE ]; then | |||
echo "ERROR \$BASH_SOURCE is required" | |||
exit 1 | |||
fi | |||
|
|||
BASH_DIR=$(dirname $BASH_SOURCE) | |||
SDK_DIR=$BASH_DIR/../SDK | |||
|
|||
if [ ! -d $SDK_DIR ]; then | |||
mkdir $SDK_DIR | |||
fi | |||
|
|||
echo ">> Downloading OpenEXR 2.2.1 into $SDK_DIR" | |||
curl -L "http://raytracing-bg.net/lib/openexr-devel-mingw32.zip" --output $SDK_DIR/openexr.zip | |||
|
|||
if [ $? -ne 0 ]; then | |||
echo ">> ERROR: cURL failed to download OpenEXR archive" | |||
else | |||
|
|||
echo ">> Extracting OpenEXR sdk in $SDK_DIR/OpenEXR" | |||
# unzip doesn't handle relative paths well | |||
unzip -q -u $SDK_DIR/openexr.zip -d $SDK_DIR | |||
|
|||
rm $SDK_DIR/openexr.zip | |||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,33 @@ | |||
#!/bin/sh | |||
|
|||
if [ -z $BASH_SOURCE ]; then | |||
echo "ERROR \$BASH_SOURCE is required" | |||
exit 1 | |||
fi | |||
|
|||
BASH_DIR=$(dirname $BASH_SOURCE) | |||
SDK_DIR=$BASH_DIR/../SDK | |||
|
|||
if [ ! -d $SDK_DIR ]; then | |||
mkdir $SDK_DIR | |||
fi | |||
|
|||
echo ">> Downloading SDL 1.2 into $SDK_DIR" | |||
curl http://libsdl.org/release/SDL-devel-1.2.15-mingw32.tar.gz --output $SDK_DIR/sdl.tar.gz | |||
|
|||
if [ $? -ne 0 ]; then | |||
echo ">> ERROR: cURL failed to download SDL archive" | |||
else | |||
|
|||
echo ">> Extracting SDL SDK in $SDK_DIR/SDL" | |||
# unzip doesn't handle relative paths well | |||
pushd . | |||
cd $SDK_DIR | |||
tar xzf sdl.tar.gz | |||
popd | |||
|
|||
rm $SDK_DIR/sdl.tar.gz | |||
|
|||
echo ">> Copying SDL.dll" | |||
cp $SDK_DIR/SDL-1.2.15/bin/SDL.dll .. | |||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters