Jump to content
  • Advertisement
Sign in to follow this  
John Hardeman

Changing Video Modes

This topic is 3992 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

Greetings, Does anyone know how to change video modes with Cpp and DirectX 9.0c SDK? I have a few examples but none of them work. A complete VCpp 6.0 project would be REALLY nice if anyone can give to me such a gem. C++ code will do, however. I am trying to get into what would be the equivalent of Mode 13h ===> 320 [width] x 240 [height] x 256 [colour]. I am doing an ol' sk00l 2D game ala NES. Besides, my eye hurt in my not-so-old age. Thanks in Advance. Sincerely, Mr. John Hardeman [Edited by - John Hardeman on January 10, 2008 12:23:24 AM]

Share this post


Link to post
Share on other sites
Advertisement



Greetings All,

Well, I did it, but I don't understand *why* my code
actually changes the video mode instead of just the
window size. Anyone have some working code that will
change video modes? Code which they can explain ?


Sincerely,

Mr. John Hardeman

Share this post


Link to post
Share on other sites
Changing the back-buffer dimensions is done by calling IDirect3DDevice9::Reset, with the BackBufferWidth and BackBufferHeight of the D3DPRESENT_PARAMETERS set to the desired size. The the other step is to resize your window so that your client area matches the new back-buffer size (you can have different sized client areas and back-buffers, the back-buffer will just be stretched or shrank), which in plain old Win32 you can do with AdjustWindowRect() and SetWindowPos().

That's really all there is to it...I can't give you any of my code though since they're all VS2005 projects. Speaking of which, why are you using such an old version of Visual Studio? The newer versions of the DX SDK don't even support VS 2003 anymore, nevermind VC6. I'd definitely recommend switching to VS 2008 Express.

And another note...If you want to make NES-style games with 8-bit color then I don't think Direct3D is the right choice. Most of the API is designed for heavy-duty 3D work, and therefore even doing simple 2D work can be quite complicated. While it will offer hardware acceleration, you're definitely not going to need it for 2D sprites. I would instead recommend using a software graphics API, which will be much easier to use and set up, and will also give you per-pixel access. Some good choices are Allegro, SDL, and PixelToaster. These are all cross-platform, and have some other useful built-in facilities (keyboard/mouse input, window creation, sound/music, networking). GDI+ is also somewhat useful, but is Windows-only and only handles graphics.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!