Changeset 1ce9afe in opengl-game for game-gui-glfw.hpp


Ignore:
Timestamp:
Sep 2, 2019, 7:40:49 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
7fc5e27
Parents:
301d0d4
Message:

Add a fullscreen flag to GameGui::CreateWindow and implement fullscreen functionality and the ability to detect key presses in openglgame

File:
1 edited

Legend:

Unmodified
Added
Removed
  • game-gui-glfw.hpp

    r301d0d4 r1ce9afe  
    1010#include <GLFW/glfw3.h>
    1111
     12#define NUM_KEYS (512)
     13
    1214class GameGui_GLFW : public GameGui {
    1315   public:
     16      static string s_errorMessage; // Has to be public so that glfw_error_callback can access it
     17
     18      // Both have to be public so that glfw_key_callback can access them
     19      // TODO: Implement a more generic public api over this to get the key state
     20      static int s_keyState[NUM_KEYS];
     21      static bool s_keyDown[NUM_KEYS];
     22
    1423      string& GetError();
    15 
    16       static string s_errorMessage; // Has to be public so that glfw_error_callback can access it
    1724
    1825      bool Init();
    1926      void Shutdown();
    2027
    21       void* CreateWindow(const string& title, unsigned int width, unsigned int height);
     28      void* CreateWindow(const string& title, unsigned int width, unsigned int height, bool fullscreen);
    2229      void DestroyWindow();
    2330
     
    3441
    3542void glfw_error_callback(int error, const char* description);
     43void glfw_key_callback(GLFWwindow* window, int key, int scancode, int action, int mods);
    3644
    3745#endif // _GAME_GUI_GLFW_H
Note: See TracChangeset for help on using the changeset viewer.