PDA

View Full Version : 2D OpenGL questions



04-30-2001, 07:36 AM
Hey everyone,

I am trying to draw an image into the auxillary buffer so that I do not have to redraw it everytime it is displayed to the screen. The documentation in the RedBook says this should work. But, it doesn't seem to be working. http://www.opengl.org/discussion_boards/ubb/confused.gif

Here is the portion of code i'm having troubles with: http://www.opengl.org/discussion_boards/ubb/mad.gif

void __fastcall TFormMain: http://www.opengl.org/discussion_boards/ubb/biggrin.gifrawObjects()
{
// the portion in this if is only done once
if(init)
{
glLoadIdentity();
glDrawBuffer(GL_AUX1);
glTranslatef(320, 240, 0);
glTranslatef(-320, -240, 0);
DrawCsmMap("vms2d.csm", 0); // a draw
// function of my own
init = false;
}
glReadBuffer(GL_AUX1);
glDrawBuffer(GL_BACK);
glCopyPixels(0, 0, 640, 480, GL_COLOR);
}

I know i'm a rookie and this code my be funny to some of you. But if anybody could send me in the right direction, I would greatly appreciate it. http://www.opengl.org/discussion_boards/ubb/biggrin.gif

Mig

Bob
05-01-2001, 09:36 AM
Are you sure you have an auxiliary buffer at all? Or are you writing to the wrong buffer? You are writing to the second auxiliary buffer, in case you made the mistake thinking GL_AUX1 is the first one, GL_AUX0 is.