SpriteOutput() does not work on fullscreen/OpenGL/3D
Posted: Fri Mar 21, 2014 8:36 pm
Hi guys,
is it just me or does SpriteOutput() not work with the combination: Fullscreen / OpenGL subsystem enabled / 3D engine anabled?
Please try this one (remember to enable OpenGL subsystem):
If you change one of the preconditions: fullscreen to windowed screen / opengl subsystem enabled/disabled / InitEngine3D() in use/remarked it works fine. Could anyone confirm this?
Regards
MAC
is it just me or does SpriteOutput() not work with the combination: Fullscreen / OpenGL subsystem enabled / 3D engine anabled?
Please try this one (remember to enable OpenGL subsystem):
Code: Select all
;
; ------------------------------------------------------------
;
; PureBasic - Sprite example file
;
; (c) 2013 - Fantaisie Software
;
; ------------------------------------------------------------
;
InitEngine3D()
If InitSprite() = 0 Or InitKeyboard() = 0
MessageRequester("Error", "Sprite system can't be initialized", 0)
End
EndIf
;
; Now, open a 800*600 - 32 bits screen
;
If OpenScreen(800, 600, 32, "Sprite")
CreateSprite(0,60,60)
StartDrawing(SpriteOutput(0))
Box(0,0,20,20)
StopDrawing()
CopySprite(0,1,0)
Repeat
; Inverse the buffers (the back become the front (visible)... And we can do the rendering on the back)
FlipBuffers()
; ClearScreen(RGB(0,0,0))
; Draw our sprite
ClipSprite(0, 0, 0, x, x/8)
DisplaySprite(0, x, 100)
DisplaySprite(1, x, x)
DisplaySprite(0, 600-x, x)
x+1
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)
Else
MessageRequester("Error", "Can't open a 800*600 - 32 bit screen !", 0)
EndIf
End
Regards
MAC