Restructered Folders and Added Screens to the Game

This commit is contained in:
Julian Nießner
2018-05-11 10:11:06 +02:00
parent 9083487ac9
commit c7426bf24b
11 changed files with 86 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
set(ENTITYX_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/entityx")
set(ENTITYX_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}")
# Support both 32 and 64 bit builds
if (${CMAKE_SIZEOF_VOID_P} MATCHES 8)

View File

@@ -7,6 +7,7 @@
#include <GL/glew.h>
#include <iostream>
#include <entityx/entityx.h>
DarkRP2D::~DarkRP2D() {
std::cout << "Game got destroyed!" << std::endl;
@@ -46,6 +47,11 @@ void DarkRP2D::create () {
font = new BitmapFont("arial.ttf");
camera = new OrtographicCamera();
entityx::EntityX ex;
entityx::Entity charakter = ex.entities.create();
charakter.assign<Position>();
#ifndef NDEBUG
//Setup IMGUI debugging
ImGui::CreateContext();

View File

@@ -9,7 +9,7 @@ class DarkRP2D;
#include "Assets.h"
#include "Renderer.h"
#include "Mesh.h"
#include "InputHandler.h"
#include "input/InputHandler.h"
#include "BitmapFont.h"
#include "Camera.h"

0
src/entities/Charakter.h Normal file
View File

View File

@@ -0,0 +1,10 @@
#ifndef POSITION_H
#define POSITION_H
struct Position {
Position(float x = 0.0f, float y = 0.0f) : x(x), y(y) {}
float x, y;
};
#endif

View File

@@ -1,5 +1,5 @@
#include "InputHandler.h"
#include "Desktoplauncher.h"
#include "../DesktopLauncher.h"
#include <iostream>

View File

@@ -0,0 +1,29 @@
#include "GameScreen.h"
GameScreen::GameScreen() {
}
void GameScreen::hide() {
}
void GameScreen::pause() {
}
void GameScreen::render() {
}
void GameScreen::resize() {
}
void GameScreen::resume() {
}
void GameScreen::show() {
}

17
src/screens/GameScreen.h Normal file
View File

@@ -0,0 +1,17 @@
#ifndef GAMESCREEN_H
#define GAMESCREEN_H
#include "Screen.h"
class GameScreen : public Screen {
GameScreen() {}
virtual void hide() override;
virtual void pause() override;
virtual void render() override;
virtual void resize() override;
virtual void resume() override;
virtual void show() override;
};
#endif

21
src/screens/Screen.h Normal file
View File

@@ -0,0 +1,21 @@
#ifndef SCREEN_H
#define SCREEN_H
class Screen {
protected:
Screen() {}
public:
virtual ~Screen() {}
/* Called when this screen is no longer the current screen for a Game. */
virtual void hide() = 0;
virtual void pause() = 0;
virtual void render() = 0;
virtual void resize() = 0;
virtual void resume() = 0;
virtual void show() = 0;
};
#endif