mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-27 18:30:56 +00:00
Qt fixes
This commit is contained in:
parent
5ff8224075
commit
f7f9f321a0
@ -93,7 +93,7 @@ public:
|
||||
mainWindow->GetDialogDisasm()->SetDebugMode(mode);
|
||||
}
|
||||
|
||||
virtual bool InitGraphics(std::string *error_message) override { return true; }
|
||||
virtual bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override { return true; }
|
||||
virtual void ShutdownGraphics() override {}
|
||||
|
||||
virtual void InitSound() override;
|
||||
|
@ -25,11 +25,12 @@ QTM_USE_NAMESPACE
|
||||
#include "gfx/gl_common.h"
|
||||
#include "input/input_state.h"
|
||||
#include "input/keycodes.h"
|
||||
#include "thin3d/thin3d.h"
|
||||
#include "base/NativeApp.h"
|
||||
#include "net/resolve.h"
|
||||
#include "base/NKCodeFromQt.h"
|
||||
|
||||
// Bad: PPSSPP includes from native
|
||||
#include "Common/GraphicsContext.h"
|
||||
#include "Core/System.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/Config.h"
|
||||
@ -37,6 +38,13 @@ QTM_USE_NAMESPACE
|
||||
// Input
|
||||
void SimulateGamepad(InputState *input);
|
||||
|
||||
class QtDummyGraphicsContext : public DummyGraphicsContext {
|
||||
public:
|
||||
Thin3DContext *CreateThin3DContext() override {
|
||||
return T3DCreateGLContext();
|
||||
}
|
||||
};
|
||||
|
||||
//GUI
|
||||
class MainUI : public QGLWidget
|
||||
{
|
||||
@ -62,6 +70,9 @@ public:
|
||||
delete acc;
|
||||
#endif
|
||||
NativeShutdownGraphics();
|
||||
graphicsContext->Shutdown();
|
||||
delete graphicsContext;
|
||||
graphicsContext = nullptr;
|
||||
}
|
||||
|
||||
public slots:
|
||||
@ -183,7 +194,8 @@ protected:
|
||||
#ifndef USING_GLES2
|
||||
glewInit();
|
||||
#endif
|
||||
NativeInitGraphics();
|
||||
graphicsContext = new QtDummyGraphicsContext();
|
||||
NativeInitGraphics(graphicsContext);
|
||||
}
|
||||
|
||||
void paintGL()
|
||||
@ -224,6 +236,7 @@ protected:
|
||||
|
||||
private:
|
||||
InputState input_state;
|
||||
QtDummyGraphicsContext *graphicsContext;
|
||||
#if defined(MOBILE_DEVICE) && !defined(MAEMO)
|
||||
QAccelerometer* acc;
|
||||
#endif
|
||||
|
@ -134,7 +134,7 @@ namespace UI {
|
||||
class SliderPopupScreen : public PopupScreen {
|
||||
public:
|
||||
SliderPopupScreen(int *value, int minValue, int maxValue, const std::string &title, int step = 1, const std::string &units = "")
|
||||
: PopupScreen(title, "OK", "Cancel"), value_(value), minValue_(minValue), maxValue_(maxValue), step_(step), units_(units) {}
|
||||
: PopupScreen(title, "OK", "Cancel"), units_(units), value_(value), minValue_(minValue), maxValue_(maxValue), step_(step), changing_(false) {}
|
||||
virtual void CreatePopupContents(ViewGroup *parent) override;
|
||||
|
||||
Event OnChange;
|
||||
@ -159,7 +159,7 @@ private:
|
||||
class SliderFloatPopupScreen : public PopupScreen {
|
||||
public:
|
||||
SliderFloatPopupScreen(float *value, float minValue, float maxValue, const std::string &title, float step = 1.0f, const std::string &units = "")
|
||||
: PopupScreen(title, "OK", "Cancel"), value_(value), minValue_(minValue), maxValue_(maxValue), step_(step), units_(units) {}
|
||||
: PopupScreen(title, "OK", "Cancel"), units_(units), value_(value), minValue_(minValue), maxValue_(maxValue), step_(step), changing_(false) {}
|
||||
void CreatePopupContents(UI::ViewGroup *parent) override;
|
||||
|
||||
Event OnChange;
|
||||
|
Loading…
Reference in New Issue
Block a user