screen Hz

Started by
5 comments, last by swiftcoder 11 years, 5 months ago
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
Advertisement
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.

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

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]


[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

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.
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]

This topic is closed to new replies.

Advertisement