Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Commit

Permalink
Merge pull request #14 from avans-night-byte/release/v0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
marc0tjevp authored Oct 11, 2020
2 parents 143250e + cd7d4d7 commit 7bae0e9
Show file tree
Hide file tree
Showing 16 changed files with 80 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
#*.dll

# Fortran module files
*.mod
Expand All @@ -33,10 +33,10 @@
*.a
*.lib

# Executables
*.exe
*.out
*.app
# # Executables
# *.exe
# *.out
# *.app

### CLion+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@
url = https://github.com/avans-night-byte/game.git
ignore = all
branch = develop

[submodule "SDL_image"]
path = Libraries/SDL_image
url = https://github.com/SDL-mirror/SDL_image
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.17)

set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CURRENT_BINARY_DIR ./build)
set(CMAKE_CURRENT_SOURCE_DIR .)
Expand All @@ -17,4 +19,4 @@ add_executable(NightByte ./Main.cpp
./API/Input/EngineInputAPI.cpp)

target_include_directories(NightByte PUBLIC ${SDL2_SOURCE_DIR}/include)
target_link_libraries(NightByte SDL2)
target_link_libraries(NightByte SDL2 winpthread)
8 changes: 7 additions & 1 deletion Engine/Input/Adapter/SDLInputEngineAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,13 @@ Input SDLInputEngineAdapter::getControllerInput(SDL_Event controllerEvent) const
return Input{.device = Input::CONTROLLER, .x = -1, .y = -1, .keyMap = keyMap};
}

// Note from drunk Marco to sober Marco: Don't forget to fix this.
/**
* Handles Axis motion events for the controller.
* Note: At this time this only logs which axis was moved.
*
* @param SDL_Event controllerEvent - SDL Event that was received.
* @returns Input{device, x, y, keyMap}
*/
Input SDLInputEngineAdapter::getControllerMotionInput(SDL_Event controllerEvent) const
{

Expand Down
2 changes: 1 addition & 1 deletion Game
Submodule Game updated 1 files
+24 −6 Game.cpp
2 changes: 1 addition & 1 deletion Libraries/SDL
1 change: 1 addition & 0 deletions Libraries/SDL_image
Submodule SDL_image added at 581ef3
1 change: 0 additions & 1 deletion Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
const int width = 640;
const int height = 480;

// TODO: This should be moved to the engine
int main(int argc, char *args[])
{
std::cout << "Hello, Night Byte" << std::endl;
Expand Down
Binary file added NightByte.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,23 @@
# avans-engine
Contains the engine for Avans minor Software Architecture
# Night Byte Engine

<p align="center">
<img src="NightByte.png" height="400px;" />
</p>

## Run the executable

Run the latest executable provided in the `builds` folder or download the executable from the [latest release](https://github.com/avans-night-byte/engine/releases).

At this moment in time the application only returns given input to the console. Please start the executable from your terminal to see the Input functionality.

## Build and run the project

There are two ways to build and run the project: Use a provided script file or build manually. The scripts require dependencies to be installed already and are mostly used after setting up your environment. Read the script files for any dependencies you might have to install or use the wiki.

### Linux

Run `run.sh` from the root of the project or follow the [instructions on our wiki](https://github.com/avans-night-byte/engine/wiki/Project-Setup-%5BLinux%5D) to build manually.

### Windows

Run `run.bat` from the root of the project or follow the [instructions on our wiki](https://github.com/avans-night-byte/engine/wiki/Project-Setup-%5BWindows%5D)
Binary file added builds/NightByte
Binary file not shown.
Binary file added builds/NightByte.exe
Binary file not shown.
Binary file added builds/SDL2.dll
Binary file not shown.
21 changes: 21 additions & 0 deletions run.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@echo off

rem This script attempts to build and run the project for Windows.
rem See https://github.com/avans-night-byte/engine/wiki/Project-Setup-%5BWindows%5D for manual setup.
rem Dependencies: make, cmake, gcc/g++, git

rem 1. Pull/Update gitmodules
git submodule update --init --recursive --remote

rem 2. Generate a makefile and buildfolder
cmake -S . -B ./build -G "MinGW Makefiles"
cd build

rem 3. Create a binary
make
cd bin

rem 4. Run the executable
NightByte.exe

pause
15 changes: 13 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
#!/bin/bash
# This script attempts to build and run the project for Linux.
# See https://github.com/avans-night-byte/engine/wiki/Project-Setup-%5BLinux%5D for manual setup.
# Dependencies: make, cmake, gcc/g++, git

# 1. Pull/Update gitmodules
git submodule update --recursive --init --remote

# 2. Generate a makefile and buildfolder
cmake -S . -B ./build/
cd build

# 3. Create a binary
make
cd ..
./build/bin/NightByte
cd bin

# 4. Run the executable
./NightByte

0 comments on commit 7bae0e9

Please sign in to comment.