I was making my own little clone of an NSView using C++ (to use with GLUT, so that it could be cross-platform), and I made a subclass.
My view class has a getFrame() function, and when I tried to use that function from a subclass, I got an error: "View::getFrame() referenced from:"
The function I referenced it from was the subclass's implementation of draw(), which looked like this:
My view class has a getFrame() function, and when I tried to use that function from a subclass, I got an error: "View::getFrame() referenced from:"
The function I referenced it from was the subclass's implementation of draw(), which looked like this:
Code:
void Box::draw()
{
Rect aFrame = getFrame(); // this is where the problem lies, I think
GLfloat x = aFrame.origin.x, y = aFrame.origin.y;
GLfloat width = aFrame.size.width, height = aFrame.size.height;
glColor3d(drawingColor.red, drawingColor.green, drawingColor.blue);
glBegin(GL_QUADS);
glVertex3f(x, y, 1.0f);
glVertex3f(x+width, y, 1.0f);
glVertex3f(x+width, y+height, 1.0f);
glVertex3f(x, y+height, 1.0f);
glEnd();
}