- ...
- theDC:= GetDC(P_Vorschau.Handle); // P_Vorschau ist ein TPanel, scheint auch zu funktionieren, sprich liefert eine Zahl
- GL_Viewer.SetupPixelFormat(theDC, thePalette); // von der ich annehme, dass es ein Handle sein könnte
- theRC:= wglCreateContext(theDC); // liefert ne 0 und den Fehler 1411
- wglMakeCurrent(theDC, theRC);
- //und hier der Teil aus SetupPixelFormat
- begin
- FillChar(pfd, SizeOf(pfd), 0);
- with pfd do begin
- nSize := sizeof(pfd); // Länge der pfd-Struktur
- nVersion := 1; // Version
- dwFlags := PFD_DRAW_TO_WINDOW or PFD_SUPPORT_OPENGL or
- PFD_DOUBLEBUFFER; // Flags
- iPixelType:= PFD_TYPE_RGBA; // RGBA Pixel Type
- cColorBits:= 24; // 24-bit color
- cDepthBits:= 32; // 32-bit depth buffer
- iLayerType:= PFD_MAIN_PLANE; // Layer Type
- end;
- nPixelFormat:= ChoosePixelFormat(DC, @pfd); // <- ergibt unter 2000 eine 3, unter XP embedded eine 2
- SetPixelFormat(DC, nPixelFormat, @pfd); // <- ergibt true
- // Farbpalettenoptimierung wenn erforderlich
- DescribePixelFormat(DC, nPixelFormat,
- sizeof(TPixelFormatDescriptor),pfd); // <- ergibt auch true
- ...
- end;