PB doc wrote:Note: Don't use DirectX inside threads (MS Windows limitation)! If you need to display graphics in threads use Images and 2DDrawing instead
Code: Select all
Procedure test(void)
InitSprite():InitSprite3D()
OpenWindow(0,0,0,320,240,"",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0),0,0,320,240,0,0,0)
CreateSprite(0,64,64,#PB_Sprite_Texture)
StartDrawing(SpriteOutput(0))
Circle(32,32,32,#Blue)
StopDrawing()
CreateSprite3D(0,0)
Repeat
ClearScreen(0)
If WaitWindowEvent(1)=#PB_Event_CloseWindow
End
EndIf
Start3D()
DisplaySprite3D(0,120,90)
Stop3D()
FlipBuffers()
ForEver
EndProcedure
tid=CreateThread(@test(),0)
WaitThread(tid)