Support simple Menu
This commit is contained in:
29
examples/PoolBox/application/src/include/menu.hpp
Normal file
29
examples/PoolBox/application/src/include/menu.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
#include "font_writer.hpp"
|
||||
#include <FontWriter/font_writer.hpp>
|
||||
|
||||
namespace Menu {
|
||||
using namespace JabyEngine;
|
||||
|
||||
class SimpleMenu {
|
||||
public:
|
||||
struct Entry {
|
||||
const char* name;
|
||||
};
|
||||
|
||||
private:
|
||||
const Entry* entries;
|
||||
size_t size;
|
||||
uint8_t cur_selection;
|
||||
|
||||
public:
|
||||
void setup(const Entry* entries, size_t size);
|
||||
|
||||
template<size_t N>
|
||||
void setup(const Entry (&entries)[N]) {
|
||||
SimpleMenu::setup(entries, N);
|
||||
}
|
||||
|
||||
void update(JabyEngine::FontWriter& font_writer, State& cursor, const GPU::PositionI16& start);
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user