-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/dev' into dev-sge
- Loading branch information
Showing
71 changed files
with
1,124 additions
and
522 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
lib/app/include/app/application/renderer/proxy_wrapper.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#ifndef __VTX_APP_APPLICATION_RENDERER_PROXY_WRAPPER__ | ||
#define __VTX_APP_APPLICATION_RENDERER_PROXY_WRAPPER__ | ||
|
||
#include "app/application/renderer/renderer_accessor.hpp" | ||
#include "app/application/system/renderer.hpp" | ||
#include <memory> | ||
|
||
namespace VTX::App::Application::Renderer | ||
{ | ||
template<typename T> | ||
class ProxyWrapper | ||
{ | ||
public: | ||
class ProxyAccessor | ||
{ | ||
friend ProxyWrapper; | ||
|
||
public: | ||
T & proxy() { return _wrapper.proxy(); } | ||
~ProxyAccessor() = default; | ||
|
||
private: | ||
ProxyAccessor( ProxyWrapper & p_wrapper ) : _wrapper( p_wrapper ), _rendererAccessor( App::RENDERER() ) {} | ||
|
||
Application::Renderer::RendererAccessor _rendererAccessor; | ||
ProxyWrapper & _wrapper; | ||
}; | ||
|
||
ProxyWrapper() {} | ||
ProxyWrapper( std::unique_ptr<T> & p_proxyPtr ) : _proxyPtr( std::move( p_proxyPtr ) ) {} | ||
|
||
void setProxy( std::unique_ptr<T> & p_proxyPtr ) { _proxyPtr = std::move( p_proxyPtr ); } | ||
bool isValid() { return _proxyPtr != nullptr; } | ||
|
||
ProxyAccessor accessor() { return ProxyAccessor( *this ); } | ||
T & proxy() { return *_proxyPtr; } | ||
const T & proxy() const { return *_proxyPtr; } | ||
|
||
private: | ||
std::unique_ptr<T> _proxyPtr = nullptr; | ||
}; | ||
|
||
} // namespace VTX::App::Application::Renderer | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef __VTX_APP_APPLICATION_RENDERER_RENDERER__ | ||
#define __VTX_APP_APPLICATION_RENDERER_RENDERER__ | ||
|
||
#include <memory> | ||
#include <renderer/facade.hpp> | ||
|
||
namespace VTX::App::Application::Renderer | ||
{ | ||
class Renderer | ||
{ | ||
public: | ||
Renderer() = default; | ||
void init(); | ||
|
||
VTX::Renderer::Facade & get(); | ||
const VTX::Renderer::Facade & get() const; | ||
|
||
private: | ||
std::unique_ptr<VTX::Renderer::Facade> _rendererPtr = nullptr; | ||
}; | ||
|
||
} // namespace VTX::App::Application::Renderer | ||
#endif |
34 changes: 34 additions & 0 deletions
34
lib/app/include/app/application/renderer/renderer_accessor.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#ifndef __VTX_APP_APPLICATION_RENDERER_RENDERER_ACCESSOR__ | ||
#define __VTX_APP_APPLICATION_RENDERER_RENDERER_ACCESSOR__ | ||
|
||
#include "app/application/renderer/renderer.hpp" | ||
#include <renderer/facade.hpp> | ||
#include <util/callback.hpp> | ||
|
||
namespace VTX::App::Application::Renderer | ||
{ | ||
class RendererAccessor | ||
{ | ||
public: | ||
RendererAccessor( | ||
Renderer & p_renderer, | ||
const Util::Callback<> & p_onGet, | ||
const Util::Callback<> & p_onRelease | ||
); | ||
~RendererAccessor(); | ||
|
||
Renderer & get(); | ||
const Renderer & get() const; | ||
|
||
VTX::Renderer::Facade & facade(); | ||
const VTX::Renderer::Facade & facade() const; | ||
|
||
private: | ||
Renderer & _renderer; | ||
|
||
const Util::Callback<> & onGet; | ||
const Util::Callback<> & onRelease; | ||
}; | ||
|
||
} // namespace VTX::App::Application::Renderer | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#ifndef __VTX_APP_APPLICATION_SYSTEM_RENDERER__ | ||
#define __VTX_APP_APPLICATION_SYSTEM_RENDERER__ | ||
|
||
#include "app/application/renderer/renderer.hpp" | ||
#include "app/application/renderer/renderer_accessor.hpp" | ||
#include "app/application/system/system_registration.hpp" | ||
#include "app/core/system/base_system.hpp" | ||
#include <renderer/facade.hpp> | ||
#include <util/callback.hpp> | ||
|
||
namespace VTX::App::Application::System | ||
{ | ||
class Renderer : public Core::System::BaseSystem | ||
{ | ||
public: | ||
inline static const System::SystemRegistration<Renderer> SYSTEM = System::SystemRegistration<Renderer>(); | ||
|
||
public: | ||
Renderer() = default; | ||
Application::Renderer::RendererAccessor accessor(); | ||
VTX::Renderer::Facade & facade(); | ||
|
||
Util::Callback<> onGet; | ||
Util::Callback<> onRelease; | ||
|
||
private: | ||
Application::Renderer::Renderer _renderer; | ||
}; | ||
|
||
} // namespace VTX::App::Application::System | ||
|
||
namespace VTX::App | ||
{ | ||
Application::System::Renderer & RENDERER_SYSTEM(); | ||
Application::Renderer::RendererAccessor RENDERER(); | ||
} // namespace VTX::App | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.