lbl_tooltip = 0;
tooltip_target = 0;
+ camera.set_orthographic(geom.w, geom.h);
+ update_camera();
+
update_style();
if(mouse)
void Root::render() const
{
- GL::MatrixStack::projection() = GL::Matrix::ortho_bottomleft(geom.w, geom.h);
- GL::MatrixStack::modelview() = GL::Matrix();
GL::Bind bind_blend(GL::Blend::alpha());
- GL::Renderer renderer(0);
+ GL::Renderer renderer(&camera);
Widget::render(renderer);
}
y = (mouse->get_axis_value(1)*0.5+0.5)*geom.h;
}
+void Root::update_camera()
+{
+ camera.set_position(GL::Vector3(geom.w/2.0f, geom.h/2.0f, geom.h/2.0f));
+ camera.set_depth_clip(geom.h*0.1f, geom.h*0.9f);
+ camera.set_orthographic(geom.w, geom.h);
+}
+
+void Root::on_geometry_change()
+{
+ Panel::on_geometry_change();
+ update_camera();
+}
+
void Root::on_child_added(Widget &wdg)
{
if(&wdg!=lbl_tooltip)
#define MSP_GLTK_ROOT_H_
#include <sigc++/trackable.h>
+#include <msp/gl/camera.h>
#include <msp/graphics/window.h>
#include <msp/input/keyboard.h>
#include <msp/input/mouse.h>
int pointer_y;
Time::TimeStamp tooltip_timeout;
Widget *tooltip_target;
+ Msp::GL::Camera camera;
public:
/** Creates a Root widget for a window. The geometry is set to match the
bool character_event(StringCodec::unichar);
void get_pointer(int &, int &);
+ void update_camera();
+ virtual void on_geometry_change();
virtual void on_child_added(Widget &);
};