リモート デスクトップ接続 (opengl 1.1 のサブセットのみをサポート) を介して動作するように、非常に古いアプリケーションを変更する必要があります。さまざまなopengl 1.x関数のみが必要なので、mesa opengl32.dllファイルをアプリケーションフォルダーに配置するというトリックを使用しようとしています。このアプリケーションは opengl をほとんど使用しないため、パフォーマンスの低いソフトウェア レンダラーを使用してもかまいません。
とにかく、 https://wiki.qt.io/Cross_compiling_Mesa_for_Windowsからプリコンパイルされた mesa opengl32.dll ファイルを取得しましたが、ステンシル バッファーが有効な状態で pixelformat/context を取得できません。ステンシル バッファの使用を無効にすると、他のすべてが機能しますが、実際には、ステンシル バッファを有効にしてピクセルフォーマット/コンテキストを取得する方法を理解できれば最善です。
コンテキスト作成コードの pixelformat 部分は次のとおりです。
function gl_context_create_init(adevice_context:hdc):int;
var
pfd,pfd2:tpixelformatdescriptor;
begin
mem_zero(pfd,sizeof(pfd));
pfd.nSize:=sizeof(pfd);
pfd.nVersion:=1;
pfd.dwFlags:=PFD_DRAW_TO_WINDOW or PFD_SUPPORT_OPENGL or PFD_DOUBLEBUFFER;
pfd.iPixelType:=PFD_TYPE_RGBA;
pfd.cColorBits:=32;
pfd.iLayerType:=PFD_MAIN_PLANE;
pfd.cStencilBits:=4;
gl_pixel_format:=choosepixelformat(adevice_context,@pfd);
if gl_pixel_format=0 then
gl_error('choosepixelformat');
if not setpixelformat(adevice_context,gl_pixel_format,@pfd) then
gl_error('setpixelformat');
describepixelformat(adevice_context,gl_pixel_format,sizeof(pfd2),pfd2);
if ((pfd.dwFlags and pfd2.dwFlags)<>pfd.dwFlags) or
(pfd.iPixelType<>pfd2.iPixelType) or
(pfd.cColorBits<>pfd2.cColorBits) or
(pfd.iLayerType<>pfd2.iLayerType) or
(pfd.cStencilBits>pfd2.cStencilBits) then
gl_error('describepixelformat');
...
end;
エラーは行 (pfd.cStencilBits>pfd2.cStencilBits) で発生します。メサを介して cStencilBits が 0 ではない pixelformat が見つからないようです。そのため、ステンシルをサポートするコンテキストを取得できません。