Windows Phone 8 Programming Considerations

OpenGL ES 2.0 Support

Marmalade supports the Open GL ES 2.0 Graphics API on Windows Phone 8 using a GL ES -> DirectX translation layer. It is not necessary to use the DirectX Graphics API directly. With Marmalade you can use GL ES directly (See s3eGL) or use IwGL (See IwGL) which is thin wrapper on top of s3eGL or you could use a higher level library like IwGx (See IwGx).

OpenGL ES 1.x is NOT supported.

Shader Support

Run-time shader compilation is not supported on Windows Phone 8. This is a restriction of the platform itself. Instead precompiled shader or program binaries must be loaded.

See s3eGL on Windows Phone 8 for more details.

Handling the Back button

Developers need to handle the Back button in their application explicitly by detecting if the s3eKeyBack event. See the S3E Keyboard API reference for more details. The Windows Phone 8 Certification Requirements detail how applications must handle the Back button. The requirements include:

  • 5.2.4.1 - Back button: previous pages. Pressing the Back button must return the app to the previous page or return to any previous page within the back stack.
  • 5.2.4.2 - Back button: first screen. Pressing the Back button from the first screen of an app must close the app.

These requirements also apply to applications written in GLES which do not use native UI controls. In this case the Back button shoud go back through the conceptual pages of the application.

 

Performance overhead when updating vertex data

It is recommended to avoid uploading vertex attribute arrays every frame and instead use vertex buffer objects (VBOs). Minimise the updating of vertex data where possible.

s3eSurface

Use of the s3eSurface API is generally not recommended for rendering and should only be used for debugging purposes. s3eSurface rendering will not work while OpenGL ES is initialised.

Orientation Support

Currently only fixed Portrait and fixed Landscape are supported by Marmalade via the DispFixRot icf setting. The screen device for Windows Phone 8 devices do not change dimensions when the orientation changed. This means that for GLES code the developer should check for the surface orientation using the s3eSurfaceGetInt(S3E_SURFACE_BLIT_DIRECTION) API and then apply any necessary rotation to the GLES device context view.

Memory Limits

App memory is capped to a value that is dependant on the type of phone, the type of application and certain Manifest file settings. The smallest cap is 150 MB, the highest cap is 380 MB. See App memory limits for Windows Phone 8 for more details.

posted @ 2013-08-13 10:37  小糊涂的超级blog  阅读(5721)  评论(0编辑  收藏  举报