RandyU
04-26-2001, 07:39 PM
I want to know what is the right way to draw scene. I do in such way:
if firsttimeflag then begin
//initialization
DC := GetDC(Handle);
//then I fill pfd and call such functions:
ChoosePixelFormat(DC, @pfd);
SetPixelFormat(DC, nPixelFormat, @pfd)
DescribePixelFormat(DC, nPixelFormat, sizeof(TPixelFormatDescriptor), pfd)
end;
DrawScene;
if not SwapBuffers(DC) then begin
//my DC is no longer valid
ReleaseDC(DC); DC := GetDC;
end;
I do it on timer event.
On WM_PAINT event I only do SwapBuffers - it makes picture valid when moving.
if firsttimeflag then begin
//initialization
DC := GetDC(Handle);
//then I fill pfd and call such functions:
ChoosePixelFormat(DC, @pfd);
SetPixelFormat(DC, nPixelFormat, @pfd)
DescribePixelFormat(DC, nPixelFormat, sizeof(TPixelFormatDescriptor), pfd)
end;
DrawScene;
if not SwapBuffers(DC) then begin
//my DC is no longer valid
ReleaseDC(DC); DC := GetDC;
end;
I do it on timer event.
On WM_PAINT event I only do SwapBuffers - it makes picture valid when moving.