Hi Rene,
the one large TBGL window can have sub-sections defined using the viewports (TBGL_Viewport). Support for multiple TBGL windows is technically possible, but it won't happen soon.
You could use this routine to copy contents of TBGL window to canvas:
%GL_BGRA = &H080E1
%GL_PACK_ALIGNMENT = &H00D05
%GL_UNSIGNED_BYTE = &H01401
Declare Sub glFlush Lib "opengl32.dll" Alias "glFlush"
Declare Sub glPixelStorei Lib "opengl32.dll" Alias "glPixelStorei" (ByVal pname As DWord, ByVal param As Long)
Declare Sub glReadPixelsCustom Import "OPENGL32.DLL" Alias "glReadPixels" ( ByVal x As Long, ByVal y As Long, ByVal width As Long, ByVal height As Long, ByVal format As DWord, ByVal nType As DWord, ByVal nPixels As DWord )
Function RenderToCanvas(hWnd As DWord, ctrlID As DWord)
DWord nWidth, nHeight
Canvas_Attach(hWnd, ctrlID)
Canvas_BitmapGet(nWidth, nHeight)
String sBuffer = Repeat$(nWidth * nHeight * 4, $SPC)
glFlush()
glPixelStorei(%GL_PACK_ALIGNMENT, 1)
glReadPixelsCustom(0, 0, nWidth, nHeight, %GL_BGRA, %GL_UNSIGNED_BYTE, StrPtr(sBuffer))
Canvas_BitmapSet(sBuffer, nWidth, nHeight)
End Function
Petr
Bookmarks