16
Graphics / Re: Apply shader to whole screen?
« on: May 08, 2016, 09:40:57 pm »
Thanks! The latter suggestion seems good for my situation.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
If SEV_Framelock is 60 seconds (and you converted to microseconds), allocFrameTime will be 0, because 1,000,000/60,000,000 is 0.0166 and allocFrameTime is an integer type.no the integer value of SEV_FrameLock is 60, so it is just 1,000,000 / 60 which is ~16,666. As for blaming this on the sleep function, I have delta timing so it's not an issue that way, it just that if I say I want to lock it at 60, I would like the framerate around anywhere from 60-65ish, not 100.
Then between < allocFrameTime will always be false (except I don't know what between holds).
But why do you want to sleep anyway? Are you using threads?
It's really easy to create such an array yourself - a couple of lines of code.std::map<int,bool> keys; // Add this somewhere in a class or where it doesn't get destroyed
// ---
sf::Event event;
while(window.pollEvent(event)) {
switch(event.type) {
case sf::Event::KeyPressed:
keys[event.key.code] = true;
break;
case sf::Event::KeyReleased:
keys[event.key.code] = false;
break;
default:
break;
}
every key's state can be checked with keys[sf::Keyboard:<key>]
For the most part the performance is more or less the same.I'm porting it right now. I guess we'll find out. I'm sure hoping its at least the same, because SFML is so much easier to use than SDL2.
If you want an exact answer for your situation, you'd have to port your engine to SFML and benchmark it. Alternatively, do like Laurent said and make a small benchmark (wont give you exact results, but close enough).