when i use PFD_DOUBLEBUFFER the window is gray, without its the normal black starting scene.
whats that?
there some inits necessary?
thx.
when i use PFD_DOUBLEBUFFER the window is gray, without its the normal black starting scene.
whats that?
there some inits necessary?
thx.
Did you setup everything?
Do you have a current Rendering Context?
Do you call SwapBuffers or wglSwapLayerBuffers?
if your problem is one of these ok else I don’t know. I’m more beginner than you
i have RC and DC. and it works (without doublebuffer).
using glFlush to to draw the scene but with
swapbuffers there is the same problem!?
Mmmmh…
can I see you pixel format?
its Delphi-Source (nearly the same)
// there are my variables
var pfd : TPixelFormatDescriptor;
nPixelFormat : Integer;
// and here it start
begin
// set the whole pfd = 0
FillChar(pfd, SizeOf(pfd), 0);
with pfd do
begin
nSize := SizeOf(pfd);
nVersion := 1;
dwFlags := PFD_DRAW_TO_WINDOW or
FD_SUPPORT_OPENGL
or PFD_DOUBLEBUFFER;
iPixelType := PFD_TYPE_RGBA;
cColorBits := 24;
cDepthBits := 32;
iLayerType := PFD_MAIN_PLANE;
end;
nPixelFormat := ChoosePixelFormat(Handle, @pfd);
SetPixelFormat(Handle, nPixelFormat, @pfd);
This may sound like a silly question, but are you drawing to the back buffer? In other words, do you have the following in your code before you start drawing:
glDrawBuffer(GL_BACK);
Or, more to the point, since I think this is the default for double buffered rendering contexts, did you make sure to NOT call:
glDrawBuffer(GL_FRONT);
–Travis Cobbs
[This message has been edited by tcobbs (edited 02-11-2002).]
It doesn’t work with glDrawBuffer(…)
Problem is not that there is nothing show on the black black start-screen, problem is:
NO INITIALIZATION FOR THE BLACKSCREEN!
and so on NO BLACKSCREEN.
i’m so frustrated;
You are talking about a black start screen… To guarantee that you really get a black screen before any rendering starts, do either this:
glDrawBuffer( GL_FRONT ); glClearColor( 0.0f, 0.0f, 0.0f, 0.0f ); glClear( GL_COLOR_BUFFER_BIT ); glFinish(); glDrawBuffer( GL_BACK );
That clears your front buffer (which is the visible buffer). Or you can do this (assuming that you have not modified the drawing buffer):
glClearColor( 0.0f, 0.0f, 0.0f, 0.0f ); glClear( GL_COLOR_BUFFER_BIT ); SwapBuffers
That clears your back buffer, and then swaps it to the front buffer.