- update copyright

- add instructions for cross-compilation
- add utility function for Windows and Linux executable path
This commit is contained in:
Hartmut Seichter 2025-05-25 12:31:16 +02:00
parent a4f6803c35
commit 317cde6fa1
30 changed files with 243 additions and 102 deletions

View file

@ -1,7 +1,7 @@
/**
* paradiso - Paradigmen der Softwareentwicklung
*
* (c) Copyright 2023-2024 Hartmut Seichter
* (c) Copyright 2023-2025 Hartmut Seichter and Contributors
*
*/
@ -45,13 +45,10 @@ struct PongStage {
// sprite
paradiso::Sprite sprite{
.bitmap = paradiso::Bitmap::from_data(paradiso::Size{1, 1},
paradiso::RGBA::from_rgb(0x80,0xFF,0xFF))
};
.bitmap = paradiso::Bitmap::from_data(
paradiso::Size{1, 1}, paradiso::RGBA::from_rgb(0x80, 0xFF, 0xFF))};
void draw(const paradiso::Shader& shader) {
renderer.draw(sprite, shader);
}
void draw(const paradiso::Shader& shader) { renderer.draw(sprite, shader); }
paradiso::Renderer renderer{};
};
@ -166,8 +163,9 @@ struct PongBall {
constexpr void push(const auto& impulse) noexcept { velocity += impulse; }
constexpr void whoop(const auto& whoopiness) noexcept { velocity *= whoopiness; }
constexpr void whoop(const auto& whoopiness) noexcept {
velocity *= whoopiness;
}
};
auto main() -> int {
@ -233,19 +231,19 @@ auto main() -> int {
if (!w.keyboard_input().empty()) {
if (w.keyboard_input().top().key == 'R') {
ball.sprite.pivot.x() = 0.0f;
ball.sprite.pivot.y() = 0.9f;
ball.sprite.pivot.x() = 0.0f;
ball.sprite.pivot.y() = 0.9f;
}
// speed adjust
if (w.keyboard_input().top().key == 'N') {
std::cout << "Speed Up!\n";
ball.push(paradiso::Vector2<float>::make(0.f,0.01f));
ball.push(paradiso::Vector2<float>::make(0.f, 0.01f));
} else if (w.keyboard_input().top().key == 'M') {
ball.push(paradiso::Vector2<float>::make(0.f,-0.01f));
ball.push(paradiso::Vector2<float>::make(0.f, -0.01f));
std::cout << "Speed Lower!\n";
}