1

I have found a lot of tutorials on a web for older OpenGL versions. But after i have loaded core functions for 4.5 i don't have access to glSwapBuffers. Probably this function is outdated. Is there any tutorial or doc how i can actually draw in OpenGL 4.5.

For now i have OpenGL initialized with PFD_DOUBLEBUFFER and i have shaders compiled into a program.

EDIT: As a loader i use OpenGL Loader Generator

ANSWER: It is so happened that function name glSwapBuffers tricked me to think that it is OpenGL function, but it is not so. For Windows it is wingdi function. So, no need in gl:: prefix. Just call SwapBuffers(_hdc);

Yola
  • 18,496
  • 11
  • 65
  • 106
  • 1
    Take a look at this: [simple complete GL+GLSL+VAO/VBO example](http://stackoverflow.com/a/31913542/2521214) without GLUT usage (it uses just GLEW for loading of GL function pointers). But if they really outdated the `glSwapBuffers` in `GL 4.5+` then this will not help either. But I suspect it is more likely that the loader you use have some kind of bug or need some `#define` to be defined for higher GL versions. Please let me know if you found out. – Spektre Oct 09 '15 at 06:59
  • 1
    @Spektre they haven't outdated the function, as i turned out, it is not OpenGL function, but system function. – Yola Oct 09 '15 at 16:17
  • thanks for the info.Just realized that I am using `SwapBuffers(hdc);` not `glSwapBuffers(hdc);` so that should made it obvious but it didnt for me (I have it hidden in something like `scr.rfs()` ) – Spektre Oct 10 '15 at 05:54

1 Answers1

3

There is no glSwapBuffers function in OpenGL (in no version of it). This function is provided by the underlying window system (win32/x11). You have to call (depending on which system you use), wglSwapBuffers or glXSwapBuffers.

I suspect, that GLUT provides a glSwapBuffers that maps to the correct function.

BDL
  • 21,052
  • 22
  • 49
  • 55