new widgets
This commit is contained in:
parent
5cc982fa00
commit
285ca80b4b
18 changed files with 373 additions and 43 deletions
|
|
@ -43,6 +43,7 @@ void EventHandler::processEvent() {
|
|||
switch (eventData.type) {
|
||||
case InputEvent::Type::MOUSE_POS:
|
||||
{
|
||||
mPointerPrev = mPointer;
|
||||
mPointer = eventData.mouseEvent;
|
||||
mEventQueue.popFront();
|
||||
break;
|
||||
|
|
@ -77,6 +78,8 @@ void EventHandler::processEvent() {
|
|||
|
||||
const Vec2F& EventHandler::getPointer() const { return mPointer; }
|
||||
|
||||
const Vec2F& EventHandler::getPointerPrev() const { return mPointerPrev; }
|
||||
|
||||
bool EventHandler::isPressed(InputID id) const {
|
||||
return mInputStates[(int) id].mCurrentState == InputState::State::PRESSED;
|
||||
}
|
||||
|
|
@ -92,4 +95,6 @@ bool EventHandler::isDown(InputID id) const {
|
|||
mInputStates[(int) id].mCurrentState == InputState::State::HOLD;
|
||||
}
|
||||
|
||||
halnf EventHandler::getScrollY() const { return 0; }
|
||||
halnf EventHandler::getScrollY() const { return 0; }
|
||||
|
||||
Vec2F EventHandler::getPointerDelta() const { return mPointer - mPointerPrev; }
|
||||
|
|
|
|||
|
|
@ -23,6 +23,17 @@ void Application::run() {
|
|||
|
||||
bool redrawNeeded = false;
|
||||
|
||||
// proc first frame by default
|
||||
{
|
||||
mWindow->processEvents();
|
||||
processFrame(eventHandler);
|
||||
|
||||
mGraphics->drawBegin();
|
||||
drawFrame(mGraphics->getCanvas());
|
||||
mGraphics->drawEnd();
|
||||
mWindow->draw();
|
||||
}
|
||||
|
||||
while (!mWindow->shouldClose()) {
|
||||
if (mProcTimer.isTimeout()) {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue