gamnit: print current config and list extensions
authorAlexis Laferrière <alexis.laf@xymus.net>
Wed, 16 Aug 2017 02:29:22 +0000 (22:29 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Sat, 19 Aug 2017 21:08:39 +0000 (17:08 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/gamnit/display.nit
lib/gamnit/gamnit.nit

index 2b694c6..868b359 100644 (file)
@@ -72,4 +72,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
index fccf2ae..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