Hi Kent,
if you mean casting Canvas_* functions on TBGL render surface, than that is not possible. Some people combined GDI with OpenGL in the past, but with Vista/7 this is prohibied approach by MS.
But what you can do, is to render image using TBGL, get the bitmap using TBGL_GetWindowBMP, save it to temporary file and load to UI canvas using Canvas_BitmapLoad.
Or even simpler - as TBGL_GetWindowBMP returns BMP as string, just cut off the BMP header:
s = TBGL_GetWindowBMP(hWnd, %TBGL_CLIENTAREA, width, height)
(which is:
s = [BMP file]
)
=> is internally
s = [Header][RGBXSeries]
=> cut off the header which is located on the beginning
s = [RGBXSeries]
=> use Canvas_BitmapSet to UI canvas of same size
Canvas_BitmapSet(s, width, height)
I will provide example Kent, but I have something very important to perform tomorrow and need to prepare well today, so example will be posted most probably by tommorow evening.
Petr
P.S. Also do not forget TBGL has 2D primitives as well now, thanks to Mike, so it might be not necessary to use UI canvas
Bookmarks