About Store Forum Documentation Contact



Post Reply 
[Android] Render with background
Author Message
cmontiel Offline
Member

Post: #1
[Android] Render with background
Hi, i just bougth the Personal License this week to test the mobile sdk.

I'm trying run "Combining render with background" tutorial in Android.

Code:
/******************************************************************************/
#include "stdafx.h"
/******************************************************************************/
Image logo;
/******************************************************************************/
void InitPre()
{
    App.flag=APP_AUTO_FREE_OPEN_GL_ES_DATA|APP_AUTO_FREE_PHYS_BODY_HELPER_DATA|​APP_AUTO_PARTICLES_CONVERT_BLEND; // these are the recommended flags for Mobile devices

   // when adding paks pay attention to upper/lower case of the file names
    Paks.add("engine.pak.jet");
}
/******************************************************************************/
Bool Init()
{
     Cam.dist=1;
          Cam.yaw=PI;

   logo.Import("logo.png", -1, IMAGE_2D, 1);

   return true;
}
/******************************************************************************/
void Shut()
{
}
/******************************************************************************/
Bool Update()
{

   REPA(Touches)
      {
       if(i == 0 )
       {
         Cam.yaw  -=Touches[i].d().x;
         Cam.pitch+=Touches[i].d().y;
       }
       else if(i == 1)
       {
         Cam.dist+=Touches[i].d().x;
       }
      }
   CamHandle(0.1f, 100, CAMH_ZOOM|CAMH_ROT);

   return true;
}
/******************************************************************************/
void Render()
{
     switch(Renderer())
       {
          case RM_PREPARE:
          {
             Meshes("body.mesh")->draw(MatrixIdentity);

             LightPoint(5, Vec(0,1,1)).add();
          }break;
       }
}
void Draw()
{
     // setup background
       D.clear();
       logo.drawFs();
       Rect_C(0, 0, D.w()*2, D.h()*2).draw(Color(255,255,255,192));

       // enable/disable combine mode before/after calling the renderer
         Renderer.combine=true ;
         Renderer(Render);
         Renderer.combine=false;


}
/******************************************************************************/

It looks like something doesn't work with OpenGL ES. I get a black screen. Rendering only the image OR only body.mesh it works well...

Am I doing something wrong?

Sorry about my english,I'll try not to make many mistakes typing. pfft

IRC: irc.freenode.net
Channel: #Esenthel
03-05-2012 04:46 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: [Android] Render with background
Hello,

OpenGL ES has some limitations and this is currently not supported, but I will add this to the roadmap (soon), as a workaround.
03-05-2012 01:50 PM
Find all posts by this user Quote this message in a reply
cmontiel Offline
Member

Post: #3
RE: [Android] Render with background
Thanks!

IRC: irc.freenode.net
Channel: #Esenthel
03-05-2012 03:03 PM
Find all posts by this user Quote this message in a reply
Post Reply