diff options
author | bunnei <bunneidev@gmail.com> | 2014-05-20 03:46:57 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2014-05-20 03:46:57 +0200 |
commit | 204c6bfeca2d3bccfe6602699c0b3420f88aaf07 (patch) | |
tree | 4ece05e69f90f50e3390eb93a0790180aafcdbc6 /src/citra | |
parent | updated Travis-CI image/link in readme for new project repo (diff) | |
parent | common_types: Changed BasicRect back to Rect, in the common namespace (diff) | |
download | yuzu-204c6bfeca2d3bccfe6602699c0b3420f88aaf07.tar yuzu-204c6bfeca2d3bccfe6602699c0b3420f88aaf07.tar.gz yuzu-204c6bfeca2d3bccfe6602699c0b3420f88aaf07.tar.bz2 yuzu-204c6bfeca2d3bccfe6602699c0b3420f88aaf07.tar.lz yuzu-204c6bfeca2d3bccfe6602699c0b3420f88aaf07.tar.xz yuzu-204c6bfeca2d3bccfe6602699c0b3420f88aaf07.tar.zst yuzu-204c6bfeca2d3bccfe6602699c0b3420f88aaf07.zip |
Diffstat (limited to '')
-rw-r--r-- | src/citra/CMakeLists.txt | 11 | ||||
-rw-r--r-- | src/citra/emu_window/emu_window_glfw.cpp | 9 | ||||
-rw-r--r-- | src/citra_qt/CMakeLists.txt | 25 | ||||
-rw-r--r-- | src/citra_qt/bootmanager.cpp | 34 |
4 files changed, 59 insertions, 20 deletions
diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt index 147f51e94..1ad607d76 100644 --- a/src/citra/CMakeLists.txt +++ b/src/citra/CMakeLists.txt @@ -1,12 +1,19 @@ set(SRCS citra.cpp emu_window/emu_window_glfw.cpp) +set(HEADERS citra.h + resource.h) # NOTE: This is a workaround for CMake bug 0006976 (missing X11_xf86vmode_LIB variable) if (NOT X11_xf86vmode_LIB) set(X11_xv86vmode_LIB Xxf86vm) endif() -add_executable(citra ${SRCS}) -target_link_libraries(citra core common video_core GLEW pthread X11 Xxf86vm Xi Xcursor ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} rt ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB}) +add_executable(citra ${SRCS} ${HEADERS}) + +if (APPLE) + target_link_libraries(citra core common video_core iconv pthread ${COREFOUNDATION_LIBRARY} ${OPENGL_LIBRARIES} ${GLEW_LIBRARY} ${GLFW_LIBRARIES}) +else() + target_link_libraries(citra core common video_core GLEW pthread X11 Xxf86vm Xi Xcursor ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} rt ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB}) +endif() #install(TARGETS citra RUNTIME DESTINATION ${bindir}) diff --git a/src/citra/emu_window/emu_window_glfw.cpp b/src/citra/emu_window/emu_window_glfw.cpp index e6943f146..73c116373 100644 --- a/src/citra/emu_window/emu_window_glfw.cpp +++ b/src/citra/emu_window/emu_window_glfw.cpp @@ -27,11 +27,18 @@ EmuWindow_GLFW::EmuWindow_GLFW() { exit(1); } glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1); + glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); + glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); + glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); m_render_window = glfwCreateWindow(VideoCore::kScreenTopWidth, (VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight), m_window_title.c_str(), NULL, NULL); + if (m_render_window == NULL) { + printf("Failed to create GLFW window! Exiting..."); + exit(1); + } + // Setup callbacks glfwSetWindowUserPointer(m_render_window, this); //glfwSetKeyCallback(m_render_window, OnKeyEvent); diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index 594460a71..549f69217 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt @@ -8,6 +8,23 @@ set(SRCS main.cpp config/controller_config.cpp config/controller_config_util.cpp) +set (HEADERS + bootmanager.hxx + debugger/callstack.hxx + debugger/disassembler.hxx + debugger/ramview.hxx + debugger/registers.hxx + hotkeys.hxx + main.hxx + ui_callstack.h + ui_controller_config.h + ui_disassembler.h + ui_hotkeys.h + ui_main.h + ui_registers.h + version.h + config/controller_config.hxx + config/controller_config_util.hxx) qt4_wrap_ui(UI_HDRS debugger/callstack.ui @@ -32,7 +49,11 @@ qt4_wrap_cpp(MOC_SRCS include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(./) -add_executable(citra-qt ${SRCS} ${MOC_SRCS} ${UI_HDRS}) -target_link_libraries(citra-qt core common video_core qhexedit ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${SDL2_LIBRARY} rt GLEW ${GLFW_LIBRARIES}) +add_executable(citra-qt ${SRCS} ${HEADERS} ${MOC_SRCS} ${UI_HDRS}) +if (APPLE) + target_link_libraries(citra-qt core common video_core qhexedit iconv ${COREFOUNDATION_LIBRARY} ${QT_LIBRARIES} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES}) +else() + target_link_libraries(citra-qt core common video_core qhexedit ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${SDL2_LIBRARY} rt GLEW ${GLFW_LIBRARIES}) +endif() #install(TARGETS citra-qt RUNTIME DESTINATION ${bindir}) diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index cf9e1bffc..f85116419 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -50,7 +50,7 @@ void EmuThread::run() void EmuThread::Stop() { - if (!isRunning()) + if (!isRunning()) { INFO_LOG(MASTER_LOG, "EmuThread::Stop called while emu thread wasn't running, returning..."); return; @@ -65,7 +65,7 @@ void EmuThread::Stop() terminate(); wait(1000); if (isRunning()) - WARN_LOG(MASTER_LOG, "EmuThread STILL running, something is wrong here..."); + WARN_LOG(MASTER_LOG, "EmuThread STILL running, something is wrong here..."); } INFO_LOG(MASTER_LOG, "EmuThread stopped"); } @@ -76,9 +76,8 @@ void EmuThread::Stop() class GGLWidgetInternal : public QGLWidget { public: - GGLWidgetInternal(GRenderWindow* parent) : QGLWidget(parent) + GGLWidgetInternal(QGLFormat fmt, GRenderWindow* parent) : QGLWidget(parent) { - setAutoBufferSwap(false); doneCurrent(); parent_ = parent; } @@ -106,8 +105,13 @@ EmuThread& GRenderWindow::GetEmuThread() GRenderWindow::GRenderWindow(QWidget* parent) : QWidget(parent), emu_thread(this) { // TODO: One of these flags might be interesting: WA_OpaquePaintEvent, WA_NoBackground, WA_DontShowOnScreen, WA_DeleteOnClose - - child = new GGLWidgetInternal(this); + QGLFormat fmt; + fmt.setProfile(QGLFormat::CoreProfile); + fmt.setVersion(3,2); + fmt.setSampleBuffers(true); + fmt.setSamples(4); + + child = new GGLWidgetInternal(fmt, this); QBoxLayout* layout = new QHBoxLayout(this); resize(VideoCore::kScreenTopWidth, VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight); layout->addWidget(child); @@ -147,12 +151,12 @@ void GRenderWindow::DoneCurrent() void GRenderWindow::PollEvents() { // TODO(ShizZy): Does this belong here? This is a reasonable place to update the window title // from the main thread, but this should probably be in an event handler... - /* - static char title[128]; + /* + static char title[128]; sprintf(title, "%s (FPS: %02.02f)", window_title_.c_str(), video_core::g_renderer->current_fps()); setWindowTitle(title); - */ + */ } void GRenderWindow::BackupGeometry() @@ -185,26 +189,26 @@ QByteArray GRenderWindow::saveGeometry() void GRenderWindow::keyPressEvent(QKeyEvent* event) { - /* - bool key_processed = false; + /* + bool key_processed = false; for (unsigned int channel = 0; channel < 4 && controller_interface(); ++channel) if (controller_interface()->SetControllerStatus(channel, event->key(), input_common::GCController::PRESSED)) key_processed = true; if (!key_processed) QWidget::keyPressEvent(event); - */ + */ } void GRenderWindow::keyReleaseEvent(QKeyEvent* event) { - /* - bool key_processed = false; + /* + bool key_processed = false; for (unsigned int channel = 0; channel < 4 && controller_interface(); ++channel) if (controller_interface()->SetControllerStatus(channel, event->key(), input_common::GCController::RELEASED)) key_processed = true; if (!key_processed) QWidget::keyPressEvent(event); - */ + */ }
\ No newline at end of file |