I wish to get a PureBasic image handle for my OGRE windowed screen's buffer. Sadly whenever "InitEngine3D()" is called GrabSprite, ScreenOutput and GrabDrawingImage all break immediately. The reason I wish to have this functionality is because I have a really fun project in RPG Maker. I wish to run OGRE in the background on an invisible window and simply get the frame and pass it to the program as a bitmap. I have tried for hours but cannot find any solution except "WindowOutput" which doesn't work on invisible windows. The image it returns on an invisible window is always black and all it actually does with GrabDrawingImage is make screen-shots which is very slow.

Here is a very small test program to clearly show the problem and errors:
Code: Select all
InitEngine3D() ; Without this line it works fine.
InitSprite()
OpenWindow(0,0,0,800,600,"VXOGRE Screen")
OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, #True, 0, 0)
While 1
WindowEvent()
RenderWorld(1)
FlipBuffers()
; Always Fails.
If GrabSprite(0,0,0,800,600) = 0
MessageRequester("Error", "Unable to grab sprite!")
EndIf
; The specified output is NULL.
StartDrawing(ScreenOutput())
GrabDrawingImage(0, 0, 0, 800, 600)
StopDrawing()
; This workaround does function but it's slow and doesn't render properly when it's invisible or alike.
StartDrawing(WindowOutput(0))
GrabDrawingImage(0, 0, 0, 800, 600)
StopDrawing()
Delay(1)
Wend
