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

Author Topic: OpenGL tutorial not working on mac  (Read 3398 times)

0 Members and 1 Guest are viewing this topic.

thecruuk

  • Newbie
  • *
  • Posts: 6
    • View Profile
OpenGL tutorial not working on mac
« on: February 26, 2012, 01:04:44 pm »
Hi,
i wanted to set up a ogl scene with this tutorial (http://www.sfml-dev.org/tutorials/1.6/window-opengl.php), but i always get the error message: "use of undeclared identifier" for every ogl function. i use xcode 4.
i also tried including <OpenGL/OpenGL.h> but it changes nothing.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
OpenGL tutorial not working on mac
« Reply #1 on: February 26, 2012, 01:51:19 pm »
Quote
for every ogl function

Which ones?
Laurent Gomila - SFML developer

thecruuk

  • Newbie
  • *
  • Posts: 6
    • View Profile
OpenGL tutorial not working on mac
« Reply #2 on: February 26, 2012, 01:59:31 pm »
Code: [Select]

    // Set color and depth clear value
    glClearDepth(1.f);
    glClearColor(0.f, 0.f, 0.f, 0.f);
   
    // Enable Z-buffer read and write
    glEnable(GL_DEPTH_TEST);
    glDepthMask(GL_TRUE);
   
    // Setup a perspective projection
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective(90.f, 1.f, 1.f, 500.f);

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
OpenGL tutorial not working on mac
« Reply #3 on: February 26, 2012, 02:01:39 pm »
Can you show your complete source code and the exact error messages?
Laurent Gomila - SFML developer

thecruuk

  • Newbie
  • *
  • Posts: 6
    • View Profile
OpenGL tutorial not working on mac
« Reply #4 on: February 26, 2012, 02:10:36 pm »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
OpenGL tutorial not working on mac
« Reply #5 on: February 26, 2012, 02:13:35 pm »
Oh, you're using SFML 2. You should have said it ;)

Include <SFML/OpenGL.hpp>.

And don't hesitate to look at the provided examples, there are two that use OpenGL.
Laurent Gomila - SFML developer

thecruuk

  • Newbie
  • *
  • Posts: 6
    • View Profile
OpenGL tutorial not working on mac
« Reply #6 on: February 26, 2012, 02:15:39 pm »
Thanks : ) it works now