60 lines
1.1 KiB
C++
60 lines
1.1 KiB
C++
|
/**
|
||
|
* paradiso - Paradigmen der Softwareentwicklung
|
||
|
*
|
||
|
* (c) Copyright 2023 Hartmut Seichter
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
#include "bitmap.hpp"
|
||
|
#include "context.hpp"
|
||
|
#include "geometry.hpp"
|
||
|
#include "sprite.hpp"
|
||
|
#include "window.hpp"
|
||
|
|
||
|
#include <iomanip>
|
||
|
#include <iostream>
|
||
|
|
||
|
auto main() -> int {
|
||
|
|
||
|
|
||
|
auto checker_board =
|
||
|
|
||
|
|
||
|
auto window = paradiso::Window();
|
||
|
|
||
|
window.set_size(paradiso::Size{.width = 1280, .height = 720})
|
||
|
.set_position(paradiso::Point{.x = 100, .y = 100})
|
||
|
.set_title("PardiSO")
|
||
|
.set_visible(true);
|
||
|
|
||
|
auto ctx = paradiso::Context{};
|
||
|
|
||
|
auto sprite = paradiso::Sprite {
|
||
|
//
|
||
|
};
|
||
|
|
||
|
bool want_close{false};
|
||
|
|
||
|
window.set_keyboardcallback(
|
||
|
[&](auto& w, int key, int scancode, int action, int mods) {
|
||
|
if (key == 'Q' || key == 256)
|
||
|
want_close = true;
|
||
|
});
|
||
|
|
||
|
while (window.update([&](auto& w) -> bool {
|
||
|
|
||
|
static uint8_t green_slider = 0x00;
|
||
|
ctx.set_clearcolor(paradiso::RGBA::from_rgb(0xFF, green_slider, 0x00));
|
||
|
|
||
|
|
||
|
|
||
|
ctx.clear();
|
||
|
|
||
|
green_slider++;
|
||
|
|
||
|
return !want_close;
|
||
|
})) {
|
||
|
};
|
||
|
|
||
|
return 0;
|
||
|
}
|