Compare commits

..

No commits in common. "3a1c15f313ef12bc2b7a5da16436715cfde06911" and "4d09e1fd4a57a92361807cde5c08c291fc208d4b" have entirely different histories.

9 changed files with 1 additions and 96 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

View File

@ -2,13 +2,6 @@ cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
add_executable(tomato
main.cpp
icon.rc
screen.hpp
start_screen.hpp
start_screen.cpp
main_screen.hpp
main_screen.cpp
)
target_compile_features(tomato PUBLIC cxx_std_17)

View File

@ -1 +0,0 @@
1 ICON "../res/icon/tomato_v1_128.ico"

View File

@ -7,8 +7,6 @@
#include "./theme.hpp"
#include "./start_screen.hpp"
#include <memory>
#include <future>
#include <iostream>
@ -52,8 +50,6 @@ int main(int argc, char** argv) {
ImGui_ImplSDLRenderer3_Init(renderer.get());
auto imgui_sdlrenderer_scope = std::async(std::launch::deferred, &ImGui_ImplSDLRenderer3_Shutdown);
std::unique_ptr<Screen> screen = std::make_unique<StartScreen>();
bool quit = false;
while (!quit) {
SDL_Event event;
@ -72,12 +68,7 @@ int main(int argc, char** argv) {
ImGui_ImplSDL3_NewFrame();
ImGui::NewFrame();
//ImGui::ShowDemoWindow();
Screen* ret_screen = screen->poll(quit);
if (ret_screen != nullptr) {
screen.reset(ret_screen);
}
ImGui::ShowDemoWindow();
ImGui::Render();
ImGui_ImplSDLRenderer3_RenderDrawData(ImGui::GetDrawData());

View File

@ -1,17 +0,0 @@
#include "./main_screen.hpp"
#include <imgui/imgui.h>
#include <memory>
MainScreen::MainScreen(std::string save_path) {
}
Screen* MainScreen::poll(bool& quit) {
bool open = !quit;
ImGui::ShowDemoWindow(&open);
quit = !open;
return nullptr;
}

View File

@ -1,15 +0,0 @@
#pragma once
#include "./screen.hpp"
#include <string>
struct MainScreen final : public Screen {
MainScreen(std::string save_path);
~MainScreen(void) = default;
// return nullptr if not next
// sets bool quit to true if exit
Screen* poll(bool&) override;
};

View File

@ -1,10 +0,0 @@
#pragma once
struct Screen {
virtual ~Screen(void) = default;
// return nullptr if not next
// sets bool quit to true if exit
virtual Screen* poll(bool& quit) = 0;
};

View File

@ -1,23 +0,0 @@
#include "./start_screen.hpp"
#include "./main_screen.hpp"
#include <memory>
StartScreen::StartScreen(void) {
}
Screen* StartScreen::poll(bool&) {
// TODO: imgui tox profile selector?
// +------------------------
// | +------+ +--------
// | | ICON | | fileselector/dropdown?
// | | | | password input
// | +------+ +--------
// +------------------------
auto new_screen = std::make_unique<MainScreen>("tomato.tox");
return new_screen.release();
}

View File

@ -1,13 +0,0 @@
#pragma once
#include "./screen.hpp"
struct StartScreen final : public Screen {
StartScreen(void);
~StartScreen(void) = default;
// return nullptr if not next
// sets bool quit to true if exit
Screen* poll(bool&) override;
};