wayland rewrite complete

This commit is contained in:
Jorijn van der Graaf 2025-11-24 01:47:49 +01:00
commit 721ff8f42f
8 changed files with 134 additions and 87 deletions

View file

@ -9,8 +9,8 @@ int main() {
// Listen for left mouse click events on the window
// The callback receives the MousePoint struct containing the click coordinates in float pixels from the top left corner
EventListener<MousePoint> clickListener(&window.onMouseLeftClick, [&window](MousePoint point){
// Print the coordinates where the user clicked
std::cout << std::format("Clicked on X:{} Y:{}!", MappedToPixel(point.x, window.width), MappedToPixel(point.y, window.height)) << std::endl;
// Print the coordinates where the user clicked, we recieve the point in mapped space so we must convert it to pixels first
std::cout << std::format("Clicked on X:{} Y:{}!", MappedToPixelBoundless(point.x, window.width), MappedToPixelBoundless(point.y, window.height)) << std::endl;
});
// Listen specifically for the 'a' key being pressed down