realtime: avoid unnecessary mallocs
[nit.git] / lib / gamnit / gamnit.nit
index 41bfb37..bd26cbd 100644 (file)
@@ -36,6 +36,13 @@ redef class App
                var display = new GamnitDisplay
                display.setup
                self.display = display
+
+               # Print the current GL configuration, for debugging
+               print "GL vendor: {glGetString(gl_VENDOR)}"
+               print "GL renderer: {glGetString(gl_RENDERER)}"
+               print "GL version: {glGetString(gl_VERSION)}"
+               print "GLSL version: {glGetString(gl_SHADING_LANGUAGE_VERSION)}"
+               print "GL extensions: {glGetString(gl_EXTENSIONS)}"
        end
 
        # Core of the frame logic, executed only when the display is visible
@@ -77,12 +84,9 @@ redef class App
        # The instances passed as `event` may be freed (or overwritten),
        # right after this method returns. They should not be preserved.
        fun accept_event(event: InputEvent): Bool do return false
-end
 
-redef class Sys
-       redef fun run
-       do
-               if "NIT_TESTING".environ == "true" then exit 0
-               super
-       end
+       # The window has been resized by the user or system
+       #
+       # The framework handles resizing the viewport automatically.
+       fun on_resize(display: GamnitDisplay) do end
 end