OpenGL camera errors..can't find 'em!?
ok...i'm putting togeather my camera code, with the first OpenGL camera tutorial from gametutorials.com as a guide...anyway...i'm using DevC++, and it's putting out errors, but i can't find them (well i kno where they should be but i dont see 'em ;) )
anyway...here's my camera.cpp:
Code:
#include <windows.h>
#include <gl/gl.h>
#include "camera.h"
//camera constructor
CCamera :: CCamera()
{
CVector3 vZero = {0.0, 0.0, 0.0};
CVector3 vView = {0.0, 1.0, 0.5);
CVector3 vUp = {0.0, 0.0, 1.0};
C_vPosition = vZero;
C_vView = vView;
C_vUpVector = vUp;
}
//position camera
CCamera :: PositionCamera(int positionX, int positionY, int positionZ,
int viewX, int viewY, int viewZ,
int upVectorX, int upVectorY, int upVectorZ)
{
CVector3 vPosition = {positionX, positionY, positionZ};
CVector3 vView = {viewX, viewY, viewZ};
CVector3 vUpVector = {upVectorX, upVectorY, upVectorZ};
C_vPosition = vPosition;
C_vView = vView;
C_vUpVector = C_vUpVector;
}
errors:
-end of file read inside definition ~ line7
-'CCamera :: CCamera()' has already been declared in 'CCamera' ~ line7
-parse error at end of input ~ line30
the camera.h code:
Code:
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <gl\gl.h>
//vector class
class CVector3
{
public:
int x, y, z;
};
//camera class
class CCamera
{
public:
CVector C_vPosition; //camera position
CVector C_vView; //camera view
CVector C_vUpVector; //camera 'up' vector
CCamera(); //camera constructor
//values for camera positioning
int PositionX, PositionY, PositionZ;
int ViewX, ViewY, ViewZ;
int UpVectorX, UpVectorY, UpVectorZ;
void PositionCamera(int positionX, int positionY, int positionZ,
int viewX, int viewY, int viewZ,
int upVectorX, int upVectorY, int upVectorZ);
//camera movement
int speed;
MoveCamera(speed);
//extern values so they can be accessed globally
extern CCamera gl_Camera;
errors:
-syntax error befor ';' ~ line 19
-syntax error before ';' ~ line20
-invalid use of member 'CCamera::speed' ~ line35
-ANSI C++ forbids declaration 'MoveCamera' with no type ~ line35
-storage class specified for feild 'gl_Camera' ~ line38
-field 'gl_Camera' has incomplete type ~ line38
anyway....if anyone can help i'll be very grateful
-psychopath