Question about minimum capabilities in a DirectX 9 application.

Started by
2 comments, last by grill8 17 years, 1 month ago
Hello all, I am trying to figure out the best way to be sure that the minimum capabilities of a DirectX version 9 app are supported during initialization. Ok, so my strategy is to have a class that fills out a D3DCAPS9 structure with the minimum capabilities that the app should be able to handle (worst case scenario). Then, during initialization create the best device available as normal. Then compare the newly device caps with the minimum caps struct. If the test passes then it is known that the application will be able to handle things during initialization. That way all validation is done during initialization and testing for caps is not needed during runtime. My questions are: 1) Is this the best way to handle min requirement validation? 2) Is there a easier way to handle the comparison between 2 D3DCAPS9 structs than using member by member comparison? Thanks for your help. Jeremy (grill8)
Advertisement
Your idea sounds a little more complex that it needs to be. Why not just check the caps directly for your application?
www.gameprojects.com - Share Your Games and Other Projects
It does sound like an elegant way to check if the best device matches the minimum caps required for the application. However, mr Nedelman may have a point with checking the required caps directly. Without writing code for comparing each of the caps, how are you going to determine if the current best device caps are better or worse than the minimum caps? For multisampling alone this could already become quite a chore.

If you just want to create a device from the parameters dictated by the minimum caps and then check if the minimum caps are available (so a simple equal comparisson on the entire configuration), your idea may have some merit, but it would take a lot of the flexibility out of device creation.

Hope this helps & I understood your queston correctly :)
Rim van Wersch [ MDXInfo ] [ XNAInfo ] [ YouTube ] - Do yourself a favor and bookmark this excellent free online D3D/shader book!
Hello all,

Thank you. I think all things considered I will have a function that simply checks the states that are absolutely necessary for the application rather than all states as originally planned. Rewriting the function for each application may be required which I didn't want but I can't find a way around that. It shouldn' be a large chore for each app though and won't take that long.

Thank you again,
Jeremy (grill8)

This topic is closed to new replies.

Advertisement