mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-21 05:09:46 -06:00
get a Qt window showing up. 'tis a start, I guess.
This commit is contained in:
@ -9,8 +9,11 @@ if (WIN32)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Qt5 COMPONENTS Core REQUIRED)
|
find_package(Qt5 COMPONENTS Core REQUIRED)
|
||||||
|
find_package(Qt5 COMPONENTS Gui REQUIRED)
|
||||||
find_package(Qt5 COMPONENTS Widgets REQUIRED)
|
find_package(Qt5 COMPONENTS Widgets REQUIRED)
|
||||||
|
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_check_modules(SDL2 REQUIRED sdl2)
|
pkg_check_modules(SDL2 REQUIRED sdl2)
|
||||||
|
|
||||||
@ -41,14 +44,14 @@ if (UNIX)
|
|||||||
--generate-header "${CMAKE_SOURCE_DIR}/melon_grc.xml")
|
--generate-header "${CMAKE_SOURCE_DIR}/melon_grc.xml")
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
target_link_libraries(melonDS dl Qt5::Core Qt5::Widgets)
|
target_link_libraries(melonDS dl Qt5::Core Qt5::Gui Qt5::Widgets)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
target_sources(melonDS PUBLIC melon_grc.c)
|
target_sources(melonDS PUBLIC melon_grc.c)
|
||||||
elseif (WIN32)
|
elseif (WIN32)
|
||||||
target_sources(melonDS PUBLIC "${CMAKE_SOURCE_DIR}/melon.rc")
|
target_sources(melonDS PUBLIC "${CMAKE_SOURCE_DIR}/melon.rc")
|
||||||
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../..")
|
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../..")
|
||||||
target_link_libraries(melonDS comctl32 d2d1 dwrite uxtheme ws2_32 iphlpapi gdi32 Qt5::Core Qt5::Widgets)
|
target_link_libraries(melonDS comctl32 d2d1 dwrite uxtheme ws2_32 iphlpapi gdi32 Qt5::Core Qt5::Gui Qt5::Widgets)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
install(FILES ../../net.kuribo64.melonDS.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
|
install(FILES ../../net.kuribo64.melonDS.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
|
||||||
|
@ -21,15 +21,26 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
// Qt includes and shit here, I guess
|
#include <QApplication>
|
||||||
#include <QtCore/QBitArray>
|
#include <QMainWindow>
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
#include "../../version.h"
|
#include "../../version.h"
|
||||||
|
|
||||||
|
|
||||||
//
|
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent)
|
||||||
|
{
|
||||||
|
setWindowTitle("melonDS - assfucking Qt version");
|
||||||
|
|
||||||
|
// burp
|
||||||
|
QWidget *centralWidget = new QWidget(this);
|
||||||
|
setCentralWidget(centralWidget);
|
||||||
|
}
|
||||||
|
|
||||||
|
MainWindow::~MainWindow()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
@ -39,10 +50,12 @@ int main(int argc, char** argv)
|
|||||||
printf("melonDS " MELONDS_VERSION "\n");
|
printf("melonDS " MELONDS_VERSION "\n");
|
||||||
printf(MELONDS_URL "\n");
|
printf(MELONDS_URL "\n");
|
||||||
|
|
||||||
printf("Arisotura hereby admits defeat\n");
|
QApplication melon(argc, argv);
|
||||||
printf("NI DIEU NI MAITRE\n");
|
|
||||||
|
|
||||||
return 0;
|
MainWindow win;
|
||||||
|
win.show();
|
||||||
|
|
||||||
|
return melon.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
@ -59,7 +72,7 @@ int CALLBACK WinMain(HINSTANCE hinst, HINSTANCE hprev, LPSTR cmdline, int cmdsho
|
|||||||
for (int i = 0; i < argc; i++)
|
for (int i = 0; i < argc; i++)
|
||||||
{
|
{
|
||||||
int len = WideCharToMultiByte(CP_UTF8, 0, argv_w[i], -1, NULL, 0, NULL, NULL);
|
int len = WideCharToMultiByte(CP_UTF8, 0, argv_w[i], -1, NULL, 0, NULL, NULL);
|
||||||
if (len < 1) return NULL;
|
if (len < 1) { argv[i] = nullarg; continue; }
|
||||||
argv[i] = new char[len];
|
argv[i] = new char[len];
|
||||||
int res = WideCharToMultiByte(CP_UTF8, 0, argv_w[i], -1, argv[i], len, NULL, NULL);
|
int res = WideCharToMultiByte(CP_UTF8, 0, argv_w[i], -1, argv[i], len, NULL, NULL);
|
||||||
if (res != len) { delete[] argv[i]; argv[i] = nullarg; }
|
if (res != len) { delete[] argv[i]; argv[i] = nullarg; }
|
||||||
|
@ -19,6 +19,18 @@
|
|||||||
#ifndef MAIN_H
|
#ifndef MAIN_H
|
||||||
#define MAIN_H
|
#define MAIN_H
|
||||||
|
|
||||||
// put the class shit here
|
#include <QMainWindow>
|
||||||
|
|
||||||
|
class MainWindow : public QMainWindow
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit MainWindow(QWidget* parent = nullptr);
|
||||||
|
~MainWindow();
|
||||||
|
|
||||||
|
private:
|
||||||
|
// private shit goes here
|
||||||
|
};
|
||||||
|
|
||||||
#endif // MAIN_H
|
#endif // MAIN_H
|
||||||
|
Reference in New Issue
Block a user