diff options
| author | 2013-09-04 22:10:05 -0400 | |
|---|---|---|
| committer | 2013-09-04 22:10:05 -0400 | |
| commit | ed79f16b6ef7c1ac2bf923277ead730993019331 (patch) | |
| tree | 8158f3ebaa72cc9a091f4e7820f81fc92da706dc | |
| parent | various fixes to be able to build project (diff) | |
| download | yuzu-ed79f16b6ef7c1ac2bf923277ead730993019331.tar.gz yuzu-ed79f16b6ef7c1ac2bf923277ead730993019331.tar.xz yuzu-ed79f16b6ef7c1ac2bf923277ead730993019331.zip | |
deleting renamed directory
Diffstat (limited to '')
| -rw-r--r-- | src/akiru/src/emuwindow/emu_window_glfw.cpp | 100 | ||||
| -rw-r--r-- | src/akiru/src/emuwindow/emu_window_glfw.h | 56 |
2 files changed, 0 insertions, 156 deletions
diff --git a/src/akiru/src/emuwindow/emu_window_glfw.cpp b/src/akiru/src/emuwindow/emu_window_glfw.cpp deleted file mode 100644 index 884c10ad0..000000000 --- a/src/akiru/src/emuwindow/emu_window_glfw.cpp +++ /dev/null | |||
| @@ -1,100 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * Copyright (C) 2005-2012 Gekko Emulator | ||
| 3 | * | ||
| 4 | * @file emuwindow_glfw.h | ||
| 5 | * @author ShizZy <shizzy247@gmail.com> | ||
| 6 | * @date 2012-04-20 | ||
| 7 | * @brief Implementation implementation of EmuWindow class for GLFW | ||
| 8 | * | ||
| 9 | * @section LICENSE | ||
| 10 | * This program is free software; you can redistribute it and/or | ||
| 11 | * modify it under the terms of the GNU General Public License as | ||
| 12 | * published by the Free Software Foundation; either version 2 of | ||
| 13 | * the License, or (at your option) any later version. | ||
| 14 | * | ||
| 15 | * This program is distributed in the hope that it will be useful, but | ||
| 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 18 | * General Public License for more details at | ||
| 19 | * http://www.gnu.org/copyleft/gpl.html | ||
| 20 | * | ||
| 21 | * Official project repository can be found at: | ||
| 22 | * http://code.google.com/p/gekko-gc-emu/ | ||
| 23 | */ | ||
| 24 | |||
| 25 | #include "common.h" | ||
| 26 | #include "video_core.h" | ||
| 27 | #include "emuwindow_glfw.h" | ||
| 28 | #include "gc_controller.h" | ||
| 29 | #include "keyboard_input/keyboard_input.h" | ||
| 30 | |||
| 31 | static void OnKeyEvent(GLFWwindow win, int key, int action) { | ||
| 32 | EmuWindow_GLFW* emuwin = (EmuWindow_GLFW*)glfwGetWindowUserPointer(win); | ||
| 33 | input_common::GCController::GCButtonState state; | ||
| 34 | |||
| 35 | if (action == GLFW_PRESS) { | ||
| 36 | state = input_common::GCController::PRESSED; | ||
| 37 | } else { | ||
| 38 | state = input_common::GCController::RELEASED; | ||
| 39 | } | ||
| 40 | for (int channel = 0; channel < 4 && emuwin->controller_interface(); ++channel) { | ||
| 41 | emuwin->controller_interface()->SetControllerStatus(channel, key, state); | ||
| 42 | } | ||
| 43 | } | ||
| 44 | |||
| 45 | static void OnWindowSizeEvent(GLFWwindow win, int width, int height) { | ||
| 46 | EmuWindow_GLFW* emuwin = (EmuWindow_GLFW*)glfwGetWindowUserPointer(win); | ||
| 47 | emuwin->set_client_area_width(width); | ||
| 48 | emuwin->set_client_area_height(height); | ||
| 49 | } | ||
| 50 | |||
| 51 | /// EmuWindow_GLFW constructor | ||
| 52 | EmuWindow_GLFW::EmuWindow_GLFW() { | ||
| 53 | // Initialize the window | ||
| 54 | if(glfwInit() != GL_TRUE) { | ||
| 55 | LOG_ERROR(TVIDEO, "Failed to initialize GLFW! Exiting..."); | ||
| 56 | exit(E_ERR); | ||
| 57 | } | ||
| 58 | glfwWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3); | ||
| 59 | glfwWindowHint(GLFW_OPENGL_VERSION_MINOR, 1); | ||
| 60 | render_window_ = glfwCreateWindow(640, 480, GLFW_WINDOWED, "gekko", 0); | ||
| 61 | |||
| 62 | // Setup callbacks | ||
| 63 | glfwSetWindowUserPointer(render_window_, this); | ||
| 64 | glfwSetKeyCallback(render_window_, OnKeyEvent); | ||
| 65 | glfwSetWindowSizeCallback(render_window_, OnWindowSizeEvent); | ||
| 66 | |||
| 67 | DoneCurrent(); | ||
| 68 | } | ||
| 69 | |||
| 70 | /// EmuWindow_GLFW destructor | ||
| 71 | EmuWindow_GLFW::~EmuWindow_GLFW() { | ||
| 72 | glfwTerminate(); | ||
| 73 | } | ||
| 74 | |||
| 75 | /// Swap buffers to display the next frame | ||
| 76 | void EmuWindow_GLFW::SwapBuffers() { | ||
| 77 | glfwSwapBuffers(render_window_); | ||
| 78 | } | ||
| 79 | |||
| 80 | /// Polls window events | ||
| 81 | void EmuWindow_GLFW::PollEvents() { | ||
| 82 | // TODO(ShizZy): Does this belong here? This is a reasonable place to update the window title | ||
| 83 | // from the main thread, but this should probably be in an event handler... | ||
| 84 | static char title[128]; | ||
| 85 | sprintf(title, "%s (FPS: %02.02f)", window_title_.c_str(), | ||
| 86 | video_core::g_renderer->current_fps()); | ||
| 87 | glfwSetWindowTitle(render_window_, title); | ||
| 88 | |||
| 89 | glfwPollEvents(); | ||
| 90 | } | ||
| 91 | |||
| 92 | /// Makes the GLFW OpenGL context current for the caller thread | ||
| 93 | void EmuWindow_GLFW::MakeCurrent() { | ||
| 94 | glfwMakeContextCurrent(render_window_); | ||
| 95 | } | ||
| 96 | |||
| 97 | /// Releases (dunno if this is the "right" word) the GLFW context from the caller thread | ||
| 98 | void EmuWindow_GLFW::DoneCurrent() { | ||
| 99 | glfwMakeContextCurrent(NULL); | ||
| 100 | } | ||
diff --git a/src/akiru/src/emuwindow/emu_window_glfw.h b/src/akiru/src/emuwindow/emu_window_glfw.h deleted file mode 100644 index 1256cabe4..000000000 --- a/src/akiru/src/emuwindow/emu_window_glfw.h +++ /dev/null | |||
| @@ -1,56 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * Copyright (C) 2005-2012 Gekko Emulator | ||
| 3 | * | ||
| 4 | * @file emuwindow_glfw.h | ||
| 5 | * @author ShizZy <shizzy247@gmail.com> | ||
| 6 | * @date 2012-04-20 | ||
| 7 | * @brief Implementation implementation of EmuWindow class for GLFW | ||
| 8 | * | ||
| 9 | * @section LICENSE | ||
| 10 | * This program is free software; you can redistribute it and/or | ||
| 11 | * modify it under the terms of the GNU General Public License as | ||
| 12 | * published by the Free Software Foundation; either version 2 of | ||
| 13 | * the License, or (at your option) any later version. | ||
| 14 | * | ||
| 15 | * This program is distributed in the hope that it will be useful, but | ||
| 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 18 | * General Public License for more details at | ||
| 19 | * http://www.gnu.org/copyleft/gpl.html | ||
| 20 | * | ||
| 21 | * Official project repository can be found at: | ||
| 22 | * http://code.google.com/p/gekko-gc-emu/ | ||
| 23 | */ | ||
| 24 | |||
| 25 | #ifndef VIDEO_CORE_EMUWINDOW_GLFW_ | ||
| 26 | #define VIDEO_CORE_EMUWINDOW_GLFW_ | ||
| 27 | |||
| 28 | #include <GL/glew.h> | ||
| 29 | #include <GL/glfw3.h> | ||
| 30 | |||
| 31 | #include "video/emuwindow.h" | ||
| 32 | |||
| 33 | class EmuWindow_GLFW : public EmuWindow { | ||
| 34 | public: | ||
| 35 | EmuWindow_GLFW(); | ||
| 36 | ~EmuWindow_GLFW(); | ||
| 37 | |||
| 38 | /// Swap buffers to display the next frame | ||
| 39 | void SwapBuffers(); | ||
| 40 | |||
| 41 | /// Polls window events | ||
| 42 | void PollEvents(); | ||
| 43 | |||
| 44 | /// Makes the graphics context current for the caller thread | ||
| 45 | void MakeCurrent(); | ||
| 46 | |||
| 47 | /// Releases (dunno if this is the "right" word) the GLFW context from the caller thread | ||
| 48 | void DoneCurrent(); | ||
| 49 | |||
| 50 | GLFWwindow render_window_; ///< Internal GLFW render window | ||
| 51 | |||
| 52 | private: | ||
| 53 | |||
| 54 | }; | ||
| 55 | |||
| 56 | #endif // VIDEO_CORE_EMUWINDOW_GLFW_ | ||