Merge pull request #300 from wheremyfoodat/rhappy

Split panda_sdl and panda_qt
This commit is contained in:
wheremyfoodat 2023-09-30 11:56:43 +03:00 committed by GitHub
commit 76f30eae5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 14 deletions

View file

@ -137,7 +137,7 @@ else()
message(FATAL_ERROR "Currently unsupported CPU architecture")
endif()
set(SOURCE_FILES src/main.cpp src/emulator.cpp src/io_file.cpp src/config.cpp
set(SOURCE_FILES src/emulator.cpp src/io_file.cpp src/config.cpp
src/core/CPU/cpu_dynarmic.cpp src/core/CPU/dynarmic_cycles.cpp
src/core/memory.cpp src/renderer.cpp src/core/renderer_null/renderer_null.cpp
src/http_server.cpp src/stb_image_write.c src/core/cheats.cpp src/core/action_replay.cpp
@ -177,6 +177,13 @@ set(FS_SOURCE_FILES src/core/fs/archive_self_ncch.cpp src/core/fs/archive_save_d
set(APPLET_SOURCE_FILES src/core/applets/applet.cpp src/core/applets/mii_selector.cpp src/core/applets/software_keyboard.cpp src/core/applets/applet_manager.cpp)
set(RENDERER_SW_SOURCE_FILES src/core/renderer_sw/renderer_sw.cpp)
# Frontend source files
if(ENABLE_QT_GUI)
set(FRONTEND_SOURCE_FILES src/panda_qt/main.cpp)
else()
set(FRONTEND_SOURCE_FILES src/panda_sdl/main.cpp)
endif()
set(HEADER_FILES include/emulator.hpp include/helpers.hpp include/termcolor.hpp
include/cpu.hpp include/cpu_dynarmic.hpp include/memory.hpp include/renderer.hpp include/kernel/kernel.hpp
include/dynarmic_cp15.hpp include/kernel/resource_limits.hpp include/kernel/kernel_types.hpp
@ -309,14 +316,12 @@ if(ENABLE_VULKAN)
set(HEADER_FILES ${HEADER_FILES} ${RENDERER_VK_INCLUDE_FILES})
source_group("Source Files\\Core\\Vulkan Renderer" FILES ${RENDERER_VK_SOURCE_FILES})
set(RENDERER_VK_HOST_SHADERS_SOURCE
"src/host_shaders/vulkan_display.frag"
"src/host_shaders/vulkan_display.vert"
)
set( RENDERER_VK_HOST_SHADERS_FLAGS -e main --target-env vulkan1.1)
set(RENDERER_VK_HOST_SHADERS_FLAGS -e main --target-env vulkan1.1)
if(GPU_DEBUG_INFO)
# generate nonsemantic shader debug information with source
@ -347,8 +352,8 @@ if(ENABLE_VULKAN)
endif()
source_group("Header Files\\Core" FILES ${HEADER_FILES})
set(ALL_SOURCES ${SOURCE_FILES} ${FS_SOURCE_FILES} ${CRYPTO_SOURCE_FILES} ${KERNEL_SOURCE_FILES} ${LOADER_SOURCE_FILES} ${SERVICE_SOURCE_FILES}
${APPLET_SOURCE_FILES} ${RENDERER_SW_SOURCE_FILES} ${PICA_SOURCE_FILES} ${THIRD_PARTY_SOURCE_FILES} ${HEADER_FILES})
set(ALL_SOURCES ${SOURCE_FILES} ${FRONTEND_SOURCE_FILES} ${FS_SOURCE_FILES} ${CRYPTO_SOURCE_FILES} ${KERNEL_SOURCE_FILES}
${LOADER_SOURCE_FILES} ${SERVICE_SOURCE_FILES} ${APPLET_SOURCE_FILES} ${RENDERER_SW_SOURCE_FILES} ${PICA_SOURCE_FILES} ${THIRD_PARTY_SOURCE_FILES} ${HEADER_FILES})
if(ENABLE_OPENGL)
# Add the OpenGL source files to ALL_SOURCES

12
src/panda_qt/main.cpp Normal file
View file

@ -0,0 +1,12 @@
#include <QApplication>
#include <QtWidgets>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QWidget window;
window.resize(320, 240);
window.show();
window.setWindowTitle("Alber");
return app.exec();
}

View file

@ -1,15 +1,7 @@
#include "emulator.hpp"
#ifdef PANDA3DS_FRONTEND_QT
#include <QApplication>
#endif
int main(int argc, char *argv[]) {
Emulator emu;
#ifdef PANDA3DS_FRONTEND_QT
QApplication app(argc, argv);
return app.exec();
#endif
emu.initGraphicsContext();
if (argc > 1) {