PDA

View Full Version : Auxiliary buffer problem ?



AngelT
03-31-2005, 12:18 PM
Hi
Sorry, my english is bad.

I have a problem with auxiliary buffers in OpenGL. I tested with GeForce2 and GeForce4 cards. Both cards have 4 auxiliary buffer. The problem: the raster functions don't work in AUX0 buffer and no error report. For example: funcion glBitmap.

Here is the code in Delphi. The line with {###} don't work. I test in Windows 2K/XP

Any idea?

{BEGIN CODE ////////////}

const
cRasterCross : array [0..19] of Byte = ($c0, $c0, $e1, $c0, $73, $80, $3f,
$0, $1e, $0, $1e, $0, $3f, $0, $73, $80, $e1, $c0, $c0, $c0);

begin
glDrawBuffer(GL_AUX0);

glClearColor(1.0, 1.0, 1.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);

glColor3ub($FF, $0, $0);

// *** Raster ***
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glRasterPos2f(0 {xPos}, 0 {yPos});
// {### The next function DON'T WORK! }
glBitmap(10, 10, 0, 0, 0, 0, @cRasterCross[0]);

// *** Line work OK ***
glBegin(GL_LINES);
glVertex3f(0, 0, 0);
glVertex3f(1, 1, 0);
glEnd;

// Now, draw in BACK buffer
glDrawBuffer(GL_BACK);

// Copy pixles AUX0 to BACK (work OK)
glReadBuffer(GL_AUX0);
glRasterPos2f(-1, -1);
glCopyPixels(0, 0, ClientWidth, ClientHeight, GL_COLOR);

glFlush;
SwapBuffers(glDC); // BACK to FRONT (work OK}

// Show Error
Caption := gluErrorString(glGetError);
end;

{END CODE ////////////}