My camera function is not working. The error says that myCamera
is undefined, but I did define it.
According to the error message, Camera
is an unknown override specifier.
Here I have included the camera header so this should be fine.
level.h:
#pragma once
#include "Vectors.h"
#include "level.h"
#include "glut.h"
#include <gl/GL.h>
#include <gl/GLU.h>
#include "controls.h"
#include <stdio.h>
#include "SOIL.h"
#include <vector>
#include "camera.h"
class Scene{
public:
level(Input *in);
void renderer();
void handleInput(float dt);
void update(float dt);
void resize(int w, int h);
protected:
void displayText(float x, float y, float r, float g, float b, char* string);
void renderTextOutput();
void calculateFPS();
Input* input;
int width, height;
float fov, nearPlane, farPlane;
int frame = 0, time, timebase = 0;
camera myCamera;
};
level.cpp: yet here it claims myCamera is undefined.
level::level(Input *in)
{
// Store pointer for input class
input = in;
//OpenGL settings
glShadeModel(GL_SMOOTH);
glClearColor(0.39f, 0.58f, 93.0f, 1.0f);
glClearDepth(1.0f); glClearStencil(0);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glLightModelf(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
glEnable(GL_TEXTURE_2D);
gluPerspective(55.0f, (GLfloat)width / (GLfloat)height, 1, 50.0f);
camera.position.x = 0;
Here is the camera class; however there are no error messages, so if anything is wrong here I don't know what.