Mas organizacion
graficos queda en una parte como el elemento que almacena el centro de "renderizado" pero se crea un UI los cuales crean widgets/vistas a partir del estado de la maquina
This commit is contained in:
2
.idea/inspectionProfiles/Project_Default.xml
generated
2
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -1,7 +1,7 @@
|
|||||||
<component name="InspectionProjectProfileManager">
|
<component name="InspectionProjectProfileManager">
|
||||||
<profile version="1.0">
|
<profile version="1.0">
|
||||||
<option name="myName" value="Project Default" />
|
<option name="myName" value="Project Default" />
|
||||||
<inspection_tool class="ClangTidy" enabled="true" level="WARNING" enabled_by_default="true">
|
<inspection_tool class="ClangTidy" enabled="false" level="WARNING" enabled_by_default="false">
|
||||||
<option name="clangTidyChecks" value="-*,bugprone-argument-comment,bugprone-assert-side-effect,bugprone-bad-signal-to-kill-thread,bugprone-branch-clone,bugprone-copy-constructor-init,bugprone-dangling-handle,bugprone-dynamic-static-initializers,bugprone-fold-init-type,bugprone-forward-declaration-namespace,bugprone-forwarding-reference-overload,bugprone-inaccurate-erase,bugprone-incorrect-roundings,bugprone-integer-division,bugprone-lambda-function-name,bugprone-macro-parentheses,bugprone-macro-repeated-side-effects,bugprone-misplaced-operator-in-strlen-in-alloc,bugprone-misplaced-pointer-arithmetic-in-alloc,bugprone-misplaced-widening-cast,bugprone-move-forwarding-reference,bugprone-multiple-statement-macro,bugprone-no-escape,bugprone-parent-virtual-call,bugprone-posix-return,bugprone-reserved-identifier,bugprone-sizeof-container,bugprone-sizeof-expression,bugprone-spuriously-wake-up-functions,bugprone-string-constructor,bugprone-string-integer-assignment,bugprone-string-literal-with-embedded-nul,bugprone-suspicious-enum-usage,bugprone-suspicious-include,bugprone-suspicious-memset-usage,bugprone-suspicious-missing-comma,bugprone-suspicious-semicolon,bugprone-suspicious-string-compare,bugprone-suspicious-memory-comparison,bugprone-suspicious-realloc-usage,bugprone-swapped-arguments,bugprone-terminating-continue,bugprone-throw-keyword-missing,bugprone-too-small-loop-variable,bugprone-undefined-memory-manipulation,bugprone-undelegated-constructor,bugprone-unhandled-self-assignment,bugprone-unused-raii,bugprone-unused-return-value,bugprone-use-after-move,bugprone-virtual-near-miss,cert-dcl21-cpp,cert-dcl58-cpp,cert-err34-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,cert-msc50-cpp,cert-msc51-cpp,cert-str34-c,cppcoreguidelines-interfaces-global-init,cppcoreguidelines-narrowing-conversions,cppcoreguidelines-pro-type-member-init,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-default-arguments,google-explicit-constructor,google-runtime-operator,hicpp-exception-baseclass,hicpp-multiway-paths-covered,misc-misplaced-const,misc-new-delete-overloads,misc-no-recursion,misc-non-copyable-objects,misc-throw-by-value-catch-by-reference,misc-unconventional-assign-operator,misc-uniqueptr-reset-release,modernize-avoid-bind,modernize-concat-nested-namespaces,modernize-deprecated-headers,modernize-deprecated-ios-base-aliases,modernize-loop-convert,modernize-make-shared,modernize-make-unique,modernize-pass-by-value,modernize-raw-string-literal,modernize-redundant-void-arg,modernize-replace-auto-ptr,modernize-replace-disallow-copy-and-assign-macro,modernize-replace-random-shuffle,modernize-return-braced-init-list,modernize-shrink-to-fit,modernize-unary-static-assert,modernize-use-auto,modernize-use-bool-literals,modernize-use-emplace,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-nodiscard,modernize-use-noexcept,modernize-use-nullptr,modernize-use-override,modernize-use-transparent-functors,modernize-use-uncaught-exceptions,mpi-buffer-deref,mpi-type-mismatch,openmp-use-default-none,performance-faster-string-find,performance-for-range-copy,performance-implicit-conversion-in-loop,performance-inefficient-algorithm,performance-inefficient-string-concatenation,performance-inefficient-vector-operation,performance-move-const-arg,performance-move-constructor-init,performance-no-automatic-move,performance-noexcept-move-constructor,performance-trivially-destructible,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,portability-simd-intrinsics,readability-avoid-const-params-in-decls,readability-const-return-type,readability-container-size-empty,readability-delete-null-pointer,readability-deleted-default,readability-inconsistent-declaration-parameter-name,readability-make-member-function-const,readability-misleading-indentation,readability-misplaced-array-index,readability-non-const-parameter,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-smartptr-get,readability-redundant-string-cstr,readability-redundant-string-init,readability-simplify-subscript-expr,readability-static-accessed-through-instance,readability-static-definition-in-anonymous-namespace,readability-string-compare,readability-uniqueptr-delete-release,readability-use-anyofallof" />
|
<option name="clangTidyChecks" value="-*,bugprone-argument-comment,bugprone-assert-side-effect,bugprone-bad-signal-to-kill-thread,bugprone-branch-clone,bugprone-copy-constructor-init,bugprone-dangling-handle,bugprone-dynamic-static-initializers,bugprone-fold-init-type,bugprone-forward-declaration-namespace,bugprone-forwarding-reference-overload,bugprone-inaccurate-erase,bugprone-incorrect-roundings,bugprone-integer-division,bugprone-lambda-function-name,bugprone-macro-parentheses,bugprone-macro-repeated-side-effects,bugprone-misplaced-operator-in-strlen-in-alloc,bugprone-misplaced-pointer-arithmetic-in-alloc,bugprone-misplaced-widening-cast,bugprone-move-forwarding-reference,bugprone-multiple-statement-macro,bugprone-no-escape,bugprone-parent-virtual-call,bugprone-posix-return,bugprone-reserved-identifier,bugprone-sizeof-container,bugprone-sizeof-expression,bugprone-spuriously-wake-up-functions,bugprone-string-constructor,bugprone-string-integer-assignment,bugprone-string-literal-with-embedded-nul,bugprone-suspicious-enum-usage,bugprone-suspicious-include,bugprone-suspicious-memset-usage,bugprone-suspicious-missing-comma,bugprone-suspicious-semicolon,bugprone-suspicious-string-compare,bugprone-suspicious-memory-comparison,bugprone-suspicious-realloc-usage,bugprone-swapped-arguments,bugprone-terminating-continue,bugprone-throw-keyword-missing,bugprone-too-small-loop-variable,bugprone-undefined-memory-manipulation,bugprone-undelegated-constructor,bugprone-unhandled-self-assignment,bugprone-unused-raii,bugprone-unused-return-value,bugprone-use-after-move,bugprone-virtual-near-miss,cert-dcl21-cpp,cert-dcl58-cpp,cert-err34-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,cert-msc50-cpp,cert-msc51-cpp,cert-str34-c,cppcoreguidelines-interfaces-global-init,cppcoreguidelines-narrowing-conversions,cppcoreguidelines-pro-type-member-init,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-default-arguments,google-explicit-constructor,google-runtime-operator,hicpp-exception-baseclass,hicpp-multiway-paths-covered,misc-misplaced-const,misc-new-delete-overloads,misc-no-recursion,misc-non-copyable-objects,misc-throw-by-value-catch-by-reference,misc-unconventional-assign-operator,misc-uniqueptr-reset-release,modernize-avoid-bind,modernize-concat-nested-namespaces,modernize-deprecated-headers,modernize-deprecated-ios-base-aliases,modernize-loop-convert,modernize-make-shared,modernize-make-unique,modernize-pass-by-value,modernize-raw-string-literal,modernize-redundant-void-arg,modernize-replace-auto-ptr,modernize-replace-disallow-copy-and-assign-macro,modernize-replace-random-shuffle,modernize-return-braced-init-list,modernize-shrink-to-fit,modernize-unary-static-assert,modernize-use-auto,modernize-use-bool-literals,modernize-use-emplace,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-nodiscard,modernize-use-noexcept,modernize-use-nullptr,modernize-use-override,modernize-use-transparent-functors,modernize-use-uncaught-exceptions,mpi-buffer-deref,mpi-type-mismatch,openmp-use-default-none,performance-faster-string-find,performance-for-range-copy,performance-implicit-conversion-in-loop,performance-inefficient-algorithm,performance-inefficient-string-concatenation,performance-inefficient-vector-operation,performance-move-const-arg,performance-move-constructor-init,performance-no-automatic-move,performance-noexcept-move-constructor,performance-trivially-destructible,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,portability-simd-intrinsics,readability-avoid-const-params-in-decls,readability-const-return-type,readability-container-size-empty,readability-delete-null-pointer,readability-deleted-default,readability-inconsistent-declaration-parameter-name,readability-make-member-function-const,readability-misleading-indentation,readability-misplaced-array-index,readability-non-const-parameter,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-smartptr-get,readability-redundant-string-cstr,readability-redundant-string-init,readability-simplify-subscript-expr,readability-static-accessed-through-instance,readability-static-definition-in-anonymous-namespace,readability-string-compare,readability-uniqueptr-delete-release,readability-use-anyofallof" />
|
||||||
</inspection_tool>
|
</inspection_tool>
|
||||||
<inspection_tool class="CppMemberFunctionMayBeStatic" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
<inspection_tool class="CppMemberFunctionMayBeStatic" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ target_sources(
|
|||||||
Machine.h Machine.cpp
|
Machine.h Machine.cpp
|
||||||
Interpreter/Interpreter.h Interpreter/Interpreter.cpp
|
Interpreter/Interpreter.h Interpreter/Interpreter.cpp
|
||||||
Graphics/Graphics.h Graphics/Graphics.cpp
|
Graphics/Graphics.h Graphics/Graphics.cpp
|
||||||
Graphics/Chip8Display.h Graphics/Chip8Display.cpp
|
UI/UIManager.h UI/UIManager.cpp
|
||||||
|
UI/Chip8Display.h UI/Chip8Display.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE vendor)
|
target_link_libraries(${PROJECT_NAME} PRIVATE vendor)
|
||||||
@@ -70,14 +70,14 @@ std::shared_ptr<SDL_Renderer> Graphics::get_renderer() {
|
|||||||
return this->renderer;
|
return this->renderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphics::start_render() const {
|
void Graphics::start() const {
|
||||||
ImGui_ImplSDLRenderer3_NewFrame();
|
ImGui_ImplSDLRenderer3_NewFrame();
|
||||||
ImGui_ImplSDL3_NewFrame();
|
ImGui_ImplSDL3_NewFrame();
|
||||||
ImGui::NewFrame();
|
ImGui::NewFrame();
|
||||||
ImGui::DockSpaceOverViewport(0, ImGui::GetMainViewport());
|
ImGui::DockSpaceOverViewport(0, ImGui::GetMainViewport());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphics::end_render() const {
|
void Graphics::end() const {
|
||||||
const ImGuiIO& io = ImGui::GetIO();
|
const ImGuiIO& io = ImGui::GetIO();
|
||||||
|
|
||||||
ImGui::Render();
|
ImGui::Render();
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ class Graphics {
|
|||||||
public:
|
public:
|
||||||
Graphics();
|
Graphics();
|
||||||
|
|
||||||
void start_render() const;
|
void start() const;
|
||||||
void end_render() const;
|
void end() const;
|
||||||
std::shared_ptr<SDL_Renderer> get_renderer();
|
std::shared_ptr<SDL_Renderer> get_renderer();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +1,33 @@
|
|||||||
#include "Machine.h"
|
#include "Machine.h"
|
||||||
|
|
||||||
#include "imgui.h"
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "Graphics/Graphics.h"
|
||||||
|
#include "Interpreter/Interpreter.h"
|
||||||
|
#include "SDL3/SDL.h"
|
||||||
|
#include "UI/Chip8Display.h"
|
||||||
|
#include "UI/UIManager.h"
|
||||||
|
|
||||||
#include "imgui_impl_sdl3.h"
|
#include "imgui_impl_sdl3.h"
|
||||||
|
|
||||||
Machine::Machine():
|
Machine::Machine():
|
||||||
machine_state{std::make_shared<MachineState>()},
|
machine_state{std::make_shared<MachineState>()},
|
||||||
interpreter{std::make_unique<Interpreter>(machine_state)},
|
graphics{std::make_shared<Graphics>()},
|
||||||
graphics{std::make_unique<Graphics>()},
|
|
||||||
chip8_display{std::make_unique<Chip8Display>(machine_state, graphics->get_renderer())},
|
interpreter{std::make_unique<Interpreter>(this->machine_state)},
|
||||||
|
ui_manager{std::make_unique<UIManager>(this->graphics, this->machine_state)},
|
||||||
|
|
||||||
ips{700},
|
ips{700},
|
||||||
last_update_time{0},
|
last_update_time{0},
|
||||||
accumulator{0} {}
|
accumulator{0},
|
||||||
|
target_cycle_time{1.0 / this->ips} {}
|
||||||
|
|
||||||
void Machine::iterate() {
|
void Machine::iterate() {
|
||||||
this->execute_interpreter();
|
this->execute_interpreter();
|
||||||
this->chip8_display->update();
|
|
||||||
this->graphics->start_render();
|
this->graphics->start();
|
||||||
ImGui::ShowDemoWindow();
|
this->ui_manager->render();
|
||||||
this->chip8_display->render();
|
this->graphics->end();
|
||||||
this->graphics->end_render();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Machine::on_event(const SDL_Event* event) const {
|
bool Machine::on_event(const SDL_Event* event) const {
|
||||||
@@ -32,15 +41,13 @@ bool Machine::on_event(const SDL_Event* event) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Machine::execute_interpreter() {
|
void Machine::execute_interpreter() {
|
||||||
const auto target_cycle_time = 1.0 / this->ips;
|
|
||||||
const auto current_time = SDL_GetTicks();
|
const auto current_time = SDL_GetTicks();
|
||||||
const auto delta_time = static_cast<double>(current_time - this->last_update_time) / 1000.0;
|
const auto delta_time = static_cast<double>(current_time - this->last_update_time) / 1000.0;
|
||||||
this->last_update_time = current_time;
|
this->last_update_time = current_time;
|
||||||
this->accumulator += delta_time;
|
this->accumulator += delta_time;
|
||||||
|
|
||||||
// ReSharper disable once CppDFALoopConditionNotUpdated
|
while (this->accumulator >= this->target_cycle_time) {
|
||||||
while (this->accumulator >= target_cycle_time) {
|
|
||||||
this->interpreter->tick();
|
this->interpreter->tick();
|
||||||
this->accumulator -= target_cycle_time;
|
this->accumulator -= this->target_cycle_time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,23 @@
|
|||||||
#ifndef MACHINE_H
|
#ifndef MACHINE_H
|
||||||
#define MACHINE_H
|
#define MACHINE_H
|
||||||
|
|
||||||
#include "Graphics/Chip8Display.h"
|
|
||||||
#include "Graphics/Graphics.h"
|
#include "Graphics/Graphics.h"
|
||||||
#include "Interpreter/Interpreter.h"
|
#include "Interpreter/Interpreter.h"
|
||||||
#include "SDL3/SDL_events.h"
|
#include "SDL3/SDL_events.h"
|
||||||
|
#include "UI/Chip8Display.h"
|
||||||
|
#include "UI/UIManager.h"
|
||||||
|
|
||||||
class Machine {
|
class Machine {
|
||||||
std::shared_ptr<MachineState> machine_state;
|
std::shared_ptr<MachineState> machine_state;
|
||||||
std::unique_ptr<Interpreter> interpreter;
|
std::shared_ptr<Graphics> graphics;
|
||||||
std::unique_ptr<Graphics> graphics;
|
|
||||||
|
|
||||||
std::unique_ptr<Chip8Display> chip8_display;
|
std::unique_ptr<Interpreter> interpreter;
|
||||||
|
std::unique_ptr<UIManager> ui_manager;
|
||||||
|
|
||||||
int ips;
|
int ips;
|
||||||
uint64_t last_update_time;
|
uint64_t last_update_time;
|
||||||
double accumulator;
|
double accumulator;
|
||||||
|
double target_cycle_time;
|
||||||
|
|
||||||
void execute_interpreter();
|
void execute_interpreter();
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <bits/ostream.tcc>
|
|
||||||
|
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
#include "SDL3/SDL.h"
|
#include "SDL3/SDL.h"
|
||||||
@@ -13,21 +12,25 @@ void SDLTextureDestroyer::operator()(SDL_Texture* texture) const {
|
|||||||
SDL_DestroyTexture(texture);
|
SDL_DestroyTexture(texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
Chip8Display::Chip8Display(std::shared_ptr<MachineState> machine_state, std::shared_ptr<SDL_Renderer> renderer):
|
Chip8Display::Chip8Display(std::shared_ptr<Graphics> graphics, std::shared_ptr<MachineState> machine_state):
|
||||||
|
graphics{std::move(graphics)},
|
||||||
machine_state{std::move(machine_state)},
|
machine_state{std::move(machine_state)},
|
||||||
renderer{std::move(renderer)},
|
|
||||||
width(64),
|
width(64),
|
||||||
height(32),
|
height(32),
|
||||||
background_color{0x00, 0x2b, 0x59},
|
background_color{0x00, 0x2b, 0x59},
|
||||||
foreground_color(0x00, 0xb9, 0xbe) {
|
foreground_color(0x00, 0xb9, 0xbe),
|
||||||
SDL_Texture* raw_texture = SDL_CreateTexture(this->renderer.get(), SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STREAMING, width, height);
|
texture{create_texture()} {}
|
||||||
|
|
||||||
|
std::unique_ptr<SDL_Texture, SDLTextureDestroyer> Chip8Display::create_texture() const {
|
||||||
|
SDL_Texture* raw_texture = SDL_CreateTexture(this->graphics->get_renderer().get(), SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STREAMING, width, height);
|
||||||
|
|
||||||
if (!raw_texture) {
|
if (!raw_texture) {
|
||||||
throw std::runtime_error(std::format("Couldn't create texture: {}", SDL_GetError()));
|
throw std::runtime_error(std::format("Couldn't create texture: {}", SDL_GetError()));
|
||||||
}
|
}
|
||||||
|
|
||||||
this->texture = std::unique_ptr<SDL_Texture, SDLTextureDestroyer>(raw_texture);
|
SDL_SetTextureScaleMode(raw_texture, SDL_SCALEMODE_NEAREST);
|
||||||
SDL_SetTextureScaleMode(this->texture.get(), SDL_SCALEMODE_NEAREST);
|
|
||||||
|
return std::unique_ptr<SDL_Texture, SDLTextureDestroyer>(raw_texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Chip8Display::render() const {
|
void Chip8Display::render() const {
|
||||||
@@ -35,8 +38,6 @@ void Chip8Display::render() const {
|
|||||||
display_widget();
|
display_widget();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Chip8Display::update() const {}
|
|
||||||
|
|
||||||
void Chip8Display::update_texture() const {
|
void Chip8Display::update_texture() const {
|
||||||
SDL_Surface* surface = nullptr;
|
SDL_Surface* surface = nullptr;
|
||||||
const auto& display = machine_state->display;
|
const auto& display = machine_state->display;
|
||||||
@@ -2,7 +2,8 @@
|
|||||||
#define CHIP8DISPLAY_H
|
#define CHIP8DISPLAY_H
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "Color.h"
|
#include "../Graphics/Color.h"
|
||||||
|
#include "../Graphics/Graphics.h"
|
||||||
#include "../Interpreter/MachineState.h"
|
#include "../Interpreter/MachineState.h"
|
||||||
#include "SDL3/SDL.h"
|
#include "SDL3/SDL.h"
|
||||||
|
|
||||||
@@ -11,8 +12,8 @@ struct SDLTextureDestroyer {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class Chip8Display {
|
class Chip8Display {
|
||||||
|
std::shared_ptr<Graphics> graphics;
|
||||||
std::shared_ptr<MachineState> machine_state;
|
std::shared_ptr<MachineState> machine_state;
|
||||||
std::shared_ptr<SDL_Renderer> renderer;
|
|
||||||
|
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
@@ -22,16 +23,15 @@ class Chip8Display {
|
|||||||
|
|
||||||
std::unique_ptr<SDL_Texture, SDLTextureDestroyer> texture;
|
std::unique_ptr<SDL_Texture, SDLTextureDestroyer> texture;
|
||||||
|
|
||||||
|
std::unique_ptr<SDL_Texture, SDLTextureDestroyer> create_texture() const;
|
||||||
void update_texture() const;
|
void update_texture() const;
|
||||||
void display_widget() const;
|
void display_widget() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Chip8Display(
|
Chip8Display(
|
||||||
std::shared_ptr<MachineState> machine_state,
|
std::shared_ptr<Graphics> graphics,
|
||||||
std::shared_ptr<SDL_Renderer> renderer
|
std::shared_ptr<MachineState> machine_state
|
||||||
);
|
);
|
||||||
|
|
||||||
void update() const;
|
|
||||||
void render() const;
|
void render() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
10
src/UI/UIManager.cpp
Normal file
10
src/UI/UIManager.cpp
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#include "UIManager.h"
|
||||||
|
|
||||||
|
UIManager::UIManager(std::shared_ptr<Graphics> graphics, std::shared_ptr<MachineState> machine_state):
|
||||||
|
graphics{std::move(graphics)},
|
||||||
|
machine_state{std::move(machine_state)},
|
||||||
|
chip8_display{std::make_unique<Chip8Display>(this->graphics, this->machine_state)} {}
|
||||||
|
|
||||||
|
void UIManager::render() const {
|
||||||
|
this->chip8_display->render();
|
||||||
|
}
|
||||||
20
src/UI/UIManager.h
Normal file
20
src/UI/UIManager.h
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#ifndef UIMANAGER_H
|
||||||
|
#define UIMANAGER_H
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include "Chip8Display.h"
|
||||||
|
#include "../Graphics/Graphics.h"
|
||||||
|
|
||||||
|
class UIManager {
|
||||||
|
std::shared_ptr<Graphics> graphics;
|
||||||
|
std::shared_ptr<MachineState> machine_state;
|
||||||
|
|
||||||
|
std::unique_ptr<Chip8Display> chip8_display;
|
||||||
|
|
||||||
|
public:
|
||||||
|
UIManager(std::shared_ptr<Graphics> graphics, std::shared_ptr<MachineState> machine_state);
|
||||||
|
|
||||||
|
void render() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //UIMANAGER_H
|
||||||
Reference in New Issue
Block a user