[nostalgia/core] Add support for implementation data to Context and move SDL data to it

This commit is contained in:
2020-03-22 18:30:33 -05:00
parent 0e2276bab8
commit 6d2155d1ed
9 changed files with 81 additions and 52 deletions
+16 -2
View File
@@ -13,8 +13,22 @@
namespace nostalgia::core {
// User Input Output
struct Context {
ox::FileSystem *rom = nullptr;
class Context {
public:
ox::FileSystem *rom = nullptr;
private:
void *m_implData = nullptr;
public:
constexpr void setImplData(void *implData) noexcept {
m_implData = implData;
}
template<typename T>
constexpr T *implData() noexcept {
return static_cast<T*>(m_implData);
}
};
}