-=ULTRA URGENT=- Need Help

Well, i am beginning to make an 3D engine in dehpli (i didn 't have the choice) and i have a big problem:

When i call SwapBuffers(h_DC) in my rendering loop, my app crash!!

Let’s see some informations:


Dumping PIXELFORMATDESCRIPTOR
…nSize = 40
…nVersion = 1
…dwFlags = PFD_DRAW_TO_WINDOW PFD_SUPPORT_OPENGL PFD_DOUBLEBUFFER
…iPixelType = PFD_TYPE_RGBA
…cColorBits = 32
…cRedBits = 8
…cRedShift = 16
…cGreenBits = 8
…cGreenShift = 8
…cBlueBits = 8
…cBlueShift = 0
…cAlphaBits = 0
…cAlphaShift = 0
…cAccumBits = 64
…cAccumRedBits = 16
…cAccumGreenBits = 16
…cAccumBlueBits = 16
…cAccumAlphaBits = 16
…cDepthBits = 24
…cStencilBits = 0
…cAuxBuffers = 0
…iLayerType = PFD_MAIN_PLANE
…bReserved = 0
…dwLayerMask = 0
…dwVisibleMask = 0
…dwDamageMask = 0
Done

NVIDIA Corporation
GeForce2 GTS/AGP/3DNOW!
1.2.1

And the main loop of my thread:

///////////////////////////
function MsgLoop():Integer;
var
bResult : BOOL;
begin
// Entry point of the thread

// Core
while (TRUE) do
begin

// End thread?
if (bMustTerminate = TRUE) then
  break;

// Intern authorization
if (bCanRender <> TRUE) then
  continue;

// Render 3D Game
// Clear The Screen And The Depth Buffer
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);

// Reset The View
//glLoadIdentity();

// Draw Menu
//T_P_PROCEDURE(HookData.pfnUI_DrawMenu);

// ++DEBUG++
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_QUADS);
  glVertex3f(-1.0, -1.0, 10);
  glVertex3f(-1.0,  1.0, 10);
  glVertex3f( 1.0,  1.0, 10);
  glVertex3f( 1.0, -1.0, 10);
glEnd();

//SwapBuffer
bResult := SwapBuffers(OpenGlRenderingContext.h_DC);

end;

Result := 0;
end;

My card is a Geforce 2 GTS (see log upper).
I use Delphi 5 on a thunderbird 750 with 128Mo.

I really don’t understand the problem, so if somebody could help me, please!!! I have to show the state of myprject in a couple of days!!!

thanks by advance.

NB : excuse me for my english, but i’m french…

Without having checked your code, try disable integrated debugging.

Tools->Enviroment options->Preferences->Integrated debugging

…cAccumBits = 64
…cAccumRedBits = 16
…cAccumGreenBits = 16
…cAccumBlueBits = 16
…cAccumAlphaBits = 16

64bit accumulation buffer?!?! Is that right?

  • Nutty

Yes, most accumulation buffer implementations use 64 bits. (a signed 16-bit value per component)

  • Matt

oh!

Oki, i solve the problem…now i call wglMakeCurrent(hDC, hGLRC) at the begining of my loop and wglMakeCurrent(0, 0) at the end…

BUT I HAVE ANOTHER PROBLEM!!!

I can’t use the glGenTextures(1, @Tex). glGetError answer me :

GL_INVALID_ENUM and GL_INVALID_OPERATION

So i tried to look in the MSDN but i didn’t find enough informations to debug this. So i ask to you if you don’t have a ‘trick’ wich can help me…

Thanks by advance.