Problem with DisplaySprite (under OpenGL)

Just starting out? Need help? Post your questions and find answers here.
User avatar
diceman
User
User
Posts: 68
Joined: Tue Apr 10, 2018 9:42 pm

Problem with DisplaySprite (under OpenGL)

Post 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! :)
Now these points of data make a beautiful line,
And we're out of Beta, we're releasing on time.
miso
Enthusiast
Enthusiast
Posts: 476
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: Problem with DisplaySprite (under OpenGL)

Post 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)
User avatar
diceman
User
User
Posts: 68
Joined: Tue Apr 10, 2018 9:42 pm

Re: Problem with DisplaySprite (under OpenGL)

Post 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? :?
Now these points of data make a beautiful line,
And we're out of Beta, we're releasing on time.
User avatar
STARGÅTE
Addict
Addict
Posts: 2235
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Problem with DisplaySprite (under OpenGL)

Post by STARGÅTE »

PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
miso
Enthusiast
Enthusiast
Posts: 476
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: Problem with DisplaySprite (under OpenGL)

Post by miso »

Maybe. I can't confirm, DX11 halted at openscreen for me. (With the debugline.)
Post Reply