OpenGL on Yosemite (0S X)

I’m upgrade for Yosemite and i have some difficulty for start a «base» program with [GLUT - OpenGL - GLEW - GLFW] files. If i have all file and it work for connect to my main.ccp, i’m ok. Sorry for bad english i speak french. :slight_smile: I’m using Xcode 6.

#include "---" // Include the GLEW header file
#include "---" // Include the GLUT header file

void display (void) {
    glClearColor(1.0f, 0.0f, 0.0f, 1.0f); 
    glClear(GL_COLOR_BUFFER_BIT); 
    glLoadIdentity(); 
    
    glFlush(); 
}

int main (int argc, char **argv) {
    glutInit(&argc, argv); 
    glutInitDisplayMode (GLUT_SINGLE); 
    glutInitWindowSize (500, 500); 
    glutInitWindowPosition (100, 100); 
    glutCreateWindow ("Your first OpenGL Window"); 
    
    glutDisplayFunc(display); 
    
    glutMainLoop(); 
}

[ol]
[li] Does it work if you remove all references to GLEW? You shouldn’t need GLEW for a program which only uses OpenGL 1.1 features. If that works, check whether there’s a newer version of GLEW, or whether there are known issues with GLEW on Yosemite.
[/li]
[li] Does it work if you change the argument to glutInitDisplayMode() from GLUT_SINGLE to GLUT_DOUBLE? Single-buffered contexts can be problematic with compositing desktop systems. There’s rarely any reason to use single-buffered contexts with modern hardware. Alternatively, try changing the glFlush() call to glutSwapBuffers().
[/li][/ol]

#import <GLUT/glut.h> //? is that what you were looking fer?

[QUOTE=GClements;1263158][ol]
[li] Does it work if you remove all references to GLEW? You shouldn’t need GLEW for a program which only uses OpenGL 1.1 features. If that works, check whether there’s a newer version of GLEW, or whether there are known issues with GLEW on Yosemite.
[/li]
[li] Does it work if you change the argument to glutInitDisplayMode() from GLUT_SINGLE to GLUT_DOUBLE? Single-buffered contexts can be problematic with compositing desktop systems. There’s rarely any reason to use single-buffered contexts with modern hardware. Alternatively, try changing the glFlush() call to glutSwapBuffers().
[/li][/ol][/QUOTE]

I’m using GLEW because i will need that (in the futur code) but i remove it for now.
When i’m change SINGLE to DOUBLE and Flush to SwapBuffers nothing occurred.
Another problem: [’(all glut code)’ is deprecated: first departed in OS X 10.9] and i use 10.10 and +

I suspect GLEW was providing your included for your OpenGL API bindings. Get the latest version and include + link it in. Alternatively include the platform specific GL headers and of course you’ll need to use Apples AGL API or equivalent to get a context. You should probably just go with GLEW.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.