Jump to content

Is there a function option in OGL that allows you to set a constant FPS? 

If no, I know the way I would do it is an array of the last n calculation times and use them as a measurement for how much of a "buffer" time to set between each frame to be output, but I don't know the functions to get the time.

Or does anyone have code for this that they are ok with me using?

I'm planning on making a simple "don't hit the boxes" side-scrolling game and want to make it consistent for all players so there isn't an advantage to higher or lower FPS.

GIGABYTE Z97MX-G516GB DDR3 | I5 4690k @ 4.4ghz | 1TB SSHD, 500GB HDD, 128GB SSD | GTX 1070 8GB | Corsair Graphite 230 | EVGA 650W | Hyper 212 EVO

 

Cinebench R15: 636(all cores), 127FPS

 

Link to comment
https://linustechtips.com/topic/564027-fps-limit-copengl/
Share on other sites

Link to post
Share on other sites

NEW PC build: Blank Heaven   minimalist white and black PC     Old S340 build log "White Heaven"        The "LIGHTCANON" flashlight build log        Project AntiRoll (prototype)        Custom speaker project

Spoiler

Ryzen 3950X | AMD Vega Frontier Edition | ASUS X570 Pro WS | Corsair Vengeance LPX 64GB | NZXT H500 | Seasonic Prime Fanless TX-700 | Custom loop | Coolermaster SK630 White | Logitech MX Master 2S | Samsung 980 Pro 1TB + 970 Pro 512GB | Samsung 58" 4k TV | Scarlett 2i4 | 2x AT2020

 

Link to comment
https://linustechtips.com/topic/564027-fps-limit-copengl/#findComment-7417185
Share on other sites

Link to post
Share on other sites

11 hours ago, Enderman said:

 

Kind of wish there was a function for it in the library... Would make things so much easier...

GIGABYTE Z97MX-G516GB DDR3 | I5 4690k @ 4.4ghz | 1TB SSHD, 500GB HDD, 128GB SSD | GTX 1070 8GB | Corsair Graphite 230 | EVGA 650W | Hyper 212 EVO

 

Cinebench R15: 636(all cores), 127FPS

 

Link to comment
https://linustechtips.com/topic/564027-fps-limit-copengl/#findComment-7420102
Share on other sites

Link to post
Share on other sites

On 3/11/2016 at 1:56 AM, Enderman said:

Interested in looking at the code I did for the frame cap?

 

GIGABYTE Z97MX-G516GB DDR3 | I5 4690k @ 4.4ghz | 1TB SSHD, 500GB HDD, 128GB SSD | GTX 1070 8GB | Corsair Graphite 230 | EVGA 650W | Hyper 212 EVO

 

Cinebench R15: 636(all cores), 127FPS

 

Link to comment
https://linustechtips.com/topic/564027-fps-limit-copengl/#findComment-7426666
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×