Created
October 2, 2013 01:50
-
-
Save anonymous/6787985 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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