//
//  kGLView.h
//  CocoaGL
//
//  Created by Katherine Tattersall on Thu Jul 11 2002.
//  Copyright (c) 2001 ZeroByZero. All rights reserved.
//

#import  <Cocoa/Cocoa.h>
#import  <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <OpenGL/glext.h>

#import  "NSGLFont.h"
#import  "NSGLParticleEngine.h"

#define BITS_PER_PIXEL          32.0
#define DEPTH_SIZE              32.0
#define DEFAULT_TIME_INTERVAL 	0.03125/*0.008333333333*/
#define NUMTEXTURES		1
#define NUMSTARS		50

#define PERF_LOW_LIMIT          32
#define FPS_TIME_INTERVAL       0.5

typedef struct _star
{
    int r;
    int g;
    int b;
    float i;
    GLfloat distance;
    GLfloat angle;
    GLfloat tilt;
    GLfloat spin;
} Star;

@interface kGLView : NSOpenGLView
{
    bool FullScreenOn;
    bool first;
    bool lighting;
    bool blending;
    bool textures;
    
    NSWindow *FullScreenWindow;
    NSWindow *StartingWindow;
    NSTimer  *time;
    NSTimer  *fpstimer;
    
    NSGLFont *f, *of;
    GLint    drawing_type; 
    GLint    texture[ NUMTEXTURES ];
    Star     StarArray[ NUMSTARS ];
    
//    GLUquadric *quadobj;
    NSGLParticleEngine *pe, *pe2;
    int pe_flag;
    
    float rot;
    
    float    dieangle;
    float    user_avg_fps;
    float    ub_avg_fps;
    
    int frame_count;
    int user_get_average;

    bool preferred_time;

    // we would need a set of these for however many lights we wanted to include
    GLfloat LightAmbient[4];
    GLfloat LightDiffuse[4];
    GLfloat LightPosition[4];
}
// Actions
- (IBAction)toggleFullScreen:(id)sender;
- (IBAction)setSolid:        (id)sender;
- (IBAction)setWireframe:    (id)sender;
- (IBAction)setPoints:       (id)sender;
- (IBAction)changeLighting:  (id)sender; 
- (IBAction)changeBlending:  (id)sender;
- (IBAction)changeTextures:  (id)sender;
- (IBAction)reduce:          (id)sender; 
- (IBAction)increase:        (id)sender;

- (id)initWithFrame:(NSRect) frameRect;

- (void)getTextures;
- (void)loadPicture:(NSString *) name;

@end

