Skip to content

Instantly share code, notes, and snippets.

Created October 2, 2013 01:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6787985 to your computer and use it in GitHub Desktop.
Save anonymous/6787985 to your computer and use it in GitHub Desktop.
// scene.hpp
class Scene
{
public:
Scene();
virtual ~Scene();
virtual void addObject( SceneObject* object );
virtual void render();
private:
class Impl;
Impl& impl_;
};
// scene.cpp
class Scene::Impl
{
public:
void complexProcessing();
void moreComplexProcessing();
void render();
std::vector<SceneObj*> objects_;
};
Scene::Scene():impl_( new Scene::Impl) {}
void Scene::addObject( SceneObject* object )
{
impl_.objects_.push_back( object )
}
void Scene::draw()
{
impl_.complexProcessing();
impl_.moreComplexProcessing();
impl_.render();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment