Merge: nitc: check pkg-config packages availability later
[nit.git] / lib / gamnit / gamnit_ios.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 # Support services for gamnit on iOS
16 module gamnit_ios
17
18 import ios
19 import gamnit
20
21 import ios::assets
22
23 redef class App
24 redef fun did_finish_launching_with_options
25 do
26 create_gamnit
27 create_scene
28 return super
29 end
30
31 # Disable the game loop to rely on the GLKView callbacks on each frame instead
32 redef fun run do end
33
34 private fun frame_full_indirect do frame_full
35 end
36
37 redef class GamnitGLKView
38 redef fun update do app.frame_full_indirect
39 end
40
41 redef fun bind_screen_framebuffer(fbo)
42 do
43 var display = app.display
44 assert display != null
45 display.glk_view.bind_drawable
46 end