diff --git a/ext/native/base/BlackberryMain.cpp b/ext/native/base/BlackberryMain.cpp index 932ae95949..30c1239e7b 100644 --- a/ext/native/base/BlackberryMain.cpp +++ b/ext/native/base/BlackberryMain.cpp @@ -13,12 +13,22 @@ #include // Receive invocation messages #include "BlackberryMain.h" #include "base/NKCodeFromBlackberry.h" +#include "thin3d/thin3d.h" -// Bad: PPSSPP includes from native #include "Core/System.h" #include "Core/Config.h" #include "Core/Core.h" #include "UI/MiscScreens.h" +#include "Common/GraphicsContext.h" + +static GraphicsContext *graphicsContext; + +class GLDummyGraphicsContext : public DummyGraphicsContext { +public: + Thin3DContext *CreateThin3DContext() override { + return T3DCreateGLContext(); + } +}; static bool g_quitRequested = false; @@ -255,7 +265,8 @@ void BlackberryMain::startMain(int argc, char *argv[]) { dialog_request_events(0); vibration_request_events(0); NativeInit(argc, (const char **)argv, "/accounts/1000/shared/misc/", "app/native/assets/", "BADCOFFEE"); - NativeInitGraphics(); + graphicsContext = new GLDummyGraphicsContext(); + NativeInitGraphics(graphicsContext); audio = new BlackberryAudio(); runMain(); } @@ -349,6 +360,8 @@ void BlackberryMain::endMain() { bps_shutdown(); NativeShutdownGraphics(); delete audio; + graphicsContext->Shutdown(); + delete graphicsContext; NativeShutdown(); killDisplays(); net::Shutdown();