Merge pull request #29 from Xele02/qtwindow

Update native for Qt Window
This commit is contained in:
Henrik Rydgård committed 2013-01-13 15:06:38 -08:00
commit 170a45ef4f
4 files changed
+51 -6

No files matched your search

+35 -1
View File
@@ -15,6 +15,16 @@
#endif
#include "QtMain.h"
#ifdef LINUX
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "qtapp.h"
#ifdef Q_WS_X11
#include <X11/Xlib.h>
#endif
MainWindow* qMW;
#endif
void LaunchBrowser(const char *url)
{
QDesktopServices::openUrl(QUrl(url));
@@ -52,11 +62,23 @@ float CalculateDPIScale()
int main(int argc, char *argv[])
{
#ifdef LINUX
#ifdef Q_WS_X11
XInitThreads();
#endif
#endif
QApplication a(argc, argv);
// Lock orientation to landscape on Symbian
#ifdef __SYMBIAN32__
QT_TRAP_THROWING(dynamic_cast<CAknAppUi*>(CEikonEnv::Static()->AppUi())->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape));
#endif
#ifdef LINUX
pixel_xres = 480;
pixel_yres = 272;
float dpi_scale = 1;
dp_xres = (int)(pixel_xres * dpi_scale); dp_yres = (int)(pixel_yres * dpi_scale);
#else
QSize res = QApplication::desktop()->screenGeometry().size();
#ifdef USING_GLES2
if (res.width() < res.height())
@@ -70,21 +92,33 @@ int main(int argc, char *argv[])
#endif
float dpi_scale = CalculateDPIScale();
dp_xres = (int)(pixel_xres * dpi_scale); dp_yres = (int)(pixel_yres * dpi_scale);
#endif
net::Init();
#ifdef __SYMBIAN32__
NativeInit(argc, (const char **)argv, "E:/PPSSPP/", "E:", "BADCOFFEE");
#elif defined(BLACKBERRY)
NativeInit(argc, (const char **)argv, "data/", "/tmp", "BADCOFFEE");
#else
#elif !defined(LINUX)
NativeInit(argc, (const char **)argv, "./", "/tmp", "BADCOFFEE");
#else
MainWindow mainWindow;
qMW = &mainWindow;
mainWindow.show();
mainWindow.Create(argc, (const char **)argv, "./", "/tmp", "BADCOFFEE");
#endif
#ifdef LINUX
#else
MainUI w(dpi_scale);
w.resize(pixel_xres, pixel_yres);
#ifdef USING_GLES2
w.showFullScreen();
#else
w.show();
#endif
#endif
MainAudio *audio = new MainAudio();