Files
GameOfLifeEditor/includes/paterns_menu.hpp
lejulien 3c37d9aca4 wippatern_preview: Adding patern preview
This adds a preview of the patern placement, checking out of bound
2026-01-14 16:38:25 +01:00

40 lines
767 B
C++

/*
* File name: paterns_menu.hpp
* Author: lejulien
* Date created: 01-01-1970 00:59:59
// Date modified: 12-01-2026 21:30:10
* ------
*/
#pragma once
#include <memory>
#include <context.hpp>
#include <vector>
#include <map>
#include <string>
namespace gol {
class PaternsMenu {
public:
PaternsMenu(std::shared_ptr<ctx>);
~PaternsMenu() = default;
void Toogle();
bool isOpen();
void display();
void refresh();
private:
bool loadPatern(std::string &path);
bool is_open_ = false;
std::shared_ptr<ctx> context_ = nullptr;
std::map<std::string,std::string> paterns_paths_list_;
std::vector<std::string> paterns_name_list_;
public:
int patern_width_ = 0;
int patern_height_ = 0;
std::vector<uint32_t> loaded_patern_;
};
} // namespace gol