Choosing DLL to use depending on OS version

Started by
12 comments, last by DividedByZero 5 years, 6 months ago
39 minutes ago, NightCreature83 said:

Well this is the first time you mention you need the codecs in this thread so I could not have guessed that, this is gamedevelopment after all and in most cases you would just need the D3D api.

Sorry, I would have thought it was obvious as I quoted a Microsoft Media Foundation function in my original post. And I believe I posted the question in 'General and Gameplay Programming'. The question falling in to the 'General' category.

 

@TobiasK I have a library I have created which simply plays a video and puts the frame that is currently in use in to a DX11 texture, which then can be manipulated and drawn back to the scene on a quad. Works fine for Window 8 and above, but I have users wanting me to support Windows 7 as there are still a few Win7 users out there. So I thought while I had a bit of time on my hands lately, I'd attempt to accommodate them.

Advertisement
21 minutes ago, DividedByZero said:

Sorry, I would have thought it was obvious as I quoted a Microsoft Media Foundation function in my original post. And I believe I posted the question in 'General and Gameplay Programming'. The question falling in to the 'General' category.

 

@TobiasK I have a library I have created which simply plays a video and puts the frame that is currently in use in to a DX11 texture, which then can be manipulated and drawn back to the scene on a quad. Works fine for Window 8 and above, but I have users wanting me to support Windows 7 as there are still a few Win7 users out there. So I thought while I had a bit of time on my hands lately, I'd attempt to accommodate them.

Depending on how bad you need to support win7 I see a few options.

1. Wrap the functionality in something with a simple interface, and implement it in two separate DLLs, one for win7 and one for win8+. Simply load the correct DLL, and call a factory function in it to get the right implementation. This allows you to make a single LoadLibrary()/GetProcAddress() and will save you from the header hell you will run into building both code paths into your main exe.

2. Skip the device manager, and query the d3d device and context for the video interfaces manually and use them, making sure you manage any needed thread synchronization.

3. Ditch the media foundation stuff, and use libavcodec to decode the video, allowing you control over both pixel formats and threading strategies.

All of these can of course be abstracted and hidden somewhere, allowing you to start with the simplest (A) and if needed, replace the implementation with something you like better when/if needed.

Thanks dude, I'll check out those options. ?

This topic is closed to new replies.

Advertisement