X-Git-Url: http://nitlanguage.org diff --git a/lib/gamnit/gamnit.nit b/lib/gamnit/gamnit.nit index 3051553..c1ecc86 100644 --- a/lib/gamnit/gamnit.nit +++ b/lib/gamnit/gamnit.nit @@ -23,6 +23,8 @@ import programs import gamnit_android is conditional(android) import gamnit_linux is conditional(linux) +import gamnit_ios is conditional(ios) +import input_ios is conditional(ios) redef class App @@ -33,7 +35,16 @@ redef class App # # The gamnit services redefine this method to prepare optimizations and more. # Clients may also refine this method to prepare custom OpenGL resources. - fun create_gamnit + fun create_gamnit do end + + # Hook to prepare for recreating the OpenGL context + # + # Some gamnit services refine this method to reset caches before the + # next call to `create_gamnit`. + fun recreate_gamnit do end + + # Create and set `self.display` + fun create_display do var display = new GamnitDisplay display.setup @@ -45,6 +56,7 @@ redef class App print "GL version: {glGetString(gl_VERSION)}" print "GLSL version: {glGetString(gl_SHADING_LANGUAGE_VERSION)}" print "GL extensions: {glGetString(gl_EXTENSIONS)}" + print "GL max texture size: {glGetIntegerv(gl_MAX_TEXTURE_SIZE, 0)}" end # Hook for client programs to setup the scene @@ -101,3 +113,8 @@ redef class App # The framework handles resizing the viewport automatically. fun on_resize(display: GamnitDisplay) do end end + +# Portable indirection to `glBindFramebuffer(gl_FRAMEBUFFER, fbo)` +# +# This is implemented differently on iOS. +fun bind_screen_framebuffer(fbo: Int) do glBindFramebuffer(gl_FRAMEBUFFER, fbo)