mobile opengl game porting to tizen hands on experience
play

Mobile OpenGL game porting to Tizen: hands-on experience Yuriy - PowerPoint PPT Presentation

Mobile OpenGL game porting to Tizen: hands-on experience Yuriy Ushakov (XenZu Technologies) bizdev@xenzu.com World Cup Table Tennis l Arcade game l 2-player game modes 2 Android application structure Android (Java) User Interface


  1. Mobile OpenGL game porting to Tizen: hands-on experience Yuriy Ushakov (XenZu Technologies) bizdev@xenzu.com

  2. World Cup Table Tennis l Arcade game l 2-player game modes 2

  3. Android application structure Android (Java) User Interface Android NDK (C++) OpenGL context while{ } render() { EnterFrame(); Sound Player ExitFrame(); RenderScene(); } Animated text 3

  4. Building Game Core for Tizen Android (Java) Game Core (NDK, C++) 4

  5. Building Game Core for Tizen Android (Java) Game Core (NDK, C++) Tizen Build 5

  6. Tizen OpenGL application Form-based Frame-based Frame Frame Form 3 Form 1 OpenGL context Overlaying controls Splash Screen Form 2 UI menus Overlaying Tizen controls 6

  7. OpenGL texture loading (Android) Android (Java) for(int id = 0; id < num_of_textures; id++) initWithImage(id) { { inittexture(id); Bitmap *bmp = GetBitmapN(id); } handleBitmap(bmp); glTexImage2D(..., bmp); delete bmp; } Android NDK (C++) inittexture(id); { glGenTextures(1, name); glBindTexture(..., *name); initWithImage(id); } 7

  8. Tizen application structure Sound Thread Main Thread WcttTzApp Sound Player GameThread MainActivity : Form : EventDrivenThread Renderer Main Menu : IGlRenderer Scores Options OpenGL form : Form Team Selection Paddle Selection MsgSender : Event 8

  9. Tizen application structure: GameThread class Sound Thread Main Thread WcttTzApp Sound Player GameThread MainActivity : Form : EventDrivenThread Renderer Main Menu : IGlRenderer Scores Options OpenGL form : Form Team Selection Paddle Selection MsgSender : Event 9

  10. Separate game thread (workaround for an early F/W ver.) l Allowed FPS rate increase l Caused synchronization problem Main Thread Rendering Thread WcttTzApp GameThread while(); while(); { { d r a w render(); glFlush(); _openGlForm->Invalidate(); } } ~70 Hz ~20 Hz 10

  11. Tizen application structure Sound Thread Main Thread WcttTzApp Sound Player GameThread MainActivity : Form : EventDrivenThread Renderer Main Menu : IGlRenderer Scores Options OpenGL form : Form Team Selection Paddle Selection MsgSender : Event 11

  12. Tizen application structure: MainActivity class Sound Thread Main Thread WcttTzApp Sound Player GameThread MainActivity : Form : EventDrivenThread Renderer Main Menu : IGlRenderer Scores Options OpenGL form : Form Team Selection Paddle Selection MsgSender : Event 12

  13. Issue of a blank WebView AddControl(web_view) In 1-2 seconds... 13

  14. Tizen application structure: SoundPlayer class Sound Thread Main Thread WcttTzApp SoundPlayer GameThread MainActivity : Form : EventDrivenThread Renderer Main Menu : IGlRenderer Scores Options OpenGL form : Form Team Selection Paddle Selection MsgSender : Event 14

  15. Sound Player use options l Playing mp3 and other compressed formats l Playing a number of sounds simultaneosly Tizen::Media::Player player[64]; Tizen::Media::Player player; for(int i = 0; i < 63; i++) // Maximal delay { player.OpenFile(path); player[i].OpenBuffer(buffer[i]); player.Play(); } // Minimal delay. // Lower delay // Playing simultaneously player.OpenBuffer(buffer); player[2].Play(); player.Play(); player[0].Play(); player[1].Play(); player[3].Play(); 15

  16. Playing sound l If one needs to play a sound “sound_id” l Low number of players l High number of players 1 If player is free: 1 Open buffers in advance: player.OpenBuffer(buffer[sound_id]); player[0].OpenBuffer(buffer[sound_0]); player.Play(); ... Exit. player[N].OpenBuffer(buffer[sound_N]); 2 Play sound in prepared player: 2 Otherwise, choose another player. player[sound_id].Play(); Go to step 1. 16

  17. Tizen application structure: MsgSender class Sound Thread Main Thread WcttTzApp SoundPlayer GameThread MainActivity : Form : EventDrivenThread Renderer Main Menu : IGlRenderer Scores Options OpenGL form : Form Team Selection Paddle Selection MsgSender : Event 17

  18. Summary l Relatively simple porting of C++ OpenGL code to Tizen l Rich Tizen::Ui namespace for implementation of complex animated user interfaces l Developer friendly Tizen::Media::Player class for mixed sounds playing 18

  19. Q & A XenZu Technologies www.xenzu.com bizdev@xenzu.com 19

Recommend


More recommend