android & benitlux: use NitObject in clients
[nit.git] / lib / gamnit / display.nit
index 69ddb41..0d78907 100644 (file)
@@ -20,6 +20,7 @@ import mnit::input
 
 import display_linux is conditional(linux)
 import display_android is conditional(android)
+import display_ios is conditional(ios)
 
 # Should Gamnit be more verbose?
 fun debug_gamnit: Bool do return false
@@ -34,7 +35,7 @@ class GamnitDisplay
        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
+       fun aspect_ratio: Float do return width.to_f / height.to_f
 
        # Is the cursor locked et the center of the screen?
        var lock_cursor = false is writable
@@ -44,6 +45,15 @@ class GamnitDisplay
        # 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.
@@ -63,4 +73,7 @@ class GamnitDisplay
        #
        # The implementation varies per platform.
        fun feed_events do end
+
+       # Extensions to OpenGL ES 2.0 supported by the current configuration
+       var gl_extensions: Array[String] is lazy do return glGetString(gl_EXTENSIONS).split(' ')
 end