Imagination PowerVR SDK Blog

Why does my CPVRTPrint3D SetTextures always fail?


#1

In my code,

I put following in the ReleaseView()

    /* Release the Print3D textures and windows */  
    gsMyPrint3D.DeleteAllWindows();  
    gsMyPrint3D.ReleaseTextures();

 

I put following in the InitView()

    /* Init Print3D to display text on screen */  
    if(!gsMyPrint3D.SetTextures(0,PVRShellGet(prefWidth),PVRShellGet(prefHeight)))  
    {  
        PVRShellSet(prefExitMessage, "ERROR: Failed to initialise Print3Dn");  
        return false;  
    }

 

I put following in the RenderScene() (I also used FragShader and vertshader on a special 3D object in the current window before print out text)

    /* Print text on screen */  
    gsMyPrint3D.DisplayDefaultTitle("Test", "First test with PVRTC", ePVRTPrint3DLogoIMG);      
    /* Flush all Print3D commands */  
    gsMyPrint3D.Flush();

 

But my program always exit with "ERROR: Failed to initialise Print3Dn". In other word, the SetTextures function always return PVR_FAIL.

Could anyone give me a hint why the SetTextures is not working correctly?

 

THank you very much!

 

Renaissance

#2
Hi,

 

Your line for SetTextures should be

 

Code:
if(gsMyPrint3D.SetTextures(0,PVRShellGet(prefWidth),PVRShellGet(prefHeight)) != PVR_SUCCESS)  

 

instead of

 

Code:
if(!gsMyPrint3D.SetTextures(0,PVRShellGet(prefWidth),PVRShellGet(prefHeight)))  

 

as SetTextures returns zero (PVR_SUCCESS) on success and not on failure.

 

Thanks,

 

Scott

 

#3

Thanks a lot, Scott.