Skip to content

Commit 446cbfe

Browse files
Merge pull request blinry#10 from sharkwouter/sdl2-experiment
2 parents ce22731 + 3f9bb3a commit 446cbfe

117 files changed

Lines changed: 412 additions & 27750 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,21 @@ Thumbs.db
77
gish.ncb
88
gish.pdb
99
gish.vcproj.*
10+
ALL_BUILD.*
11+
ZERO_CHECK.*
12+
freegish.*
13+
FreeGish.sln
14+
CMakeCache.txt
15+
cmake_install.cmake
16+
*.DLL
17+
*.dll
1018

1119
build/
1220
freegish
13-
21+
.vs/
22+
.vscode/
23+
CMakeFiles/
24+
Debug/
25+
freegish.dir/
26+
x64/
27+
x86/

CMakeLists.txt

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,27 @@ endif(NOT ${INSTALL_FHS})
1616
# but CMake does the extra quoting for us.
1717
#add_definitions(-DDATAPATH="/usr/share/games/gish")
1818

19-
find_package(SDL REQUIRED)
20-
find_package(OpenAL REQUIRED)
21-
find_package(OpenGL REQUIRED)
22-
find_package(Vorbis REQUIRED)
23-
find_package(PNG REQUIRED)
24-
find_library(M_LIBRARIES m)
19+
if(MSVC)
20+
find_package(Ogg CONFIG REQUIRED)
21+
find_package(Vorbis CONFIG REQUIRED)
22+
find_package(libpng CONFIG REQUIRED)
23+
find_package(SDL2 CONFIG REQUIRED)
24+
find_package(OpenAL CONFIG REQUIRED)
25+
find_package(OpenGL REQUIRED)
26+
27+
else()
28+
find_package(SDL2 REQUIRED sdl2)
29+
find_package(OpenAL REQUIRED)
30+
find_package(OpenGL REQUIRED)
31+
find_package(Vorbis REQUIRED)
32+
find_package(PNG REQUIRED)
33+
find_library(M_LIBRARIES m)
34+
endif()
35+
36+
2537

2638
include_directories(
27-
${SDL_INCLUDE_DIR}
39+
${SDL2_INCLUDE_DIRS}
2840
${OPENAL_INCLUDE_DIR}
2941
${OPENGL_INCLUDE_DIR}
3042
${Vorbis_INCLUDE_DIR}

README.markdown

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,67 @@ Make sure CMake and the development libraries for SDL, OpenAL and Vorbis are ins
44

55
cmake libsdl1.2-dev libopenal-dev libvorbis-dev
66

7-
Then simply issue
7+
Then simply issue:
88

99
mkdir build && cd build
1010
cmake ..
1111
make
1212

13-
# How to compile (Windows with VS2008)
13+
# How to compile (Windows with MSVC/VS)
1414

15-
Download and install the required libraries:
15+
To develop on Windows the following tools need to be installed:
16+
- CMake
17+
- Visual Studio 2022
18+
- vcpkg
1619

17-
- <http://www.libsdl.org/release/SDL-devel-1.2.14-VC8.zip>
18-
- <http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-devel-1.2.11-VC.zip>
19-
- <http://downloads.xiph.org/releases/ogg/libogg-1.2.0.zip>
20-
- compile using *win32\VS2008\libogg_static.vcproj*
21-
- <http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.1.zip>
22-
- compile *win32\VS2008\libvorbis\libvorbis_static.vcproj*
23-
- compile *win32\VS2008\libvorbisfile\libvorbisfile_static.vcproj*
24-
- <http://connect.creativelabs.com/openal/Downloads/OpenAL11CoreSDK.zip>
25-
- install
26-
- create *C:\Program Files\OpenAL 1.1 SDK\include\AL* and copy all files from *C:\Program Files\OpenAL 1.1 SDK\include*
2720

28-
In Visual Studio add to your include-paths:
21+
Below is described how to install and set them up.
2922

30-
- *...\libvorbis-1.3.1\include*
31-
- *...\libogg-1.2.0\include*
32-
- *C:\Program Files\OpenAL 1.1 SDK\include*
33-
- *...\SDL-1.2.14_VC8\include*
34-
- *...\SDL_mixer-1.2.11\include*
23+
## CMake
3524

36-
In Visual Studio add to your library-paths:
25+
CMake is used for building Freegish and can be downloaded from [here](https://cmake.org/download/). Make sure to use the installer and select "Add CMake to system PATH" during installation.
3726

38-
- *...\libvorbis-1.3.1\win32\VS2008\libvorbisfile\Win32\Debug*
39-
- *...\libogg-1.2.0\win32\VS2008\Win32\Debug*
40-
- *...\libvorbis-1.3.1\win32\VS2008\libvorbis\Win32\Debug*
41-
- *C:\Program Files\OpenAL 1.1 SDK\libs\Win32*
42-
- *...\SDL_mixer-1.2.11\lib*
43-
- *...\SDL-1.2.14_VC8\lib*
27+
## Visual Studio 2022
4428

45-
Open *gish.sln* and compile.
29+
Installing Visual Studio installs the IDE, compiler and some other tools required to build Freegish. Get the community version installer from [here](https://visualstudio.microsoft.com/) and install the workload "Desktop development with C++" with it.
4630

47-
You will need the following files to be present:
31+
## vcpkg
4832

49-
- OpenAL32.dll
50-
- SDL.DLL
33+
vcpkg is a package manager for C and C++ which allows the libraries used to be installed. Installation instructions can be found [https://vcpkg.io/en/getting-started.html]. This README assumes that vcpkg is installed in `C:\vcpkg`.
34+
35+
Then install the required package with the following command:
36+
37+
C:\vcpkg\vcpkg.exe install --triplet x64-windows openal-soft libogg libvorbis libpng sdl2 opengl
38+
39+
## Compiling
40+
41+
To build the game open powershell in the directory in which Freegish is cloned then simply issue:
42+
43+
mkdir build
44+
cd build
45+
cmake -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows ..
46+
cmake --build . --config Release
47+
48+
After that copy the content of the Release directory to the freegish directory. To start the game run freegish.exe
49+
50+
51+
## Using Visual Studio
52+
53+
To get Freegish developing going in Visual Studio, a project file needs to be generated. This can be done with the following commands in a terminal opened in the directory in which Freegish is cloned:
54+
55+
cmake -DCMAKE_TOOLCHAIN_FILE=E:\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -G "Visual Studio 17 2022" .
56+
57+
Then open FreeGish.sln with Visual Studio.
58+
59+
Before being able to run from Visual Studio, the debug configuration has to be set. To do this, press the small arror down next to the run button with "Local Windows Debugger" next to it on the screen, then pick "All_BUILD Debug Properties". Set "Output Directory" to `$(SolutionDir)` and "Target Name" to `Debug/freegish.exe` like in this image:
60+
61+
![](visualstudio.png)
62+
63+
Now you just just start debugging like normal by pressing the run button or F5.
5164

5265
# How to play
5366

54-
Simply run `./gish` or `gish.exe`. There are some assets included (codenamed the *FreeGish* project), making Gish a completely free game! There is also one level available, `freegish.lvl`, you'll find it under "Custom Levels". Try it and replace what you don't like.
67+
Simply run `./gish` or `gish.exe`. There are some assets included (codenamed the *FreeGish* project), making Gish a completely free game!
5568

5669
If you own the original assets, you may also copy those into this directory. You'll need:
5770

SDL.DLL

-252 KB
Binary file not shown.

0 commit comments

Comments
 (0)