Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: OpenGL - how to make it work  (Read 5464 times)

0 Members and 1 Guest are viewing this topic.

ravenheart

  • Full Member
  • ***
  • Posts: 148
    • View Profile
OpenGL - how to make it work
« on: October 29, 2014, 06:47:19 pm »
Hello,

I just want to learn some modern OpenGL using Linux and SFML. I am trying to use the OpenGL 4.0 tutorial i found on http://antongerdelan.net/opengl/.

Now i am trying to compile the program and get like for every Opengl-Command:

Quote
cpp:18:26: error: ‘glGenBuffers’ was not declared in this scope
.

I do not know how to proceed from here. Any ideas?

I could post the whole program code if needed and maybe the linker options too.

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: OpenGL - how to make it work
« Reply #1 on: October 29, 2014, 06:56:54 pm »
  • Install libglew-dev using your package manager.
  • #include <GL/glew.h> before anything SFML related.
  • Write your code.
  • Compile and link against SFML and GLEW using -lsfml-window -lsfml-system -lglew <other stuff here>
  • ? ? ?
  • Profit.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Gambit

  • Sr. Member
  • ****
  • Posts: 283
    • View Profile
Re: OpenGL - how to make it work
« Reply #2 on: October 30, 2014, 07:09:31 am »
I would personally recommend open.gl. I used it myself with no prior knowledge of OpenGL and its perfect for beginners (It even covers setting it up with SFML).

ravenheart

  • Full Member
  • ***
  • Posts: 148
    • View Profile
Re: OpenGL - how to make it work
« Reply #3 on: October 30, 2014, 08:27:46 pm »
Hmm. It now compiles. At least i get a binary. But i get an error:

glGenBuffers not resolved and many other things too.

I am linking GLEW GL and GLU beside all the sfml stuff.

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: OpenGL - how to make it work
« Reply #4 on: October 30, 2014, 08:31:25 pm »
You know... showing us some logs would help... Like... the full log of it building including the errors at the end.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

ravenheart

  • Full Member
  • ***
  • Posts: 148
    • View Profile
Re: OpenGL - how to make it work
« Reply #5 on: October 30, 2014, 08:37:41 pm »
Fuck me - es sieht so aus als ob ich nur noch ein glewInit() gebraucht hätte. Gab sonst einen Speicherzugriffsfehler.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: OpenGL - how to make it work
« Reply #6 on: October 30, 2014, 10:19:27 pm »
The curse is the only English part of your post ;D

For others: looks as if only a glewInit() was needed, without it there was a memory access violation.
« Last Edit: October 30, 2014, 10:37:19 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything