GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: Add Line Numbers


A Paste by taby
#ifndef SJH_UI_FEEDBACK
#define SJH_UI_FEEDBACK


#include <vector>
using std::vector;

class ui_feedback
{
public:
    vector<bool> function_keys;
    vector<bool> alpha;
    vector<bool> numeric;
    bool ctrl;
    bool alt;
    bool shift;
    bool plus;
    bool minus;

    bool lmb;
    bool mmb;
    bool rmb;

    size_t video_resize_x;
    size_t video_resize_y;

    size_t mouse_x;
    size_t mouse_y;
    size_t prev_mouse_x;
    size_t prev_mouse_y;
    long signed int mouse_delta_x;
    long signed int mouse_delta_y;

    ui_feedback(void);
    void reset(void);
};


#endif


ui_feedback::ui_feedback(void)
{
    function_keys.reserve(12);
    alpha.reserve(26);
    numeric.reserve(10);

    reset();
}

void ui_feedback::reset(void)
{
    function_keys.clear();
    function_keys.resize(12, false);

    alpha.clear();
    alpha.resize(26, false);

    numeric.clear();
    numeric.resize(10, false);

    ctrl = false;
    alt = false;
    shift = false;
    plus = false;
    minus = false;
    lmb = false;
    mmb = false;
    rmb = false;

    video_resize_x = 0;
    video_resize_y = 0;
    mouse_x = 0;
    mouse_y = 0;
    prev_mouse_x = 0;
    prev_mouse_y = 0;
    mouse_delta_x = 0;
    mouse_delta_y = 0;
}