192 glViewport(0, 0, this->width, this->height);
193 this->camera.width = this->width;
194 this->camera.height = this->height;
197 float aspect = (float)this->width / (
float)this->height;
198 float minside = 0.05f;
199 if (this->width > this->height)
201 this->camera.top = minside;
202 this->camera.right = minside * aspect;
206 this->camera.top = minside / aspect;
207 this->camera.right = minside;
211 this->camera.update_proj_mat();
212 this->camera.update_inv_proj_mat();
A simple context that does some of the common annoying work.
Abstraction of a rendering context/viewport that displays renderings.
virtual void paint_impl(void)=0
Overwrite to define actions on paint.
virtual void init_impl(void)=0
Overwrite to define actions on init.
virtual void resize_impl(int old_width, int old_height)=0
Overwrite to define actions on resize.