Changeset b8d4456 in opengl-game


Ignore:
Timestamp:
Jun 8, 2020, 6:49:39 PM (4 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master
Children:
4e705d6
Parents:
4a9416a
Message:

Add x and y coordinates to mouse events

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • consts.hpp

    r4a9416a rb8d4456  
    44#define GAME_VERSION "0.01.000"
    55
     6// TODO: Rename these using some other prefix
    67#define RTWO_SUCCESS true
    78#define RTWO_ERROR false
  • docs/README.txt

    r4a9416a rb8d4456  
    9696Download the vulkan sdk (make sure VULKAN_SDK_PATH in the makefile points to it)
    9797
    98 brew install sdl2 sdl2_image sdl2_ttf
     98brew install sdl2 sdl2_image sdl2_ttf sdl2_gfx
    9999
    100100make vulkangame && ./vulkangame
  • docs/TODO.txt

    r4a9416a rb8d4456  
    22==========
    33- Switch the game to use SDL and Vulkan (based on the test program I already made)
    4   - Will require switching the UI from IMGUI to Vulkan
     4  - Will require switching the UI from IMGUI to SDL
    55- Make window resizing and fullscreen mode work correctly
    66
  • game-gui-sdl.cpp

    r4a9416a rb8d4456  
    2727
    2828   if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
    29       return RTWO_ERROR;
    30    }
    31 
    32    int imgFlags = IMG_INIT_PNG;
    33    if (!(IMG_Init(imgFlags) & imgFlags)) {
    3429      return RTWO_ERROR;
    3530   }
     
    123118            break;
    124119         case SDL_MOUSEMOTION:
     120            event->mouse.x = e.motion.x;
     121            event->mouse.y = e.motion.y;
    125122         case SDL_FINGERMOTION:
    126123            event->type = UI_EVENT_MOUSEMOTION;
  • game-gui-sdl.hpp

    r4a9416a rb8d4456  
    55
    66#include <SDL2/SDL.h>
    7 #include <SDL2/SDL_image.h>
    87#include <SDL2/SDL_ttf.h>
    98
  • game-gui.hpp

    r4a9416a rb8d4456  
    3535struct MouseEvent {
    3636   EventType type;
     37   int x;
     38   int y;
    3739   /*
    3840      int button;
    3941      int action;
    40       int x;
    41       int y;
    4242   */
    4343};
  • vulkan-utils.hpp

    r4a9416a rb8d4456  
    99
    1010#include <SDL2/SDL.h>
    11 #include <SDL2/SDL_image.h>
    1211#include <SDL2/SDL_vulkan.h>
    1312
Note: See TracChangeset for help on using the changeset viewer.