Page 1 of 1

Problem with DisplaySprite (under OpenGL)

Posted: Fri Feb 14, 2025 12:19 am
by diceman
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.

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
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! :)

Re: Problem with DisplaySprite (under OpenGL)

Posted: Fri Feb 14, 2025 1:14 am
by miso
For me your example works with everything except dx11. (I'm on win7, I dont even know if it's presented or not here. I only use the default opengl for myself) (6.20 beta1, still have to upgrade later)

Re: Problem with DisplaySprite (under OpenGL)

Posted: Fri Feb 14, 2025 1:29 am
by diceman
Okay, thank you for testing.
That is a bit reassuring, so it seems to be an issue with my laptop (currently don't have another platform to test this), maybe some graphic card drivers (although they are up to date) or incompatibilities with Windows 11? :?

Re: Problem with DisplaySprite (under OpenGL)

Posted: Fri Feb 14, 2025 7:08 am
by STARGĂ…TE

Re: Problem with DisplaySprite (under OpenGL)

Posted: Fri Feb 14, 2025 7:45 am
by miso
Maybe. I can't confirm, DX11 halted at openscreen for me. (With the debugline.)