UPDATE:
Managed to abstract the ball and paddle classes into the "Renderable_Object" class.
Code:
#ifndef RENDERABLE_OBJECT_H
#define RENDERABLE_OBJECT_H
#include "Vector2.h"
class Renderable_Object
{
public:
Vector2 & getVelocity()
{
return velocity;
}
Vector2 & getPosition()
{
return position;
}
Vector2 & getMinimum()
{
return d_min;
}
Vector2 & getMaximum()
{
return d_max;
}
private:
Vector2 position;
Vector2 velocity;
Vector2 d_min;
Vector2 d_max;
bool isPhysical;
bool isVisible;
};
#endif
Which now allows me to centralize the rendering process, like so!
Code:
#include "Renderable_Object.h"
class Renderer
{
void draw(Renderable_Object object)
{
glPushMatrix();
glTranslatef(object.getPosition().x,object.getPosition().y,-50.0f);
glBegin(GL_QUADS); // Start Drawing Quads
glVertex3f(object.getMinimum().x, object.getMinimum().y, 1.0f); // Bottom Left Of The Texture and Quad
glVertex3f( object.getMaximum().x, object.getMinimum().y, 1.0f); // Bottom Right Of The Texture and Quad
glVertex3f( object.getMaximum().x, object.getMaximum().y, 1.0f); // Top Right Of The Texture and Quad
glVertex3f(object.getMinimum().x, object.getMaximum().y, 1.0f); // Top Left Of The Texture and Quad
glEnd();
glPopMatrix();
}
};
I just eliminated 4 useless files and 2 classes! HURRAH!