Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/BennyQBD/CGFX5

Base code for thebennybox's 3D Game Programming Tutorial series
https://github.com/BennyQBD/CGFX5

Last synced: 13 days ago
JSON representation

Base code for thebennybox's 3D Game Programming Tutorial series

Awesome Lists containing this project

README

        

CGFX5
==

Base code for new 3D stuff

## Build Dependencies ##
- [CMAKE](http://www.cmake.org/)
- [GLEW](http://glew.sourceforge.net/)
- [SDL2](http://www.libsdl.org/)
- [ASSIMP](http://www.assimp.org/)
- BUILD TOOLCHAIN (Can be any one of the following, doesn't need to be all of them)
- Linux
- make, gcc, g++ ( Install with your package manager )
- [CodeBlocks](http://www.codeblocks.org/)
- Mac OS X
- make, gcc, g++ ( Install with preferred package manager like [HOMEBREW](http://brew.sh/) )
- Xcode ( Download from Mac AppStore )
- [CodeBlocks](http://www.codeblocks.org/)
- WINDOWS
- [Visual Studio](http://www.visualstudio.com/)
- [CodeBlocks](http://www.codeblocks.org/)
- [CLion](https://www.jetbrains.com/clion/)

### NOTES for Dependencies ###
On Unix/Linux/Mac you can likely install CMAKE, GLEW, SDL2 and ASSIMP with your package manager
```shell
# On ubuntu just run
sudo apt install cmake libglew-dev libsdl2-dev libassimp-dev

# On Arch Linux & variants just run
sudo pacman -S cmake glew sdl2 assimp

# On Mac with HomeBrew just run
brew install cmake glew sdl2 assimp
```

## Simple Build Instructions ##
### Mac OSX/Linux/Unix ###
- Open a Terminal and run:
```Shell
# install dependencies

./Unix-Build.sh [Build Target, Debug or Release (Optional)] [Any arguments for CMake (Optional)]

#For instance, you can use the CMake argument -G "Xcode" to generate an Xcode project during build,
#or you can use -G "CodeBlocks - Unix Makefiles" to generate a CodeBlocks Project.
#See http://www.cmake.org/ for more details about CMake arguments
```
- If this fails for any reason, try using the Manual Build Instructions below.

### Windows ###
- Make sure CMake is both installed and added to the system PATH.
- Run "Windows-GenVisualStudioProject.bat" If this fails for any reason, try using the Manual Build Instructions below.
- Go to the build folder, and open CGFX5.sln with Visual Studio 2012 or newer (For older versions of Visual Studio, use manual build instructions)
- Right click on the CGFX5 project, and select "Set as start up project"
- Build and Run

## Manual Build Instructions ##
### Linux/Unix ###
- Open a Terminal and run:
```Shell
# install dependencies
cd build
cmake ../
make
```

### Mac OSX ###
- Open a Terminal and run:
```Shell
# install dependencies
cd build
cmake ../
make
```

### Windows/MinGW ###
- Make sure CMake is both installed and added to the system PATH.
- Open a Terminal and run:
```Shell
# install dependencies
# Install GLEW in %PROGRAMFILES%/GLEW or SET %GLEW_ROOT_DIR% to where GLEW is on your machine (Example: D:\PATH_TO_GLEW)
# Install SDL2 in %PROGRAMFILES%/SDL2 or SET %SDL2_ROOT_DIR% to where SDL2 is on your machine (Example: D:\PATH_TO_SDL2)
# Install ASSIMP in %PROGRAMFILES%/ASSIMP or SET %ASSIMP_ROOT_DIR% to where ASSIMP is on your machine (Example: D:\PATH_TO_ASSIMP)
cd build
# REPLACE "Visual Studio 12" with your preferred build toolchain (Maybe you want "Codeblocks - MinGW Makefiles")
# BTW VS 10 is VS 2010, VS 11 is VS 2012 and VS 12 is VS 2013, BLAME MicroSoft for the naming! LOL!
cmake -G "Visual Studio 12" ../
# open the generated SLN file (or cbp file if using CodeBlocks) and build!
```
- Make sure in the SDL2 include directory, the header files are properly nested under an SDL2 sub directory. The directory structure should look something like : `C:\Program Files\SDL2\include\SDL2\`.
- Copy the DLLs in /lib/_bin/ to /build/Debug/ and /build/Release/
- In Visual Studio, set the Startup project to CGFX5
- Move the res folder into the build folder
- Run

## Additional Credits ##
- [@mxaddict](https://github.com/mxaddict) for setting up the awesome CMake build system
- Everyone who's created or contributed to issues and pull requests, which make the project better!