New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Trying a simple OpenGL program


Post Reply New Thread Subscribe

 
Thread Tools
g00fy

 
Member Since: Feb 13, 2009
Posts: 1
g00fy is on a distinguished road

g00fy is offline
Hi,

I am trying to achieve something very simple, but it seems I'm still doing something wrong... I try to get the version etc what OpenGL reports.
How can I properly do this?

I have this at the moment:
Code:
#include <AGL/agl.h>
#include <stdio.h>

int main ( )
{
        GLint attribs[] = { AGL_RGBA,  // 1
                            AGL_DOUBLEBUFFER,
                            AGL_SAMPLE_BUFFERS_ARB, 1,
                            AGL_SAMPLES_ARB, 2,
                            AGL_SUPERSAMPLE,
                            AGL_NO_RECOVERY,
                            AGL_NONE };

        AGLPixelFormat pixelFormat = NULL;
        AGLContext context = NULL;
        pixelFormat = aglChoosePixelFormat (NULL, 0, attribs); // 2


        if (pixelFormat) {
            context = aglCreateContext (pixelFormat, NULL); // 3

            printf( "%s\n", glGetString(GL_VENDOR) );

            aglDestroyPixelFormat (pixelFormat);
        }

        return 1;
}
which I compile via:
Code:
g++ -framework OpenGL -framework AGL test.cpp && ./a.out
And which gives at my prompt:
Code:
(null)

What did I do wrong?


Thanks a lot!
QUOTE Thanks

Post Reply New Thread Subscribe


« Hello World app takes 45s to start from the terminal, gcc, gdb and dtrace problems | Distributed Issue Tracking »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Simple Program to Make Advertisements? mmahle Movies and Video 1 08-03-2007 12:08 PM
FTP program that can do mutilpe connections? voicepipes OS X - Apps and Games 3 02-24-2007 12:44 PM
Virus Program, Firewall, Backup Program markw10 OS X - Apps and Games 4 08-23-2006 03:44 PM
Problem installing a program playm0de Switcher Hangout 2 06-04-2006 03:15 PM
GLUT & OpenGL problems dcholth OS X - Development and Darwin 4 05-21-2004 01:53 PM

All times are GMT -4. The time now is 07:26 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?