PDA

View Full Version : problems with WGL_ARB_render_texture



wedge
05-21-2002, 09:51 AM
hello

i have the problem:

when i use RenderToTexture as texture no other Texture are Displays
it do not use the other texture he draws the other Fragments without
texture. But he draws it with color.

I have tryed many and read the spec sometimes but I have not found the bug

Do I have something forget something?
Please help me. THX.

I have win2k, GF4TI440, detonator 28.32

here a part of the source


create buffer->

atribute setzen
wglChoosePixelFormatARB(oldHdc, iAttributes, fAttributes, MAX_PFORMATS, pformat, &nformats))

atribute setzen
wglCreatePbufferARB(oldHdc, format, width, height, iAttributes);
wglGetPbufferDCARB(buffer);

wglCreateContext(hdc)
wglShareLists(oldHglrc, hglrc)

wglQueryPbufferARB(buffer, WGL_PBUFFER_WIDTH_ARB, &width);
wglQueryPbufferARB(buffer, WGL_PBUFFER_HEIGHT_ARB, &height);
...

wglMakeCurrent(hdc, hglrc)
drawTexture();
wglMakeCurrent(oldHdc, oldHglrc)
...

wglBindTexImageARB (buffer, WGL_FRONT_LEFT_ARB);


glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);

glTranslated(+7, 7,0);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glBegin (GL_QUADS);
glTexCoord2d(1.0,1.0); glColor3f (1.f, 1.f, 0.f); glVertex3f( 1.0f, 1.0f, 0.0f);
glTexCoord2d(0.0,1.0); glColor3f (1.f, 1.f, 1.f); glVertex3f(-1.0f, 1.0f, 0.0f);
glTexCoord2d(0.0,0.0); glColor3f (0.f, 1.f, 1.f); glVertex3f(-1.0f,-1.0f, 0.0f);
glTexCoord2d(1.0,0.0); glColor3f (1.f, 1.f, 1.f); glVertex3f( 1.0f,-1.0f, 0.0f);
glEnd ();

wglReleaseTexImageARB(buffer, WGL_FRONT_LEFT_ARB)



glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, TexId1);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTranslated(+7, 7,0);

glBegin (GL_QUADS);
glTexCoord2d(1.0,1.0); glColor3f (1.f, 1.f, 0.f); glVertex3f( 1.0f, 1.0f, 0.0f);
glTexCoord2d(0.0,1.0); glColor3f (1.f, 1.f, 1.f); glVertex3f(-1.0f, 1.0f, 0.0f);
glTexCoord2d(0.0,0.0); glColor3f (0.f, 1.f, 1.f); glVertex3f(-1.0f,-1.0f, 0.0f);
glTexCoord2d(1.0,0.0); glColor3f (1.f, 1.f, 1.f); glVertex3f( 1.0f,-1.0f, 0.0f);
glEnd ();