Hi all,
I intend to port a win32 application using OpenGL in C to Mac, using Carbon (for the windowing and OpenGL for the core functions). I’d like to begin by a little training and I can’t get myself displaying a simple window. I don’t want any Nib files, I wanna create everything from scratch (no resource file neither).
Here is my code :
#include <stdio.h>
#include <Carbon/Carbon.h>
int main (/int argc, const char * argv[]/) {
WindowRef theWindow;
Rect contentRect;
OSStatus err;
printf("Start main!
");
SetRect(&contentRect, 100,100,100,100);
err=CreateNewWindow(kDocumentWindowClass,kWindowStandardDocumentAttributes,&contentRect, &theWindow);
if(err==FALSE)printf("Error in CreateNewWindow
");
ShowWindow(theWindow);
printf("End main!
");
return 0;
}
I’ve read the tutorial on Apple.com, the Nehe’s one for GLUT as well by it doesn’t help, and when I use the debugger, I see that CreateNewWindow returns an error, but WHAT ??
All I want is a simple window with Hello in there.
Pretty simple, and then I’ll build upon that.
Can anyone help me ?
I don’t know what to do with this “CreateNewWindow”…In Carbon, we can also use NewCWindow, but I can’t get this working neither. I’ve got a good background with Java, but how do you dump the stack in C ?
I’ve tried to use GLUT, but it’s pretty hairy to use this when you want a multi window application on top of OpenGL.
Thanks
@ + Daz