window mode in dx with no sync

BlitzMax Forums/BlitzMax Programming/window mode in dx with no sync

Paul "Taiphoz"(Posted 2005) [#1]
I am trying this.

Graphics GFX_Width,GFX_Height,32,0 | NOSYNC

the window is erm 350,500 at 16bit and windowed, I wana run this with no sync cos I wana test its full fps. This however is throwing up an Unhandled Exception or some bull..

Can we not have flip false in window mode ?


ImaginaryHuman(Posted 2005) [#2]
SetSwapInterval(0)

?


klepto2(Posted 2005) [#3]
Just make something like :

Graphics 800,600,0,-1

That will turn Vsync off.


skidracer(Posted 2005) [#4]
If you want windowed mode you have to change the 32 in your posted code to 0.

This code works for me and shows the NOSYNC flag being respected:
' no sync windowed mode graphics example

Strict
Local y
Graphics 530,500,0,NOSYNC
While Not KeyHit (KEY_ESCAPE)
Cls
DrawLine 0,0,530,y
y=(y+1) Mod 500

Flip
Wend



Robert Cummings(Posted 2005) [#5]
Whats the difference between -1 and NOSYNC?


Paul "Taiphoz"(Posted 2005) [#6]
ta guys.


klepto2(Posted 2005) [#7]
I think there is none.
NoSync is just a Parameter like SoftSync or HardSync and could
also added this way :

Graphics 800,600,0,-1|Nosync

For further details about the Graphics Command look at:

http://www.blitzbasic.com/Community/posts.php?topic=49341&hl=SoftSync


FlameDuck(Posted 2005) [#8]
SetSwapInterval(0)
Doesn't work with DirectX. For starters.

Whats the difference between -1 and NOSYNC?
-1 is $FFFFFFFF in hex, while nosync is a flag (the 16th bit to be more precise). Without having read the actual code, I assume the least significant bits are used as a decimal representation of the Hertz, and the most significant 16 bits are used for various flags, HARDSYNC, SOFTSYNC and NOSYNC (as well as an additional 13 possible future flags).

In short using NOSYNC is "safer" as it's a constant, and the value it represents can be changed by BRL transparently, while using a "-1" display (a 65535 hertz display with "all guns blazing" if my assumption is correct) is potentially dangerous, as BRL might add additional flags at some time, and these flags might be mutually exclusive.

Additionally BRL might change the order of precedence on the flags, so you might risk getting a softsync (or worse, a hardsync) 65535 hertz display.

Lastly if your software "flip" timer is firing 65K+ times a second, you won't have much frame time left for anything else.


Oddball(Posted 2005) [#9]
What does setting the Hertz to 0 actually do? I mean, the docs say it selects the default refresh rate. Now does that mean the default refresh rate for the command, which is 60Hrtz, or the default for the monitor, which could be anything?


REDi(Posted 2005) [#10]
I think its the monitor refresh rate that your desktop is using.


FlameDuck(Posted 2005) [#11]
I think its the monitor refresh rate that your desktop is using.
I think it's the highest possible that the monitor will allow (and may be driver dependant). I'm running my Desktop in 70Hz, but a simple Graphics 1280,1024,32,0 in BlitzMAX gives me a 75Hz display (on Radeon X600XT + Acer AL1751).


Paul "Taiphoz"(Posted 2005) [#12]
thanks for the info , thats good to know.