Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Tungsten

Pages: [1]
1
Graphics / Weird Error
« on: November 12, 2008, 12:43:19 am »
The const qualifier for the Render method is used to indicate that the method will not modify the object(instance of ClockString). You are modifying the object by calling the SetText method.

2
Feature requests / Add support for custom refresh rates
« on: November 09, 2008, 01:33:07 pm »
I actually think that is the expected behaviour if you do not specify a value for the dmDisplayFrequency member of the DEVMODE structure.

The ChangeDisplaySettings function will default to what is considered a "compatible" refresh rate for the device if not specified. It's a non-issue for LCD screens because they use a fixed 60 Hz frequency.

3
Feature requests / Add support for custom refresh rates
« on: November 07, 2008, 10:20:14 pm »
Uh , i think you misunderstood that statement.

The current svn-version of sfml will default back to 60hz no matter what refresh rate you use in desktop mode. You will always end up with 60 hz in fullscreen mode.

The change adds support for the user to specify the refresh rate used in fullscreen mode nothing else. If the specified refresh rate is not a supported mode it will fail and default back to the "best" mode supported by the card.

If you do not specify a value it will be set to 60. If that is not a supported refresh rate(which is highly unlikely) it will also fail and default back to the "best" mode supported by the card. That functionality is already implemented in sfml by the IsValid() method in the VideoMode class.

Of course you can change the behaviour so if no refresh rate value is specified it will try to pick the current desktop refresh rate but that might also fail if you use a different fullscreen resolution compared to your desktop resolution.

4
Feature requests / Add support for custom refresh rates
« on: November 07, 2008, 02:45:55 pm »
If you are using a CRT-monitor it will default to 60 Hz when using fullscreen mode. Instead of using a refresh rate locker for certain resolutions add a member to the VideoMode class.

VideoMode.hpp
Add an unsigned int DisplayFreq member.
Code: [Select]

    unsigned int Width;        ///< Video mode width, in pixels
    unsigned int Height;       ///< Video mode height, in pixels
    unsigned int BitsPerPixel; ///< Video mode pixel depth, in bits per pixels
    unsigned int DisplayFreq;  ///< Video mode display frequency


Change the constructor to take a DisplayFreq parameter(defaults to 60 if not specified).
Code: [Select]

VideoMode::VideoMode(unsigned int ModeWidth, unsigned int ModeHeight, unsigned int ModeBpp, unsigned int ModeFreq) :
Width       (ModeWidth),
Height      (ModeHeight),
BitsPerPixel(ModeBpp),
DisplayFreq(ModeFreq)


I have implemented it for the win32 platform

VideoModeSupport.cpp

In the GetSupportedVideoModes method add the DisplayFrequency argument to the constructor call.
Code: [Select]

VideoMode Mode(Win32Mode.dmPelsWidth,Win32Mode.dmPelsHeight,
               Win32Mode.dmBitsPerPel,Win32Mode.dmDisplayFrequency);

VideoMode.cpp

Change the overloaded comparison operator to
Code: [Select]

return  (Width        == Other.Width)        &&
        (Height       == Other.Height)       &&
        (BitsPerPixel == Other.BitsPerPixel) &&
        (DisplayFreq  == Other.DisplayFreq);

so it can fail if a too high refresh rate was selected.

WindowImpWin32.cpp

In the SwitchToFullscreen method add
Code: [Select]

DevMode.dmDisplayFrequency = Mode.DisplayFreq;
DevMode.dmFields    = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL | DM_DISPLAYFREQUENCY;

so it can change the frequency when the call to ChangeDisplaySettings is made.

Pages: [1]