How to Not Use GLUT?

Member
Posts: 90
Joined: 2006.11
Post: #1
I can use DevIL to load my images, but how would I display them via OpenGL, without using GLUT??
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Use Cocoa, SDL or Carbon instead.
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #3
You could take a look at my xcode template to see how Cocoa can be used for OpenGL
http://fax.twilightcoders.net/files/Coco...cation.zip

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Member
Posts: 90
Joined: 2006.11
Post: #4
Thanks...
I think I will take the Cocoa route. But I can't make any of the apple tutorials work. Unknown: I can't make your template work either. I got a bunch of errors when I just run it. but when I tweaked it some, I reduced it to 1 error. Something about a nested function:
Code:
    const void *get_byte_pointer(void *bitmap)
    {
    return bitmap;
}

Hmm, it'd be nice to have an example that simply drew a rectangle using only Cocoa and OpenGL. Most examples out there include GLUT in there. The ones that don't, don't work at all. Sad

The Apple Tutorial: http://developer.apple.com/documentation...ion_3.html
Quote this message in a reply
Member
Posts: 312
Joined: 2006.10
Post: #5
Here ya go (using fax's template)

http://www.mediafire.com/?6yn5d2yyf0m
Quote this message in a reply
Member
Posts: 90
Joined: 2006.11
Post: #6
Obviously it works for you... but it doesn't work for me... when I tried to compile :"error: unrecognised command line option "-fnested-functions". Sorry, i only have a couple of months of experience in this...
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #7
change the code in MyOpenGLView.m from

Code:
- (void)copyGLtoQuartz {
    const void *get_byte_pointer(void *bitmap) { return bitmap; }
...

to

Code:
const void *get_byte_pointer(void *bitmap) { return bitmap; }
- (void)copyGLtoQuartz {
...

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Post Reply