Look at the error log at the bottom of my post.
#ifndef FILE_OBJECTS
#define FILE_OBJECTS
#include <iostream>
#include <string>
#include <vector>
#include <gl/glut.h>
#include <gl/glu.h>
using namespace std;
// The namespace that contains all screen object related classes
class coords { public:
GLdouble x, y, z;
GLvoid change(GLfloat _x,GLfloat _y, GLfloat _z);
};
class point : coords { public:
GLvoid move(GLfloat speed, GLfloat _x,GLfloat _y, GLfloat _z);
friend GLvoid direction_apply(coords angle, GLfloat distance, point &_position); };
class object { public:
point position;
coords direction; };
class fixed_camera : object { public:
point target;
point upvector; };
class free_camera : fixed_camera { public:
coords direction;
GLfloat target_distance; };
class model : object { public:
GLint list_index;
GLfloat size;
GLvoid load_model( char file[50] );
GLvoid draw(); };
class class_mouse { public:
bool l,m,r;
GLfloat x,y;
coords world;
GLvoid calculate_world (GLfloat depth); };
GLvoid direction_apply(point _direction, GLfloat distance, point &_position);
#endif /* FILE_OBJECTS */
and now this function in another file:
GLvoid model::draw() {
glTranslatef(position.x,position.y,position.z);
glRotatef(direction.x,1,0,0);glRotatef(direction.y,0,1,0);glRotatef(direction.z,0,0,1);
glScalef(size,size,size);
glCallList(list_index); }
and this is the error log:
--------------------Configuration: OpenGL_basic - Win32 Debug--------------------
Compiling...
objects.cpp
C:\Documents and Settings\The_CyberLord\My Documents\3D\objects.cpp(78) : error C2248: 'x' : cannot access public member declared in class 'coords'
c:\documents and settings\the_cyberlord\my documents\3d\objects.h(14) : see declaration of 'x'
C:\Documents and Settings\The_CyberLord\My Documents\3D\objects.cpp(78) : error C2248: 'y' : cannot access public member declared in class 'coords'
c:\documents and settings\the_cyberlord\my documents\3d\objects.h(14) : see declaration of 'y'
C:\Documents and Settings\The_CyberLord\My Documents\3D\objects.cpp(78) : error C2248: 'z' : cannot access public member declared in class 'coords'
c:\documents and settings\the_cyberlord\my documents\3d\objects.h(14) : see declaration of 'z'
Error executing cl.exe.
OpenGL_basic.exe - 3 error(s), 0 warning(s)
-----------
How can I solve this?