Advertisement

XCode & OpenGL

Started by September 01, 2006 08:39 AM
2 comments, last by pau 18 years, 2 months ago
Hi guys, i'm a new user and i need some help. I'm from Rome (Italy), and as you know italians are not famous for speaking english ;) So..i'll try to write better than i can..and excuse me for my english ;) I have a project to develop for an exam, an OpenGL application. I don't have any experience with OpenGL and C++, i usually work with Java & Swing or C. I read the first NeHe tutorial - to create an'OpenGL window - but i have some problem running the code. I'm with an' iBook G4, and i use XCode. I started with a new Cocoa Application, adding the OpenGL and GLUT framewors.. i wrote the source from the tutorial, making some changes (i.e. from #include <gl\gl.h> to #import <OpenGL/gl.h>, but when i try to "Build and Go" in the Run Log i get: [Session started at 2006-09-01 15:39:59 +0200.] OpenGl_Prova has exited due to signal 10 (SIGBUS). (i get no errors or warnings in the source code). Can anyone help me? Setting XCode if necessary, o with some hint with the code.. Again, excuse me for my english :) Bye, Danilo.
Well..
I downloaded the Mac OS version of the Lesson 1 source (not the Mac OS X/Cocoa).

This version works, a window appear, but.. in this source i can't see things like the global vars

HDC hDC = NULL;
HWND hWnd = NULL;
HINSTANCE hInstance;

bool keys[256];
bool active=TRUE;
bool fullscreen=TRUE;

or the function

GLvoid KillGLWindow(GLvoid)

This means that this source is different from the lesson's one, because no key pression is managed (ESC to quit or F1 to swap beetwen fullscreen or windowed mode).

If i try to insert one of this var, i get an error (a parse error): i don't know if this vars are not for Mac OS version, i mean if there is a different way to declare them or they are named in a different way..

I'm sorry but i'm new to OpenGL programming.. maybe on Windows it would works without these problems.



Advertisement
Quote:
HDC hDC = NULL;
HWND hWnd = NULL;
HINSTANCE hInstance;

These are relevant to the windows os, the way the nehe site works is the tut is in windows and the ports are at the bottom of the page.
Thank you for the answer.
I downloaded the Mac OS version, but these vars are not "translated".. the Mac OS source code version for lesson 1 is different from the source in the tutorial.

Do you know how can i "translate" these vars into a Mac OS source?
And.. i don't know if the app will works just changing the "types".. does all the structure of the program (error managing, calls sequence) remain the same?

Thanks again.

This topic is closed to new replies.

Advertisement