void __fastcall TFCOpenGL::TWORZ_GL()
{
angle = 0;
ppp = 0;
PIXELFORMATDESCRIPTOR pfd;
int pf;
dc = GetDC( FCOpenGL->Handle ); //wsadz tutaj panel1->Handle //identyfikator (uchwyt) okna Windows
ZeroMemory( &pfd, sizeof( pfd)); //ustalenie typu koloru, buforowania grafiki,
pfd.nSize = sizeof( pfd);
pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 32;
pfd.cDepthBits = 32; pfd.cStencilBits = 8;
pfd.iLayerType = PFD_MAIN_PLANE;
pf = ChoosePixelFormat(dc, &pfd); // Returns format that most closely matches above pixel format
SetPixelFormat(dc, pf, &pfd);
rc = wglCreateContext(dc); // Rendering Context = window-glCreateContext
wglMakeCurrent(dc,rc); // Make the DC (Form1) the rendering Context
// Initialist GL environment variables
glInit();
// Panel1Resize(NULL); // sets up the perspective
OnResize(NULL);
AppStart = GetTickCount();
}