14 backgroundImageScene_ = NULL;
18 SetViewport(
int x,
int y,
int width,
int height)
24 SetClearColor(
float red,
float green,
float blue,
float alpha)
32 backgroundImageScene_ = bg;
40 for (
unsigned int i = 0; i < scenes_.size(); i++) {
41 scenes_[i]->SetGLProjectionParametersInterface(camera);
48 BIASASSERT(scene != NULL);
50 scenes_.push_back(scene);
56 vector<SceneBase*>::iterator itor = find(scenes_.begin(), scenes_.end(), scene);
57 if (itor == scenes_.end()) {
58 BIASERR(
"Scene to be removed is not contained by the view");
67 if (index <= (
int)scenes_.size()) {
68 vector<SceneBase*>::iterator itor = scenes_.begin();
69 for (
int i = 0; i < index; i++) {
72 scenes_.insert(itor, scene);
74 scenes_.push_back(scene);
82 if (index < 0 || index >= (
int)scenes_.size()) {
83 BIASERR(
"Scene index is out of range");
87 vector<SceneBase*>::iterator itor = scenes_.begin();
88 for (
int i = 0; i < index; i++) {
99 glGetIntegerv(GL_VIEWPORT, oldViewport);
102 glViewport(viewport_[0], viewport_[1], viewport_[2], viewport_[3]);
105 glPushAttrib(GL_DEPTH_BUFFER_BIT);
106 glEnable(GL_DEPTH_TEST);
107 glDepthFunc(GL_ALWAYS);
109 glMatrixMode(GL_MODELVIEW);
113 glMatrixMode(GL_PROJECTION);
118 glColor4f(clearColor_[0], clearColor_[1], clearColor_[2], clearColor_[3]);
119 glVertex3f(-1, -1, 1);
120 glVertex3f( 1, -1, 1);
121 glVertex3f( 1, 1, 1);
122 glVertex3f(-1, 1, 1);
125 glMatrixMode(GL_PROJECTION);
128 glMatrixMode(GL_MODELVIEW);
135 if (camera_ != NULL) {
136 result = camera_->Draw(scenes_, backgroundImageScene_);
145 glViewport(oldViewport[0],
Scene that renders a background image behind all other scenes.
Abstract interface class to handle changes in rendering parameters by controllers and in rendering co...
Base class for all scenes.
virtual void SetGLProjectionParametersInterface(GLProjectionParametersInterface *nc)
Set the camera as projectionparametersinterface, can be of type GLProjection of of any from GLProject...