Problem with DisplaySprite (under OpenGL)
Posted: Fri Feb 14, 2025 12:19 am
Hello everyone, hope someone can help me with this:
The following snippet works flawlessly with the DirectX9-Subsystem enabled.
Without subsystem (OpenGL), OpenScreen always fails.
However, when I try to run this with the DirectX11-Subsystem enabled, OpenScreen responds accordingly, but then the program always crashes ("The debugged executable quit unexpectedly").
The program opens in fullScreen, then just creates a square sprite, and displays that at a fixed coordinate on screen.
Pressing ESC quits the program.
FYI:
Tried that with openWindow()+openWindowedScreen(), and then it works in native OpenGL, but will still crash with DirectX11 enabled.
Apparently it crashes upon reaching DisplaySprite(), it won't get past that.
If you catch the handle beforehand, with IsSprite(), the sprite seems to be perfectly legit, though.
Anyone? Thanks!
The following snippet works flawlessly with the DirectX9-Subsystem enabled.
Without subsystem (OpenGL), OpenScreen always fails.
However, when I try to run this with the DirectX11-Subsystem enabled, OpenScreen responds accordingly, but then the program always crashes ("The debugged executable quit unexpectedly").
The program opens in fullScreen, then just creates a square sprite, and displays that at a fixed coordinate on screen.
Pressing ESC quits the program.
FYI:
Tried that with openWindow()+openWindowedScreen(), and then it works in native OpenGL, but will still crash with DirectX11 enabled.
Code: Select all
EnableExplicit
InitSprite()
InitKeyboard()
Define thisSPR
If OpenScreen(1024, 768, 32, "testSprite")
thisSPR = CreateSprite(#PB_Any, 64,64)
If StartDrawing(SpriteOutput(thisSPR))
Box(0,0,SpriteWidth(thisSPR), SpriteHeight(thisSPR), RGB(255,0,0))
StopDrawing()
EndIf
Repeat
ClearScreen(RGB(0,0,0))
DisplayTransparentSprite(thisSPR, 0, 0)
FlipBuffers()
ExamineKeyboard()
Until KeyboardReleased(#PB_Key_Escape)
Else
Debug "openScreen failed"
EndIf
End
If you catch the handle beforehand, with IsSprite(), the sprite seems to be perfectly legit, though.
Anyone? Thanks!
