PDA

View Full Version : OpenGL on Yosemite (0S X)



STUDIOCRAFTdevelopper
12-23-2014, 07:08 AM
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. :) 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();
}

GClements
12-23-2014, 11:55 AM
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.

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().

VictorG
12-24-2014, 11:52 PM
#import <GLUT/glut.h> //? is that what you were looking fer?

STUDIOCRAFTdevelopper
12-26-2014, 09:59 AM
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.

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().


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 +

dorbie
01-05-2015, 06:21 AM
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.