Advanced C++/Graphics Tutorial 17: VSYNC, GL_VERSION

preview_player
Показать описание
Just a quick tutorial today going over VSYNC and how to query the opengl version :)

Рекомендации по теме
Комментарии
Автор

That skype noise starts to sound like a fish in distress after a while.

jim_o
Автор

I just want to say that the videos you are making are amazingly helpful.  They are very well done, and I really hope you don't lose your passion for making them like some other people have. Keep up the good work!

PixelBlit
Автор

Thanks for the videos! They have really sparked my interest in game development. I already know most intermediate things in C++ and I am going to college for Computer Science, so these are really useful.

kensclark
Автор

Since YouTube will be removing annotations soon I thought I would drop this in the comments: At around 2 minutes into the video, Ben states that with V-SYNC enabled, your FPS drops to 30 if it can not keep up with 60. However, for the time being (at least) there is an annotation created by him that states this is incorrect and on most systems it merely does not attempt to sync the frames if it drops below 60.

Newbyte
Автор

Not sure why you would use printf() instead of cout? I used this instead, and it was fine...

std::cout << "*** OpenGL version: " << glGetString(GL_VERSION) << "

Also, for the FPS display, if you don't want it scrolling down your screen (moving the OPENGL version off the top), you can use...

if(frameCounter % 10 == 0) std::cout << _fps << " \r";

...I have a " followed by 4 spaces and then a \r and a ". What that does is it does a normal carriage return without a linefeed. That will move the cursor back to the beginning of the same line without moving to the next line. I added in the space before it because sometimes the _fps number has several floating point values, sometimes it has only a few, the extra spaces will erase the old values so it doesn't get mixed with the new values (because it's printing it on the same line and not scrolling your screen on you).

NeilRoy
Автор

Very helpful videos! How did you learn c++? All in school, or can you recommend some tutorials/books?

maartenTTT
Автор

Yay got a more stable FPS when I turned v-sync on! \o/

Hey, Ben, from previous tutorial I got confused about whether v-sync is good or bad, how do you go about using it or not? Thanks!

paulocbbf
Автор

There is also:


std::printf("OpenGL version: %s\n", glGetString(GL_VERSION));
std::printf("GPU : %s\n", glGetString(GL_RENDERER));
std::printf("GPU Manifacturer: %s\n\n", glGetString(GL_VENDOR));

sbn
Автор

I get 60 fsp. It makes no difference whether I enable VSYNC or not. Is that a problem?

DerHoppel
Автор

On Mac vsync is enabled by default and they call it beam sync?! (if you're interested).

It can be disabled by downloading a development tool called Quartz Debug but SDL_GL_SetSwapInterval(0) seemed to have the same affect which is good!

Thanks again for these tutorials. I'm really enjoying them. They prompt me to do further research/investigations out of curiosity! 

russellmills
Автор

I had just bought a new computer that had capability for OpenGL 4.5, but when I ran the code to get the version of OpenGL, it said I was using version 3.0 Mesa 11.2 (On Linux). Does anybody know why this is happening?

davislast
Автор

Is it weird that when i have VSync disabled, the FPS is around 62 Hz
But when i have it enabled it shoots up to about 66 Hz?

Lesterberne
Автор

I get an OpenGL version of 2.1 and I had absolutely no problems so far.

Mal_
Автор

what software do you use, to record these videos?

drcvagos-iu
Автор

one really stupid question. this reusable code that you teach us - this "ground" of a game. How is this called?

Drauchris
Автор

By the way, awesome tutorial. Thank you so much.

LuizHeringerIA
Автор

I'm always getting 62- 66fps, when trying to cap it at 60

michaelskalecki
Автор

GMod has screen-tearing like nobody's business.

carbon
Автор

Funny: If I turn NVIDEA's V-Sync on, I get 144 FPS. When I turn on OpenGL's V-Sync on, I get 142 FPS. Weird. (My monitor is 144 Hz)
P.S. Mute Skype! I am thinking I get messages on my Skype! xD

DJoppiesaus