X-Git-Url: http://nitlanguage.org diff --git a/lib/gamnit/display.nit b/lib/gamnit/display.nit index defd809..6e7c58c 100644 --- a/lib/gamnit/display.nit +++ b/lib/gamnit/display.nit @@ -16,6 +16,10 @@ module display import ::glesv2 +import mnit::input + +import display_linux is conditional(linux) +import display_android is conditional(android) # Should Gamnit be more verbose? fun debug_gamnit: Bool do return false @@ -29,6 +33,26 @@ class GamnitDisplay # Height of the display, in pixels fun height: Int is abstract + # Aspect ratio of the screen, `width / height` + var aspect_ratio: Float is lazy do return width.to_f / height.to_f + + # Is the cursor locked et the center of the screen? + var lock_cursor = false is writable + + # Is the cursor visible? + # + # Only affects the desktop implementations. + var show_cursor: Bool = true is writable + + # Number of bits used for the red value in the color buffer + fun red_bits: Int do return 8 + + # Number of bits used for the green value in the color buffer + fun green_bits: Int do return 8 + + # Number of bits used for the blue value in the color buffer + fun blue_bits: Int do return 8 + # Prepare this display # # The implementation varies per platform. @@ -43,4 +67,9 @@ class GamnitDisplay # # The implementation varies per platform. fun flip do end + + # Loop on available events and feed them back to the app + # + # The implementation varies per platform. + fun feed_events do end end