Jump to content
  • Advertisement
Sign in to follow this  

directx 7 0 - determining current screen resolution

This topic is 3414 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well, I finally got around to dusting off some eight year old code, originally developed under directx 7 (and earlier). I was pleasantly surprised to find it still compiles and runs under the latest directx sdk and vs2008.. I had to do little more than add '#define DIRECTINPUT_VERSION 0x700' to the source files to get things to compile. I'm using 'SetDisplayMode' to open the app full screen, exclusive. The code is an old 2D engine I wrote, since I'm using a vector definition I can scale things to any screen resolution. How can I determine the resolution of the users desktop during initialization? I want the game to open at the same resolution as the users desktop initially. I've also noticed all the 2D stuff has apparently been removed from the lastest version of directx :( Thanks, Eric

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by onetrueboo
I was pleasantly surprised to find it still compiles and runs under the latest directx sdk and vs2008..
Surprising indeed - I thought they'd ditched the DX7 headers a year or so back...

Quote:
Original post by onetrueboo
How can I determine the resolution of the users desktop during initialization?
int width = GetSystemMetrics(SM_CXSCREEN);
int height = GetSystemMetrics(SM_CYSCREEN);

Sufficient?

Quote:
Original post by onetrueboo
I've also noticed all the 2D stuff has apparently been removed from the lastest version of directx :(
There hasn't been any new "2D-only" features in the DXSDK for around 7 years. Ever since the introduction of DirectXGraphics (aka D3D8) all graphics have been routed via Direct3D - even the 2D 'emulation' of sprites and screen-aligned quads.

Whilst its a bit more verbose you generally get much better performance and much better features from this. I was sold on the switch-over when I heard that rotation and blending were effectively free when doing 2D-in-3D. Implementing those in DirectDraw was always an unnecessary headache [headshake].

On the plus side we do now have Direct2D and DirectWrite. Can look forward to a day when GDI/GDI+ is but a mere footnote in the history books [grin]


hth
Jack

Share this post


Link to post
Share on other sites
Thank you!! That's what I was looking for.

Quote:
Original post by jollyjeffers
Surprising indeed - I thought they'd ditched the DX7 headers a year or so back...


I had to compile with an older 'dinput.h' header file (as opposed to the dinput8.h), other than that the code compiled fine.

I'm doing things from a very low level. I'm assembling the bitmap myself, and then blitting it to the screen. I wrote all the low level stuff in assembly language. Just a simple poly rasterizer (triangles and squares), with 4 or 8x supersampling (anti-aliasing). Also support for splines and radially symmetric shapes.

So the speed of the code is completely bound by the software rasterizer which is of course orders of magnitude slower than the hardware now available. Also, the speed of the blit (from system to GPU memory) plays a big part in the performance. However for simple scenes I still get acceptable (30+ fps) frame rates.

Now I see MS is already doing this with Direct2D (sigh).

Oh well, I'm doing this for fun as I enjoy low level coding. Currently working on the physics part of things.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!