2014-04-09 02:25:53 +02:00
|
|
|
// Copyright 2014 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2013-09-05 04:10:47 +02:00
|
|
|
|
2014-04-06 22:55:05 +02:00
|
|
|
#pragma once
|
2013-09-05 04:10:47 +02:00
|
|
|
|
|
|
|
#include <GLFW/glfw3.h>
|
|
|
|
|
2014-04-09 02:15:08 +02:00
|
|
|
#include "common/emu_window.h"
|
2013-09-05 04:10:47 +02:00
|
|
|
|
|
|
|
class EmuWindow_GLFW : public EmuWindow {
|
|
|
|
public:
|
|
|
|
EmuWindow_GLFW();
|
|
|
|
~EmuWindow_GLFW();
|
|
|
|
|
|
|
|
/// Swap buffers to display the next frame
|
2014-10-26 05:56:13 +01:00
|
|
|
void SwapBuffers() override;
|
2013-09-05 04:10:47 +02:00
|
|
|
|
|
|
|
/// Polls window events
|
2014-10-26 05:56:13 +01:00
|
|
|
void PollEvents() override;
|
2013-09-05 04:10:47 +02:00
|
|
|
|
|
|
|
/// Makes the graphics context current for the caller thread
|
2014-10-26 05:56:13 +01:00
|
|
|
void MakeCurrent() override;
|
2014-08-30 07:23:12 +02:00
|
|
|
|
2013-09-05 04:10:47 +02:00
|
|
|
/// Releases (dunno if this is the "right" word) the GLFW context from the caller thread
|
2014-10-26 05:56:13 +01:00
|
|
|
void DoneCurrent() override;
|
2013-09-05 04:10:47 +02:00
|
|
|
|
2014-09-09 06:46:02 +02:00
|
|
|
static void OnKeyEvent(GLFWwindow* win, int key, int scancode, int action, int mods);
|
2013-09-05 04:10:47 +02:00
|
|
|
|
2014-10-16 03:48:02 +02:00
|
|
|
/// Whether the window is still open, and a close request hasn't yet been sent
|
|
|
|
const bool IsOpen();
|
|
|
|
|
2014-09-13 02:06:13 +02:00
|
|
|
void ReloadSetKeymaps() override;
|
|
|
|
|
2014-08-30 07:23:12 +02:00
|
|
|
/// Gets the size of the window in pixels
|
|
|
|
void GetFramebufferSize(int* fbWidth, int* fbHeight);
|
|
|
|
|
2013-09-05 04:10:47 +02:00
|
|
|
private:
|
2014-09-09 06:46:02 +02:00
|
|
|
GLFWwindow* m_render_window; ///< Internal GLFW render window
|
2014-09-13 02:06:13 +02:00
|
|
|
|
|
|
|
/// Device id of keyboard for use with KeyMap
|
|
|
|
int keyboard_id;
|
2013-09-05 04:10:47 +02:00
|
|
|
};
|