I doubt that you can use SetPixelFormat() for TPanel, or even TForm. Where do you get fChwnd? Shouldn't it be FDC:=GetDC(panel1.handle); Then you should call ReadExtensions; after the InitOpenGL;
I doubt that you can use SetPixelFormat() for TPanel, or even TForm. Where do you get fChwnd? Shouldn't it be FDC:=GetDC(panel1.handle); Then you should call ReadExtensions; after the InitOpenGL;
I guess fChwnd is panel1.handle if this works
And if there's a need to call the second part of code at all then I guess panel handle changes while docking/dragging?
Long time Later i found where i do wrong
if handle is change its need use SetPixelFormat and ActivateRenderingContext
my wrong i tryed to delete RC,DC ..
pfd.dwFlags := PFD_DRAW_TO_WINDOW OR PFD_SUPPORT_OPENGL OR PFD_DOUBLEBUFFER;
SetPixelFormat ( DC, ChoosePixelFormat ( DC, @pfd ), @pfd );
ActivateRenderingContext( DC, wglCreateContext ( DC ), TRUE );
Last edited by serkank; 22-10-2014 at 07:06 PM.
Bookmarks