2025-11-19 22:20:27 +01:00
|
|
|
#include <amethyst.hpp>
|
2025-11-26 13:46:46 +01:00
|
|
|
#include <iostream>
|
2025-11-19 22:20:27 +01:00
|
|
|
|
2025-11-24 10:02:22 +01:00
|
|
|
#include "amethyst/iron.hpp"
|
|
|
|
|
|
2025-11-26 13:46:46 +01:00
|
|
|
class example : public Amy::App {
|
2025-11-24 10:02:22 +01:00
|
|
|
public:
|
|
|
|
|
example() {
|
2025-11-26 13:46:46 +01:00
|
|
|
Amy::Ctr::Init();
|
2025-11-24 22:11:26 +01:00
|
|
|
consoleInit(GFX_BOTTOM, NULL);
|
2025-11-26 13:46:46 +01:00
|
|
|
Amy::C3D::Init();
|
|
|
|
|
m_top = Amy::C3D::CreateScreen(GFX_TOP, GFX_LEFT);
|
|
|
|
|
Amy::Iron::Init();
|
|
|
|
|
dl = new Amy::Iron::Drawlist();
|
|
|
|
|
dl->DrawSolid();
|
2025-11-25 17:22:26 +01:00
|
|
|
};
|
2025-11-24 10:02:22 +01:00
|
|
|
~example() {
|
2025-11-26 13:46:46 +01:00
|
|
|
Amy::C3D::DeleteScreen(m_top);
|
|
|
|
|
Amy::C3D::Deinit();
|
2025-11-24 10:02:22 +01:00
|
|
|
};
|
2025-11-19 22:20:27 +01:00
|
|
|
|
2025-11-26 13:46:46 +01:00
|
|
|
void Main() override {
|
|
|
|
|
Amy::C3D::StartFrame();
|
|
|
|
|
m_top->Use();
|
|
|
|
|
m_top->Clear();
|
|
|
|
|
dl->DrawRectFilled(0, 50, 0xff00ff00);
|
|
|
|
|
Amy::Iron::NewFrame();
|
|
|
|
|
Amy::Iron::DrawOn(m_top);
|
|
|
|
|
Amy::Iron::Draw(*dl);
|
|
|
|
|
dl->Clear();
|
|
|
|
|
Amy::C3D::EndFrame();
|
|
|
|
|
std::cout << std::format("\x1b[1;1HDelta: {:.3f}\x1b[K", this->Delta());
|
|
|
|
|
std::cout << std::format("\x1b[2;1HTime: {:.2f}\x1b[K", this->Time());
|
2025-11-19 22:20:27 +01:00
|
|
|
}
|
2025-11-24 10:02:22 +01:00
|
|
|
|
|
|
|
|
private:
|
2025-11-26 13:46:46 +01:00
|
|
|
Amy::C3D::Screen* m_top = nullptr;
|
|
|
|
|
Amy::Iron::Drawlist* dl = nullptr;
|
2025-11-24 10:02:22 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
int main() {
|
2025-11-26 13:46:46 +01:00
|
|
|
Amy::RegisterCxxExceptionHandler();
|
2025-11-24 10:02:22 +01:00
|
|
|
example app;
|
2025-11-26 13:46:46 +01:00
|
|
|
app.Run();
|
2025-11-19 22:20:27 +01:00
|
|
|
return 0;
|
|
|
|
|
}
|