//
//  glView.m
//  cocoaogltest
//
//  Created by Tony Bernardin on 9/5/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "glView.h"
#include <OpenGL/gl.h>


@implementation glView

static void drawStuff()
{
    glColor3f(1.0f, 0.85f, 0.35f);
    
    glBegin(GL_TRIANGLES);
    glColor3f(1.0f, 0.0f, 0.0f);
    glVertex3f( 0.0f,  0.6f, -0.5f);
    glColor3f(0.0f, 1.0f, 0.0f);
    glVertex3f(-0.5f, -0.5f, -0.5f);
    glColor3f(0.0f, 0.0f, 1.0f);
    glVertex3f( 0.5f, -0.5f, -0.5f);
    glEnd();
}

- (void) drawRect : (NSRect) bounds
{
    glClearColor(0,0,0,0);
    glClear(GL_COLOR_BUFFER_BIT);
    drawStuff();
    glFlush();
}

@end
