# PVRVFrame - bug - ES 1.x - glTexImage2D

**URL:** <https://forums.imgtec.com/t/pvrvframe-bug-es-1-x-glteximage2d/1232>\
**Category:** PowerVR Insider\
**Tags:** pvrvframe\
**Created:** [November 4, 2011, 9:43am UTC](https://forums.imgtec.com/t/pvrvframe-bug-es-1-x-glteximage2d/1232 "2011-11-04T09:43:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![diafera](https://avatars.discourse-cdn.com/v4/letter/d/898d66/32.png) [@diafera](https://forums.imgtec.com/u/diafera)\
**Post date:** [November 4, 2011, 9:43am UTC](https://forums.imgtec.com/t/pvrvframe-bug-es-1-x-glteximage2d/1232/1 "2011-11-04T09:43:11Z")

</div>

Using PVRVFrame 2.09.29.0649for OpenGL ES 1.1, I have reproduced some strange bugs: glTexImage2D reports unjustified gl errors (see below). The bugs can also be reproduced with PVRVFrame 2.08._._  
  
_The steps to reproduce:  
&nbsp; 1. Create EGL context  
&nbsp; 2. Push 2 matrices on GL\_MODELVIEW stack  
&nbsp; 3. Destroy EGL context  
&nbsp; 4. Create new EGL context  
&nbsp; 5. Notice that GL\_MODELVIEW\_STACK\_DEPTH returns 3 !  
&nbsp; 6. Pop 2 matrices from GL\_MODELVIEW stack (no error is reported)  
&nbsp; 7. A valid call for glTexImage2D (with a valid texture 2d binded)  
\<!–if gte mso 10\>_  
  
_\<\>_  
  
_/_ Style Definitions \*/  
  
table.MsoNormalTable  
  
{mso-style-name:“Table Normal”;  
  
mso-tstyle-rowband-size:0;  
  
mso-tstyle-colband-size:0;  
  
mso-style-noshow:yes;  
  
mso-style-priority:99;  
  
mso-style-parent:"";  
  
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;  
  
mso-para-margin:0cm;  
  
mso-para-margin-bottom:.0001pt;  
  
mso-pagination:widow-orphan;  
  
font-size:10.0pt;  
  
font-family:“Times New Roman”,“serif”;}

 

Code:

glTexImage2D(GL\_TEXTURE\_2D, 0, GL\_RGBA, 512, 512, 0, GL\_RGBA, GL\_UNSIGNED\_BYTE, data)

  fails with GL\_STACK\_UNDERFLOW (note that before the call, glGetError returned GL\_NO\_ERROR).  
  
Two issues to be noticed here:  
&nbsp; 1. The matrix stack seems to be static -- it is not reset for the new GL context.  
&nbsp; 2. glTexImage2D is affected by an error that doesn't have anything to do with glTexImage2D parameters.  
  
Sometimes, I get GL\_INVALID\_ENUM in valid calls for glTexImage2D (and that even without recreating the GL context).  
  
If this is indeed a genuine issue in the PVRVFrame implementation, can someone advise how can I implement a workaround for it (until will be fixed)?
