#include <msp/gl/blend.h>
#include <msp/gl/extensions/arb_shader_objects.h>
#include <msp/gl/programbuilder.h>
+#include <msp/gl/tests.h>
#include <msp/gl/uniform.h>
#include <msp/input/keys.h>
-#include <msp/time/units.h>
#include <msp/time/utils.h>
#include "label.h"
#include "style.h"
namespace Msp {
namespace GLtk {
-Root::Root(const Resources &r, Graphics::Window &window):
+Root::Root(Resources &r, Graphics::Window &window):
resources(r),
keyboard(new Input::Keyboard(window)),
input_method(0),
init(&window);
}
-Root::Root(const Resources &r, Graphics::Window *window, Input::Keyboard *k, Input::Mouse *m, Input::Touchscreen *t):
+Root::Root(Resources &r, Graphics::Window *window, Input::Keyboard *k, Input::Mouse *m, Input::Touchscreen *t):
resources(r),
keyboard(k),
input_method(0),
else
shprog = 0;
+ if(keyboard)
+ set_state(FOCUS);
+
update_style();
if(mouse)
void Root::tick()
{
+ Time::TimeStamp t = Time::now();
+ Time::TimeDelta dt = (last_tick ? t-last_tick : Time::zero);
+ last_tick = t;
+
+ animate(dt);
+
if(tooltip_timeout && Time::now()>tooltip_timeout)
{
std::string tip;
}
}
-void Root::render(const GL::Tag &tag) const
+void Root::render() const
{
- if(tag.id)
- return;
-
GL::Bind bind_blend(GL::Blend::alpha());
GL::Renderer renderer(&camera);
if(tag.id)
return;
- renderer.end();
- render(tag);
+ GL::Renderer::Push push(renderer);
+ renderer.set_camera(camera);
+ renderer.set_shader_program(shprog);
+ GL::BindRestore bind_blend(GL::Blend::alpha());
+ GL::BindRestore unbind_dtest(static_cast<GL::DepthTest *>(0));
+ Widget::render(renderer);
}
bool Root::button_press_event(unsigned btn)