Restructered Folders and Added Screens to the Game
This commit is contained in:
2
external/entityx-1.1.2/entityx-config.cmake
vendored
2
external/entityx-1.1.2/entityx-config.cmake
vendored
@@ -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
|
# Support both 32 and 64 bit builds
|
||||||
if (${CMAKE_SIZEOF_VOID_P} MATCHES 8)
|
if (${CMAKE_SIZEOF_VOID_P} MATCHES 8)
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include <GL/glew.h>
|
#include <GL/glew.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <entityx/entityx.h>
|
||||||
|
|
||||||
DarkRP2D::~DarkRP2D() {
|
DarkRP2D::~DarkRP2D() {
|
||||||
std::cout << "Game got destroyed!" << std::endl;
|
std::cout << "Game got destroyed!" << std::endl;
|
||||||
@@ -46,6 +47,11 @@ void DarkRP2D::create () {
|
|||||||
font = new BitmapFont("arial.ttf");
|
font = new BitmapFont("arial.ttf");
|
||||||
|
|
||||||
camera = new OrtographicCamera();
|
camera = new OrtographicCamera();
|
||||||
|
|
||||||
|
entityx::EntityX ex;
|
||||||
|
entityx::Entity charakter = ex.entities.create();
|
||||||
|
charakter.assign<Position>();
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
//Setup IMGUI debugging
|
//Setup IMGUI debugging
|
||||||
ImGui::CreateContext();
|
ImGui::CreateContext();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class DarkRP2D;
|
|||||||
#include "Assets.h"
|
#include "Assets.h"
|
||||||
#include "Renderer.h"
|
#include "Renderer.h"
|
||||||
#include "Mesh.h"
|
#include "Mesh.h"
|
||||||
#include "InputHandler.h"
|
#include "input/InputHandler.h"
|
||||||
#include "BitmapFont.h"
|
#include "BitmapFont.h"
|
||||||
#include "Camera.h"
|
#include "Camera.h"
|
||||||
|
|
||||||
|
|||||||
0
src/entities/Charakter.h
Normal file
0
src/entities/Charakter.h
Normal file
10
src/entities/components/Position.h
Normal file
10
src/entities/components/Position.h
Normal 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
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "InputHandler.h"
|
#include "InputHandler.h"
|
||||||
#include "Desktoplauncher.h"
|
#include "../DesktopLauncher.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
29
src/screens/GameScreen.cpp
Normal file
29
src/screens/GameScreen.cpp
Normal 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
17
src/screens/GameScreen.h
Normal 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
21
src/screens/Screen.h
Normal 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
|
||||||
Reference in New Issue
Block a user