Changeset d8cf709 in opengl-game for game-gui-glfw.cpp


Ignore:
Timestamp:
Feb 13, 2021, 11:41:39 PM (4 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
feature/imgui-sdl
Children:
c6f0793
Parents:
8b823e7
Message:

Change UIEvent to also include the original event from the UI library the game gui is currently using, such as SDL or GLFW.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • game-gui-glfw.cpp

    r8b823e7 rd8cf709  
    7979   if (glfwWindowShouldClose(window)) {
    8080      UIEvent e;
    81       e.type = UI_EVENT_QUIT;
     81      e.event.type = UI_EVENT_QUIT;
    8282
    8383      s_events.push(e);
     
    147147void glfw_key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) {
    148148   UIEvent e;
    149    e.type = action == GLFW_RELEASE ? UI_EVENT_KEYUP : UI_EVENT_KEYDOWN;
    150    e.key.keycode = key;
     149   e.event.type = action == GLFW_RELEASE ? UI_EVENT_KEYUP : UI_EVENT_KEYDOWN;
     150   e.event.key.keycode = key;
    151151
    152152   GameGui_GLFW::s_events.push(e);
     
    155155void glfw_window_size_callback(GLFWwindow* window, int width, int height) {
    156156   UIEvent e;
    157    e.type = UI_EVENT_WINDOWRESIZE;
    158    e.windowResize.width = width;
    159    e.windowResize.height = height;
     157   e.event.type = UI_EVENT_WINDOWRESIZE;
     158   e.event.windowResize.width = width;
     159   e.event.windowResize.height = height;
    160160
    161161   GameGui_GLFW::s_events.push(e);
Note: See TracChangeset for help on using the changeset viewer.