Skip to main content
gamedev.net
🔒 Locked

Resolution Question

Started by Black Sheep Games May 28, 2002 at 1:24 AM 3 replies 400+ views
Original Post
Black Sheep Games
Black Sheep Games
To set a resolution for my game, as far as the maximum height and width of the screen in pixels, should i let windows find the available resolutions and choose one, or is it faster to let directX do it? Right now i''m breaking one of the fundemental programming laws and hardcoding the height and width...yuck!
elis-cool
elis-cool
Why the hell is that bad??? I nothing wrong with hard coding the screen res.

CEO Plunder Studios
[email=esheppard@gmail.com]esheppard@gmail.com[/email]
Assassin
Assassin
Yeah, just look at Diablo 2
Assassin, aka RedBeard. andyc.org
Black Sheep Games
Black Sheep Games
It''s been my experience that hardcoding important constants in general is a very bad idea. At the very least they should be read in from some sort of ini file, this way if you want to change just 1 variable, you wont have to re-compile to see the results.


As far as the directX code i''m using to get the possible resolutions; I''m calling GetAdapterModeCount(D3DADAPTER_DEFAULT) to get the number of modes possible, then looping from 0 to that number, checking the resolutions of each using the
EnumAdapterModes function and using that info to select the most proper resolution, or compile a list for the user to select from.

i was just wondering if it would be faster/better to use windows functions, because i remember doing something like that in Visual Basic, and it didnt seem as complicated using the windows functions.
IndirectX
IndirectX
In the old days not all videomodes were accelerated, ie you had to be running in 800x600x16 to get hardware acceleration. Thus, it was important to ask DX what it supported rather than asking Windows what your videocard could do. With today''s hardware, I suppose all "common" video modes are hardware accelerated; however, there''s the issue of backbuffer formats. Your card, for example, may support either X1R5G5B5 or R5G6B6, but it''s much easier to determine which one is supported using DX than to do so using Win32, at least in my opinion. Then you can check device caps during D3D device enumeration to see if you should ask for hardware/mixed/software vertexprocessing. So, unless you have a very good reason to not use it, you should go with DX enumeration.
---visit #directxdev on afternet <- not just for directx, despite the name

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.