CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2001
    Location
    Norway
    Posts
    90

    Unhappy Probems with changing resolition

    I cant seem to find any solution to this, so any help is *greatly* appreciated! I have programmed a game, and as the game starts it tries to change the screen resolution, to avoid the desktop icons to be messed up, the change is not broadcast, it never leaves the "test" state. Something like this:

    DevM.dmPelsWidth = 640
    DevM.dmPelsHeight = 480
    DevM.dmBitsPerPel = Bits '(can be 4, 8, 16, 24, 32)
    ChangeDisplaySettings(DevM, CDS_TEST)

    On 90% of the target computers, this works perfectly, on the remaining 10% (Seemingly a lot of GeForce users) this messes up, the resolution gets much smaller than the specified one and the controls seems to contain their original states..

    ANYONE?? :-)

  2. #2
    Join Date
    Dec 2001
    Posts
    6,332
    Welcome to windows

    This is what all game programmers have to deal with. There is no one way that will work for everyone. You will have to either design in some alternate functions for troublesome configurations, or test for compatability upon installation, and warn the user.

    Have fun...
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

  3. #3
    Join Date
    Apr 2004
    Location
    India
    Posts
    70
    Hai,

    I written like this in vc++, but it shows error on DevM in ChangeDisplaySettings(DevM, CDS_TEST); I don't why? Would You please send a sample code for me, depending upon the width and height how can i set the screen resolution.

    Thanks and regards


    Snippet:
    DEVMODE DevM;
    DevM.dmPelsWidth = 640;
    DevM.dmPelsHeight = 480;
    DevM.dmBitsPerPel = 32;// '(can be 4, 8, 16, 24, 32)
    ChangeDisplaySettings(DevM, CDS_TEST);
    Last edited by S.DARWIN; August 11th, 2004 at 02:52 AM.
    Miles to go before I sleep,

  4. #4
    Join Date
    Nov 2002
    Posts
    82
    Hallo FiksVe,

    you may try this code from Planet source code
    james

  5. #5
    Join Date
    Dec 2001
    Location
    Norway
    Posts
    90

    Eh...thanks

    This post is over two years old, the game has been commersially released, and has sold about 2000 copies..

    Anyway, in case somebody was wondering what my problem was, it was the DPI setting in windows. If the user changes the big fonts setting, the screenmetrics gets all fu*#ed up.

    This is probably my last post (I havent posted the last year) as I have migrated all of my development to C/C++. Maybe we see each other some time in a different forum

    Cheers,

    Fiksve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured