# Why does my CPVRTPrint3D SetTextures always fail?

**URL:** <https://forums.imgtec.com/t/why-does-my-cpvrtprint3d-settextures-always-fail/732>\
**Category:** PowerVR Insider\
**Created:** [June 15, 2010, 7:26pm UTC](https://forums.imgtec.com/t/why-does-my-cpvrtprint3d-settextures-always-fail/732 "2010-06-15T19:26:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![renaissance](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@renaissance](https://forums.imgtec.com/u/renaissance)\
**Post date:** [June 15, 2010, 7:26pm UTC](https://forums.imgtec.com/t/why-does-my-cpvrtprint3d-settextures-always-fail/732/1 "2010-06-15T19:26:01Z")

</div>

In my code,

I put following in the ReleaseView()
  

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

&nbsp;
  

I put following in the InitView()
  

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

&nbsp;
  

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

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

&nbsp;
  

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?
  

&nbsp;
  

THank you very much!
  

&nbsp;
  

Renaissance

---

<div class="post-metadata">

**Author:** ![Scott](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/scott/32/256_2.png) [@Scott](https://forums.imgtec.com/u/Scott)\
**Post date:** [June 16, 2010, 7:09am UTC](https://forums.imgtec.com/t/why-does-my-cpvrtprint3d-settextures-always-fail/732/2 "2010-06-16T07:09:18Z")

</div>

Hi,
  

&nbsp;
  

Your line for SetTextures should be
  

&nbsp;
  

Code:

if(gsMyPrint3D.SetTextures(0,PVRShellGet(prefWidth),PVRShellGet(prefHeight)) != PVR\_SUCCESS)&nbsp;&nbsp;

  

&nbsp;
  

instead of
  

&nbsp;
  

Code:

if(!gsMyPrint3D.SetTextures(0,PVRShellGet(prefWidth),PVRShellGet(prefHeight)))&nbsp;&nbsp;

  

&nbsp;
  

as SetTextures returns&nbsp;zero (PVR\_SUCCESS) on success and not on failure.
  

&nbsp;
  

Thanks,
  

&nbsp;
  

Scott
  

&nbsp;

---

<div class="post-metadata">

**Author:** ![renaissance](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@renaissance](https://forums.imgtec.com/u/renaissance)\
**Post date:** [June 16, 2010, 3:03pm UTC](https://forums.imgtec.com/t/why-does-my-cpvrtprint3d-settextures-always-fail/732/3 "2010-06-16T15:03:29Z")

</div>

Thanks a lot, Scott.
