Re: OpenGL and SwapBuffers behavior
- From: "Bill Carson" <bcarson892003@xxxxxxxxx>
- Date: 8 Apr 2007 07:34:07 -0700
Just draw to your pbuffer as normal. Then copy this to a texture
you've created:
glBindTexture(GL_TEXTURE_2D, texture);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, width(), height());
Then when you want to draw this texture, first enable it:
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, texture);
set up your coordinate system etc. then draw it using something like the following:
glColor4f(1.0, 1.0, 1.0, 0.0);
glBegin(GL_QUADS);
glTexCoord2f(0.0, 0.0); glVertex2i(m_World.left(), m_World.bottom());
glTexCoord2f(1.0, 0.0); glVertex2i(m_World.right(), m_World.bottom());
glTexCoord2f(1.0, 1.0); glVertex2i(m_World.right(), m_World.top());
glTexCoord2f(0.0, 1.0); glVertex2i(m_World.left(), m_World.top());
glEnd();
also look at GL_TEXTURE_RECTANGLE_ARB if you normally draw to a viewport
that is not square and a power of 2.
Well, I hammered away at it without success, because I am not giving
glCopyTexImage2D power of 2 limits when I feed it the zoom extents
I pick with my rubber band rectangle. And, I investigated
GL_TEXTURE_RECTANGLE_ARB and found my current drivers for
my NVIDIA graphics board don't support it.
So, I have downloaded the current drivers from NVIDIA which do support
non power of 2 rectangles, and am working up the courage to install
them!
Thanks,
B.C.
.
- References:
- OpenGL and SwapBuffers behavior
- From: Bill Carson
- Re: OpenGL and SwapBuffers behavior
- From: jbwest
- Re: OpenGL and SwapBuffers behavior
- From: Bill Carson
- Re: OpenGL and SwapBuffers behavior
- From: Keith S.
- Re: OpenGL and SwapBuffers behavior
- From: Bill Carson
- Re: OpenGL and SwapBuffers behavior
- From: Keith S.
- OpenGL and SwapBuffers behavior
- Prev by Date: Re: depth buffer
- Next by Date: Re: OpenGL and SwapBuffers behavior
- Previous by thread: Re: OpenGL and SwapBuffers behavior
- Next by thread: Re: OpenGL and SwapBuffers behavior
- Index(es):
Relevant Pages
|
Loading