Skip to main content
GameDev.net gamedev.net
🔒 Locked

screen Hz

Started by wildcolor Nov 2, 2012 at 2:27 PM 5 replies 1.4k views
Original Post
wildcolor
wildcolor
Hi guys

I have a CRT monitor that has a 120Hz refresh rate. I want to display my stimulus (say a green rectangle) to have the same rate as the screen. How would I be able to do that?
student
Aks9
Aks9
By drawing it on the screen. If vsync is on, you cannot draw it with other rates except f, f/2, f/3, f/4, etc.
wildcolor
wildcolor

By drawing it on the screen. If vsync is on, you cannot draw it with other rates except f, f/2, f/3, f/4, etc.


Vsync!! That's exactly what I want to check. How would I be able to check the status of Vsync? Also, if Vsync is ON, how would I be able to make my fps as fast as 120Hz? Do I just need to keep the elapsed time of each of my frame to be less that 1second/120?
student
swiftcoder
swiftcoder

Vsync!! That's exactly what I want to check. How would I be able to check the status of Vsync?

That's part of whatever windowing toolkit you are using, not OpenGL itself.

Also, if Vsync is ON, how would I be able to make my fps as fast as 120Hz? Do I just need to keep the elapsed time of each of my frame to be less that 1second/120?[/quote]
Yes, pretty much.
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
wildcolor
wildcolor

[quote name='wildcolor' timestamp='1351871484' post='4996566']
Vsync!! That's exactly what I want to check. How would I be able to check the status of Vsync?

That's part of whatever windowing toolkit you are using, not OpenGL itself.

Also, if Vsync is ON, how would I be able to make my fps as fast as 120Hz? Do I just need to keep the elapsed time of each of my frame to be less that 1second/120?[/quote]
Yes, pretty much.
[/quote]

Thanks a lot for the reply. It's helpful, but not 100% solve my problem. Could you give me more hints about the details of the windowing toolkit part. For example, I tried SDL, but it doesn't seem to support what I want to do. Do you know anything that does and could you give me some detailed examples?
student
Aks9
Aks9

Could you give me more hints about the details of the windowing toolkit part. For example, I tried SDL, but it doesn't seem to support what I want to do. Do you know anything that does and could you give me some detailed examples?

I still don't understand what the problem is.
In order to have 120Hz refresh rate, you should keep rendering time below 8ms, a trigger repaint after the previous ends.
swiftcoder
swiftcoder
SDL has very poor support for setting vsync . Try using SFML or GLFW, both of which do support vsync.
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.