Re: pfTexture and gl

New Message Reply Date view Thread view Subject view Author view

From: Devrim Erdem (devrim++at++infotron.com.tr)
Date: 06/02/2000 07:49:39


> This should work. You can verify the texture handle by calling
>
> glIsTexture( handle );
>
> What may be hapenning is that the bind may be overwritten by a subsequent call
> to bind. Use OGLdebug.

glIsTexture returns GL_FALSE indicating that it is not a valid texture. What could
cause the overwrite ? I am constructing and loading the texture just before the
simulation main loop. The post draw is sth like this :

void CameraPostDraw(void *chan, void *data)
{
   char str[255];
   GLint circle_points = 100, i;
   float angle;
   int l, r, b, t, width, height;

   pfPushState (); /* Save the current state */
   pfBasicState (); /* Switch to default state */
   pfPushIdentMatrix();

   vgGetWinSize(vgGetWin(0), &l, &r, &b, &t);
   width = r-l;
   height = t-b;

   /* Orthographic Projection */
   glMatrixMode(GL_PROJECTION);
   glLoadIdentity();
   gluOrtho2D(-0.5, width-0.5, -0.5, height-0.5);

   glMatrixMode(GL_MODELVIEW);

   glColor3f(1.0, 0.0, 0.0);
   glTranslatef(350, 350, 0.0f);
   glScalef(150, 50, 1);

   glBindTextureEXT( GL_TEXTURE_2D, texName );
   glBegin(GL_QUADS);
   glTexCoord2f(1.0f, 1.0f); glVertex3f(+1, 1, 1);
   glTexCoord2f(0.0f, 1.0f); glVertex3f(-1, 1, 1);
   glTexCoord2f(0.0f, 0.0f); glVertex3f(-1, -1, 1);
   glTexCoord2f(1.0f, 0.0f); glVertex3f(+1, -1, 1);
   glEnd();

   pfPopMatrix();
   pfPopState();
}

/*===============================================
M. Devrim Erdem devrim++at++infotron.com.tr
Software Engineering

info(+)TRON, Turkey
Tel: +90 216 4921002, Ext 138
Fax: +90 216 3432132
http://www.infotron-tr.com
http://abone.turk.net/mderdem
===============================================*/


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Jun 02 2000 - 07:45:58 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.