RE: OpenGL texture problems

New Message Reply Date view Thread view Subject view Author view

From: Sylvain Mayer (mayer++at++CAE.CA)
Date: 10/05/2000 10:26:20


Hi,

did you use glGenTextures to generate the texture name? I did the same
thing and it worked out well. Here is what I did (the main idea):

Init time:
  glGenTextures(1, texture)

Post Draw time:
  // copy frame buffer to texture
  glBindTextureEXT(GL_TEXTURE_2D,texture[1]);
  glCopyTexSubImage2DEXT(GL_TEXTURE_2D, 0, 0, 0, 0, 0, sizeX, sizeY);

  // draw textured quad with frame buffer texture
  pfPushIdentMatrix();
  pfEnable(PFEN_TEXTURE);
  glEnable(GL_TEXTURE_2D);
  glBindTextureEXT(GL_TEXTURE_2D,texture[1]);
  glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
  glBegin(GL_QUADS);
  glColor4f(1.0f,1.0f,1.0f,1.0f);
  glTexCoord2f(0.0f,0.0f); glVertex2f(-1.0f,-1.0f);
  glTexCoord2f(1.0f,0.0f); glVertex2f(1.007f,-1.0f);
  glTexCoord2f(1.0f,1.0f); glVertex2f(1.007f,1.005f);
  glTexCoord2f(0.0f,1.0f); glVertex2f(-1.0f,1.005f);
  glEnd();

regards, Sylvain
________________________________________
Sylvain Mayer, 3D Graphics Developer
Scene Graph Manager
Visual Systems Engineering
CAE Electronics (http://www.cae.ca)
mailto:mayer++at++cae.ca
Tel: (514) 341-6780 Ext.: 3065
Fax: (514) 340-5539

*** For the latest Vis-Sim related info check out:
http://www.vis-sim.org

> -----Original Message-----
> From: Alan Freeman [mailto:alan_freemann++at++hotmail.com]
> Sent: Thursday, October 05, 2000 11:19 AM
> To: info-performer++at++sgi.com
> Subject: OpenGL texture problems
>
>
> Hi Performers
>
> I'm writing a performer app that renders a scene. then uses glReadPixels
to
> grab what is in a section of the framebuffer, into a section memory I'm
> allocation specificaly. I then try to draw a quad over another section of
the channel
> (using OpenGL calls) using the data I got from glReadPixels as a texture.
>
> It all works fine, except the texture I read from the framebuffer gets
> applied to one of the textures in the performer app (I'm using Performer
> town, and one of the tree textures gets replaced..)
>
> Any idea as to how I should stop the texture getting back into the
performer
> rendering???
>
> cheers
>
> Alan


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Oct 05 2000 - 10:28:26 PDT

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