window mode in dx with no sync
BlitzMax Forums/BlitzMax Programming/window mode in dx with no sync
| ||
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 ? |
| ||
SetSwapInterval(0) ? |
| ||
Just make something like : Graphics 800,600,0,-1 That will turn Vsync off. |
| ||
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 |
| ||
Whats the difference between -1 and NOSYNC? |
| ||
ta guys. |
| ||
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 |
| ||
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. |
| ||
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? |
| ||
I think its the monitor refresh rate that your desktop is using. |
| ||
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). |
| ||
thanks for the info , thats good to know. |