• Advertisement

Archived

This topic is now archived and is closed to further replies.

Switching video modes in Direct X

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

What needs to be done in order to switch video modes in directx? ie going from 640 x 480 to 800 x 600. any breif insight or articles would be greatly appreciated. Is there an open source free DX wrapper library that has support for dx7. just functions like init, etc? thanks lep

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
eh, just create the direct draw object, and change the video mode.. ie in dx7
    
// GLOBALS

LPDIRECTDRAW7 lpDD=NULL;
unsigned long width=640,height=480,bpp=8;

// ddraw init

DirectDrawCreateEx(NULL,(void**)&lpDD,IID_IDirectDraw7,NULL);
lpDD->SetDisplayMode(width,height,bpp,0,0);


then you go and set cooperative level and create your surfaces and what not and you''re set.
if you mean your app needs to switch resolutions dynamically just destroy all your direct draw stuff and recreate everything at the new resolution.

Share this post


Link to post
Share on other sites
quote:
Original post by Leprosy

What needs to be done in order to switch video modes in directx?


You can set video mode and create surfaces once... as long as bit depth of new resolutions equal that of another display mode you want to set, you shouldn''t have to recreate all surfaces, just primary and back buffer(s).

quote:

Is there an open source free DX wrapper library that has support for dx7. just functions like init, etc?
thanks lep


Off the top of my head, cdx. There''s like a billion I''m sure.

Share this post


Link to post
Share on other sites
I am writing my own DirectX wrapper library in Delphi and recently got the video mode switching along with full-screen/windowed switching working. What I do is fairly generic in that it just releases all surfaces and recreates them as necessary for the new resolution and bit-depth. I may add some smarts to it later on so it can choose which surfaces to keep and which to recreate during the switch, but for now it works in all cases. The library is smart enough at the moment to be able to automatically reload surfaces from bitmaps if required.




Steve 'Sly' Williams
Tools Developer
Krome Studios

Share this post


Link to post
Share on other sites

  • Advertisement