Max Terentiev Guest
|
Posted: Thu Feb 22, 2007 3:10 pm Post subject: OpenGL Form with BorderStyle=bsNone |
|
|
Hello,
My application draw OpenGL scene on C++Builder form using
folowing code. It's works fine until I change BorderStyle of the form
to bsNone. After what only black window is rendred. Why ?
I must remove border and caption from my OpenGL form.
void __fastcall TForm1::FormCreate(TObject *Sender)
{
HDC hdc=GetDC(Form1->Handle);
if(hdc==0)
{ShowMessage("HDC IS NULL");return;}
PIXELFORMATDESCRIPTOR pfd =
{
sizeof (PIXELFORMATDESCRIPTOR),
1, PFD_DRAW_TO_WINDOW |
PFD_SUPPORT_OPENGL |
PFD_DOUBLEBUFFER,
PFD_TYPE_RGBA,
32,
0, 0, 0, 0, 0, 0,
1,
0,
0,
0, 0, 0, 0,
16,
0,
0,
PFD_MAIN_PLANE,
0,
0, 0, 0
};
PixelFormat=ChoosePixelFormat(hdc, &pfd);
if(PixelFormat==0)
return;
if(!SetPixelFormat(hdc, PixelFormat, &pfd))
return;
hrc=wglCreateContext(hdc);
if(hrc==NULL)
return;
if(wglMakeCurrent(hdc, hrc) == false)
return;
DrawGLScene();
}
---
With best regards, Max Terentiev.
Business Software Products.
AMS Development Team.
support (AT) bspdev (DOT) com |
|