remove some bloated namespacing
This commit is contained in:
@@ -5,11 +5,11 @@
|
||||
|
||||
#include "Aeon/Rendering/ImGui.hpp"
|
||||
|
||||
using Aeon::Core::App;
|
||||
using Aeon::Core::Display;
|
||||
using Aeon::Core::DisplayProperties;
|
||||
using Core::App;
|
||||
using Core::Display;
|
||||
using Core::DisplayProperties;
|
||||
|
||||
using Aeon::Input::Input;
|
||||
using Input::Input;
|
||||
|
||||
App::App( const AppProperties& props, const DisplayProperties& dispProps )
|
||||
: mDisplay()
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "Aeon/Core/GameLayer.hpp"
|
||||
#include "Aeon/Input/Input.hpp"
|
||||
|
||||
namespace Aeon::Core {
|
||||
namespace Core {
|
||||
|
||||
// NOTE: Derivations / children of "App" cannot attatch
|
||||
// event listeners to themselves, the programmer must
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
private:
|
||||
Display mDisplay;
|
||||
|
||||
Aeon::Input::Input mInput;
|
||||
Input mInput;
|
||||
|
||||
// Game layers from z orderxko285132046
|
||||
std::vector<GameLayer*> mGameLayers;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "Aeon/Assert.hpp"
|
||||
#include "Aeon/Rendering/ImGui.hpp"
|
||||
|
||||
using Aeon::Core::Display;
|
||||
using Core::Display;
|
||||
|
||||
Display::Display()
|
||||
: mWindow( nullptr )
|
||||
@@ -58,7 +58,7 @@ bool Display::Create( const DisplayProperties& properties )
|
||||
mWidth = properties.Width;
|
||||
mHeight = properties.Height;
|
||||
|
||||
Aeon::Rendering::SetupImGui( mWindow, mContext );
|
||||
Rendering::SetupImGui( mWindow, mContext );
|
||||
|
||||
// Make sure ImGUI is ready to be used on the first frame
|
||||
ImGui_ImplOpenGL3_NewFrame();
|
||||
@@ -113,7 +113,7 @@ void Display::EndFrame()
|
||||
|
||||
void Display::Destroy()
|
||||
{
|
||||
Aeon::Rendering::CleanupImGui();
|
||||
Rendering::CleanupImGui();
|
||||
SDL_DestroyWindow( mWindow );
|
||||
// dangly balls
|
||||
mWindow = nullptr;
|
||||
|
||||
@@ -11,7 +11,9 @@ extern "C" {
|
||||
#include "Aeon/Core/EngineConfig.hpp"
|
||||
#include "Aeon/Core/Events.hpp"
|
||||
|
||||
namespace Aeon::Core {
|
||||
class Rendering::Rendermaster;
|
||||
|
||||
namespace Core {
|
||||
|
||||
class Display : public EventListener
|
||||
{
|
||||
@@ -39,6 +41,8 @@ private:
|
||||
SDL_Window* mWindow;
|
||||
SDL_GLContext mContext;
|
||||
|
||||
|
||||
|
||||
unsigned int mWidth, mHeight;
|
||||
unsigned int mX, mY;
|
||||
float mClearColour[4];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef AEON_CORE_ENGINECONFIG_H_
|
||||
#define AEON_CORE_ENGINECONFIG_H_
|
||||
|
||||
namespace Aeon::Core
|
||||
namespace Core
|
||||
{
|
||||
|
||||
// TODO: this
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
#include "Aeon/Assert.hpp"
|
||||
|
||||
using Aeon::Core::GenericEvent;
|
||||
using Aeon::Core::EventListener;
|
||||
using Aeon::Core::EventDispatcher;
|
||||
using Aeon::Core::EventManager;
|
||||
using Core::GenericEvent;
|
||||
using Core::EventListener;
|
||||
using Core::EventDispatcher;
|
||||
using Core::EventManager;
|
||||
|
||||
EventListener::EventListener()
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "Aeon/Singleton.hpp"
|
||||
#include "Aeon/Input/InputMap.hpp"
|
||||
|
||||
namespace Aeon::Core {
|
||||
namespace Core {
|
||||
|
||||
/*
|
||||
* Engine event systems / type
|
||||
@@ -74,7 +74,7 @@ struct GenericEvent
|
||||
int dx, dy;
|
||||
|
||||
// KEYBOARD_KEYDOWN KEYBOARD_KEYUP KEYBOARD_PRESSED
|
||||
Aeon::Input::EKeyCode keyCode;
|
||||
Input::EKeyCode keyCode;
|
||||
uint16_t keyMods;
|
||||
|
||||
bool Handled = false;
|
||||
@@ -131,7 +131,7 @@ private:
|
||||
friend class EventManager;
|
||||
};
|
||||
|
||||
class EventManager : public Aeon::Helpers::Singleton<EventManager>
|
||||
class EventManager : public Helpers::Singleton<EventManager>
|
||||
{
|
||||
public:
|
||||
EventManager();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "Aeon/Core/Events.hpp"
|
||||
|
||||
namespace Aeon::Core
|
||||
namespace Core
|
||||
{
|
||||
|
||||
class GameLayer : public EventListener
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "Aeon/Input/InputMap.hpp"
|
||||
#include "Aeon/Rendering/ImGui.hpp"
|
||||
|
||||
using Aeon::Input::Input;
|
||||
using Input::Input;
|
||||
|
||||
Input::Input()
|
||||
: mEvent()
|
||||
@@ -96,7 +96,7 @@ void Input::mPollDisplay()
|
||||
}
|
||||
case SDL_WINDOWEVENT_MOVED:
|
||||
{
|
||||
Aeon::Core::GenericEvent e;
|
||||
Core::GenericEvent e;
|
||||
e.x = mEvent.window.data1;
|
||||
e.y = mEvent.window.data2;
|
||||
e.Type = "DISPLAY_MOVE";
|
||||
@@ -105,7 +105,7 @@ void Input::mPollDisplay()
|
||||
}
|
||||
case SDL_WINDOWEVENT_RESIZED:
|
||||
{
|
||||
Aeon::Core::GenericEvent e;
|
||||
Core::GenericEvent e;
|
||||
e.x = mEvent.window.data1;
|
||||
e.y = mEvent.window.data2;
|
||||
e.Type = "DISPLAY_RESIZE";
|
||||
@@ -152,7 +152,7 @@ void Input::mPollDisplay()
|
||||
|
||||
void Input::mPollMouse()
|
||||
{
|
||||
Aeon::Core::GenericEvent e;
|
||||
Core::GenericEvent e;
|
||||
e.x = mEvent.motion.x;
|
||||
e.y = mEvent.motion.y;
|
||||
e.dx = mEvent.motion.xrel;
|
||||
@@ -163,7 +163,7 @@ void Input::mPollMouse()
|
||||
|
||||
void Input::mPollScroll()
|
||||
{
|
||||
Aeon::Core::GenericEvent e;
|
||||
Core::GenericEvent e;
|
||||
e.y = mEvent.wheel.y;
|
||||
e.Type = "MOUSE_SCROLL";
|
||||
mMouseEventDispatcher.Dispatch( e );
|
||||
@@ -218,7 +218,7 @@ void Input::mPollClick()
|
||||
void Input::mPollKeyboard()
|
||||
{
|
||||
EKeyCode keycode = KeyCodeFromSDL( mEvent.key.keysym.sym );
|
||||
Aeon::Core::GenericEvent e;
|
||||
Core::GenericEvent e;
|
||||
e.keyCode = KeyCodeFromSDL(keycode);
|
||||
if ( mEvent.key.state == SDL_PRESSED )
|
||||
{
|
||||
@@ -247,7 +247,7 @@ void Input::mPollScanKeyboard()
|
||||
{
|
||||
EKeyCode whatKeyPressed = KeyCodeFromScanCode( (SDL_Scancode)i );
|
||||
|
||||
Aeon::Core::GenericEvent e;
|
||||
Core::GenericEvent e;
|
||||
e.keyCode = whatKeyPressed;
|
||||
e.keyMods = mModKeyState;
|
||||
e.Type = "KEYBOARD_KEYPRESS";
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "Aeon/Singleton.hpp"
|
||||
#include "Aeon/Core/Events.hpp"
|
||||
|
||||
namespace Aeon::Input {
|
||||
namespace Input {
|
||||
|
||||
class Input
|
||||
{
|
||||
@@ -33,9 +33,9 @@ private:
|
||||
const uint8_t* mKbdState;
|
||||
uint16_t mModKeyState = 0x0;
|
||||
|
||||
Aeon::Core::EventDispatcher mDisplayEventDispatcher;
|
||||
Aeon::Core::EventDispatcher mKeyboardEventDispatcher;
|
||||
Aeon::Core::EventDispatcher mMouseEventDispatcher;
|
||||
Core::EventDispatcher mDisplayEventDispatcher;
|
||||
Core::EventDispatcher mKeyboardEventDispatcher;
|
||||
Core::EventDispatcher mMouseEventDispatcher;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <SDL.h>
|
||||
|
||||
namespace Aeon::Input
|
||||
namespace Input
|
||||
{
|
||||
|
||||
enum EModCode {
|
||||
|
||||
@@ -12,7 +12,7 @@ extern "C" {
|
||||
#include <Aeon/ThirdParty/ImGui/imgui_impl_sdl.h>
|
||||
#include <Aeon/ThirdParty/ImGui/imgui_impl_opengl3.h>
|
||||
|
||||
namespace Aeon::Rendering
|
||||
namespace Rendering
|
||||
{
|
||||
|
||||
inline void SetupImGui( const SDL_Window* window, const SDL_GLContext& context )
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
#include "Aeon/Singleton.hpp"
|
||||
|
||||
namespace Aeon::Rendering
|
||||
namespace Rendering
|
||||
{
|
||||
|
||||
class RenderMaster : public Aeon::Helpers::Singleton<RenderMaster>
|
||||
class RenderMaster : public Helpers::Singleton<RenderMaster>
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
2
Aeon/Rendering/Renderable.hpp
Normal file
2
Aeon/Rendering/Renderable.hpp
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef AEON_SINGLETON_H_
|
||||
#define AEON_SINGLETON_H_
|
||||
|
||||
namespace Aeon::Helpers {
|
||||
namespace Helpers {
|
||||
|
||||
template <class T>
|
||||
class Singleton
|
||||
|
||||
@@ -3,21 +3,21 @@
|
||||
#include <Aeon/Aeon.hpp>
|
||||
#include <Aeon/Core/Events.hpp>
|
||||
|
||||
class BackgroundLevel : public Aeon::Core::GameLayer {
|
||||
class BackgroundLevel : public Core::GameLayer {
|
||||
|
||||
};
|
||||
|
||||
class Level : public Aeon::Core::GameLayer
|
||||
class Level : public Core::GameLayer
|
||||
{
|
||||
public:
|
||||
Level()
|
||||
{
|
||||
PushThisAsSink("ENGINE_INPUT_KEYBOARD");
|
||||
Aeon::Core::EventManager::GetInstance().DebugPrint();
|
||||
{
|
||||
Core::EventManager::GetInstance().DebugPrint();
|
||||
}
|
||||
|
||||
void Attach() override
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void FrameTick() override
|
||||
@@ -30,13 +30,8 @@ public:
|
||||
|
||||
}
|
||||
|
||||
bool EventRecieved( Aeon::Core::GenericEvent& e ) override
|
||||
bool EventRecieved( Core::GenericEvent& e ) override
|
||||
{
|
||||
std::cout << "FROM LEVEL " << e.Type << " " << (char)e.keyCode << std::endl;
|
||||
|
||||
if ( e.keyMods & Aeon::Input::EModCode::SHIFT ) {
|
||||
std::cout << "Shift" << std::endl;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -47,14 +42,14 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class ExampleGame : public Aeon::Core::App
|
||||
class ExampleGame : public Core::App
|
||||
{
|
||||
public:
|
||||
ExampleGame()
|
||||
: App( { "Example" }, { "Game with AEON!" } )
|
||||
{
|
||||
Level* level = new Level;
|
||||
PushLayer( (Aeon::Core::GameLayer*)level );
|
||||
PushLayer( (Core::GameLayer*)level );
|
||||
Run();
|
||||
delete level;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user