2014-04-08 20:25:53 -04:00
|
|
|
// Copyright 2014 Citra Emulator Project
|
2014-12-16 21:38:14 -08:00
|
|
|
// Licensed under GPLv2 or any later version
|
2014-04-08 20:25:53 -04:00
|
|
|
// Refer to the license.txt file included.
|
2013-09-04 22:10:47 -04:00
|
|
|
|
2014-04-06 16:55:05 -04:00
|
|
|
#pragma once
|
2013-09-04 22:10:47 -04:00
|
|
|
|
2014-04-08 20:15:08 -04:00
|
|
|
#include "common/emu_window.h"
|
2013-09-04 22:10:47 -04:00
|
|
|
|
2014-10-12 18:14:57 +02:00
|
|
|
struct GLFWwindow;
|
|
|
|
|
2013-09-04 22:10:47 -04:00
|
|
|
class EmuWindow_GLFW : public EmuWindow {
|
|
|
|
public:
|
|
|
|
EmuWindow_GLFW();
|
|
|
|
~EmuWindow_GLFW();
|
|
|
|
|
|
|
|
/// Swap buffers to display the next frame
|
2014-10-26 02:56:13 -02:00
|
|
|
void SwapBuffers() override;
|
2013-09-04 22:10:47 -04:00
|
|
|
|
2014-11-19 09:02:05 +00:00
|
|
|
/// Polls window events
|
|
|
|
void PollEvents() override;
|
2013-09-04 22:10:47 -04:00
|
|
|
|
|
|
|
/// Makes the graphics context current for the caller thread
|
2014-10-26 02:56:13 -02:00
|
|
|
void MakeCurrent() override;
|
2014-08-29 22:23:12 -07:00
|
|
|
|
2013-09-04 22:10:47 -04:00
|
|
|
/// Releases (dunno if this is the "right" word) the GLFW context from the caller thread
|
2014-10-26 02:56:13 -02:00
|
|
|
void DoneCurrent() override;
|
2013-09-04 22:10:47 -04:00
|
|
|
|
2014-09-08 21:46:02 -07:00
|
|
|
static void OnKeyEvent(GLFWwindow* win, int key, int scancode, int action, int mods);
|
2013-09-04 22:10:47 -04:00
|
|
|
|
2015-03-08 03:19:33 -04:00
|
|
|
static void OnMouseButtonEvent(GLFWwindow* window, int button, int action, int mods);
|
|
|
|
|
|
|
|
static void OnCursorPosEvent(GLFWwindow* window, double x, double y);
|
|
|
|
|
2014-10-15 18:48:02 -07:00
|
|
|
/// Whether the window is still open, and a close request hasn't yet been sent
|
|
|
|
const bool IsOpen();
|
|
|
|
|
2014-10-12 18:14:57 +02:00
|
|
|
static void OnClientAreaResizeEvent(GLFWwindow* win, int width, int height);
|
2014-09-12 17:06:13 -07:00
|
|
|
|
2014-10-12 18:14:57 +02:00
|
|
|
static void OnFramebufferResizeEvent(GLFWwindow* win, int width, int height);
|
|
|
|
|
|
|
|
void ReloadSetKeymaps() override;
|
2014-08-29 22:23:12 -07:00
|
|
|
|
2013-09-04 22:10:47 -04:00
|
|
|
private:
|
2014-10-12 22:46:33 +02:00
|
|
|
void OnMinimalClientAreaChangeRequest(const std::pair<unsigned,unsigned>& minimal_size) override;
|
|
|
|
|
2014-10-12 18:14:57 +02:00
|
|
|
static EmuWindow_GLFW* GetEmuWindow(GLFWwindow* win);
|
|
|
|
|
2014-09-08 21:46:02 -07:00
|
|
|
GLFWwindow* m_render_window; ///< Internal GLFW render window
|
2014-09-12 17:06:13 -07:00
|
|
|
|
|
|
|
/// Device id of keyboard for use with KeyMap
|
|
|
|
int keyboard_id;
|
2013-09-04 22:10:47 -04:00
|
|
|
};
|