Remove IInitable class
This commit is contained in:
@@ -1,14 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
|
||||||
#include "IInitable.hpp"
|
|
||||||
#include "ITickable.hpp"
|
#include "ITickable.hpp"
|
||||||
#include "ICloseable.hpp"
|
#include "ICloseable.hpp"
|
||||||
|
#include <string>
|
||||||
|
|
||||||
namespace openVulkanoCpp
|
namespace openVulkanoCpp
|
||||||
{
|
{
|
||||||
class IGraphicsAppManager;
|
class IGraphicsAppManager;
|
||||||
|
|
||||||
class IGraphicsApp : public IInitable, public ITickable, public ICloseable
|
class IGraphicsApp : public ITickable, public ICloseable
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
IGraphicsAppManager* manager = nullptr;
|
IGraphicsAppManager* manager = nullptr;
|
||||||
@@ -16,6 +22,7 @@ namespace openVulkanoCpp
|
|||||||
public:
|
public:
|
||||||
virtual ~IGraphicsApp() = default;
|
virtual ~IGraphicsApp() = default;
|
||||||
|
|
||||||
|
virtual void Init() = 0;
|
||||||
IGraphicsAppManager* GetGraphicsAppManager() const { return manager; }
|
IGraphicsAppManager* GetGraphicsAppManager() const { return manager; }
|
||||||
void SetGraphicsAppManager(IGraphicsAppManager* manager) { this->manager = manager; }
|
void SetGraphicsAppManager(IGraphicsAppManager* manager) { this->manager = manager; }
|
||||||
virtual std::string GetAppName() = 0;
|
virtual std::string GetAppName() = 0;
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
namespace openVulkanoCpp
|
|
||||||
{
|
|
||||||
class IInitable
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~IInitable() = default;
|
|
||||||
|
|
||||||
virtual void Init() = 0;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "IInitable.hpp"
|
|
||||||
#include "ITickable.hpp"
|
#include "ITickable.hpp"
|
||||||
#include "ICloseable.hpp"
|
#include "ICloseable.hpp"
|
||||||
#include "UI/IWindow.hpp"
|
#include "UI/IWindow.hpp"
|
||||||
@@ -13,9 +12,11 @@ namespace openVulkanoCpp
|
|||||||
PlatformInitFailedException(char const* const message) : runtime_error(message) {}
|
PlatformInitFailedException(char const* const message) : runtime_error(message) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class IPlatform : public IInitable, public ITickable, public ICloseable
|
class IPlatform : public ITickable, public ICloseable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
virtual void Init() = 0;
|
||||||
|
|
||||||
virtual IWindow* MakeWindow() = 0;
|
virtual IWindow* MakeWindow() = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Base/IInitable.hpp"
|
|
||||||
#include "Base/ITickable.hpp"
|
#include "Base/ITickable.hpp"
|
||||||
#include "Base/ICloseable.hpp"
|
#include "Base/ICloseable.hpp"
|
||||||
#include "Base/IPlatform.hpp"
|
#include "Base/IPlatform.hpp"
|
||||||
@@ -19,7 +18,7 @@ namespace openVulkanoCpp
|
|||||||
{
|
{
|
||||||
class WindowGLFW;
|
class WindowGLFW;
|
||||||
|
|
||||||
class InputProviderGLFW final : public IInitable, public ITickable, public ICloseable
|
class InputProviderGLFW final : public ITickable, public ICloseable
|
||||||
{
|
{
|
||||||
friend WindowGLFW;
|
friend WindowGLFW;
|
||||||
static InputProviderGLFW* INSTANCE;
|
static InputProviderGLFW* INSTANCE;
|
||||||
@@ -31,7 +30,7 @@ namespace openVulkanoCpp
|
|||||||
bool activeWindowChanged = false;
|
bool activeWindowChanged = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Init() override;
|
void Init();
|
||||||
|
|
||||||
void Close() override;
|
void Close() override;
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace openVulkanoCpp
|
|||||||
|
|
||||||
[[nodiscard]] bool IsInitialized() const { return initialized; }
|
[[nodiscard]] bool IsInitialized() const { return initialized; }
|
||||||
|
|
||||||
void Init() override;
|
void Init();
|
||||||
|
|
||||||
void Tick() override;
|
void Tick() override;
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace openVulkanoCpp
|
|||||||
UINT16 = sizeof(uint16_t), UINT32 = sizeof(uint32_t)
|
UINT16 = sizeof(uint16_t), UINT32 = sizeof(uint32_t)
|
||||||
};
|
};
|
||||||
|
|
||||||
class Geometry : public virtual ICloseable
|
class Geometry : public ICloseable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
uint32_t vertexCount = 0, indexCount = 0;
|
uint32_t vertexCount = 0, indexCount = 0;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Base/IInitable.hpp"
|
|
||||||
#include "Base/ICloseable.hpp"
|
#include "Base/ICloseable.hpp"
|
||||||
#include "Math/Math.hpp"
|
#include "Math/Math.hpp"
|
||||||
#include "Drawable.hpp"
|
#include "Drawable.hpp"
|
||||||
@@ -18,7 +17,7 @@ namespace openVulkanoCpp::Scene
|
|||||||
{
|
{
|
||||||
class Scene;
|
class Scene;
|
||||||
|
|
||||||
class Node : public virtual IInitable, public virtual ICloseable
|
class Node : public ICloseable
|
||||||
{
|
{
|
||||||
friend Scene;
|
friend Scene;
|
||||||
|
|
||||||
@@ -37,7 +36,7 @@ namespace openVulkanoCpp::Scene
|
|||||||
|
|
||||||
~Node() override;
|
~Node() override;
|
||||||
|
|
||||||
void Init() override;
|
void Init();
|
||||||
|
|
||||||
void Close() override;
|
void Close() override;
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace openVulkanoCpp
|
|||||||
{
|
{
|
||||||
namespace Scene
|
namespace Scene
|
||||||
{
|
{
|
||||||
class Scene : virtual public IInitable, virtual public ICloseable
|
class Scene : public ICloseable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Node* root;
|
Node* root;
|
||||||
@@ -30,7 +30,7 @@ namespace openVulkanoCpp
|
|||||||
if (root) Scene::Close();
|
if (root) Scene::Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Init() override
|
void Init()
|
||||||
{
|
{
|
||||||
Node* newRoot = new Node();
|
Node* newRoot = new Node();
|
||||||
newRoot->Init();
|
newRoot->Init();
|
||||||
|
|||||||
Reference in New Issue
Block a user