- var
- pfd:TPixelFormatDescriptor;
- nPixelFormat:Integer;
- begin
- FillChar(pfd,SizeOf(pfd),0);
- with pfd do
- begin
- NSize:=sizeOf(pfd);
- nVersion:=1;
- dwFlags:=PFD_DRAW_TO_WINDOW or PFD_SUPPORT_OPENGL;
- iPixelType:=PFD_TYPE_RGBA;
- cColorBits:=24;
- cDepthBits:=32;
- iLayerType:=PFD_MAIN_PLANE;
- end;
- nPixelFormat:=ChoosePixelFormat(Handle,@pfd);
- SetPixelFormat(Handle,nPixelFormat,@pfd);
- formcreate
- SEtDCPixelFormat(Canvas.Handle);
- hrc:=wglcreatecontext(canvas.handle);