Time to change the default graphics subsystem to DX11

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Axeman
User
User
Posts: 91
Joined: Mon Nov 03, 2003 5:34 am

Time to change the default graphics subsystem to DX11

Post by Axeman »

Just a suggestion, but the default DirectX9 graphics subsystem is getting long in the tooth and seems to have some issues on Windows 10. It might be time to upgrade the default system to DirectX11 and allow people to downgrade to DirectX9 if they wish.

The reason I'm making this suggestion is that I've had an issue with my jigsaw puzzle software that didn't occur on Windows 7 and which I only found after I recently switched to Windows 10. I traced the problem to the FlipBuffers() command, which started having a 200 millisecond delay crop up after a few hundred calls. It seemed like it might have some buffer that was filling up and causing a slowdown once full. After a lot of code tuning and reductive bug tracing I found the problem disappeared if I switched the subsystem to DirectX11 or OpenGL. The DirectX9 subsystem seems to be what was causing it.

EDIT: This change might require some additional info in the docs about best practices though. I just fixed an issue with using the DirectX11 subsystem where both the faint background image used as an optional reference for the puzzle and the completed puzzle fade-in animation wouldn't draw. It turned out to be an issue with 'DisplayTransparentSprite' caused by the sprite I was using for the completed image not using 'DrawingMode( #PB_2DDrawing_AllChannels )' in its creation. This worked fine when using DirectX9, so presumably the two libraries do things somewhat differently in a way that affected this.

EDIT2: The DirectX11 seems to have issues grabbing alpha information with the GrabDrawingImage() command, so I ended up on the OpenGL subsytem for my puzzle software. Whatever system may end up being defaulted to might need a thorough debugging.
Last edited by Axeman on Mon Mar 15, 2021 12:04 pm, edited 2 times in total.
Everything
Enthusiast
Enthusiast
Posts: 225
Joined: Sat Jul 07, 2018 6:50 pm

Re: Time to change the default graphics subsystem to DX11

Post by Everything »

And maybe also you will think about cario lib?
  • It's cross platform
  • It's hardware accelerated
  • It may be compiled with all\any features as single lib\dll
  • It can have builtin Freetype2! That's what I miss all the time I've use PB (especially on windows as native fonts hinting is horrible)
Post Reply