mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-24 00:29:57 +00:00
2bec3bf3ac
Otherwise, we end up hanging in the loop waiting for emuThreadState to become STOPPED. It actually has, but ThreadFrame() will block until a new frame is queued... while will never happen, because the emuthread has stopped.
52 lines
1.2 KiB
C++
52 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "Common/CommonWindows.h"
|
|
#include "Windows/GPU/WindowsGraphicsContext.h"
|
|
|
|
namespace Draw {
|
|
class DrawContext;
|
|
}
|
|
|
|
class GLRenderManager;
|
|
|
|
class WindowsGLContext : public WindowsGraphicsContext {
|
|
public:
|
|
bool Init(HINSTANCE hInst, HWND window, std::string *error_message) override;
|
|
|
|
bool InitFromRenderThread(std::string *errorMessage) override;
|
|
void ShutdownFromRenderThread() override;
|
|
|
|
void Shutdown() override;
|
|
void SwapInterval(int interval) override;
|
|
void SwapBuffers() override;
|
|
|
|
// Used during window resize. Must be called from the window thread,
|
|
// not the rendering thread or CPU thread.
|
|
void Pause() override;
|
|
void Resume() override;
|
|
void Resize() override;
|
|
|
|
void ThreadStart() override;
|
|
void ThreadEnd() override;
|
|
bool ThreadFrame() override;
|
|
void StopThread() override;
|
|
|
|
Draw::DrawContext *GetDrawContext() override { return draw_; }
|
|
|
|
private:
|
|
bool renderThread_;
|
|
Draw::DrawContext *draw_;
|
|
GLRenderManager *renderManager_;
|
|
HINSTANCE hInst_;
|
|
HDC hDC; // Private GDI Device Context
|
|
HGLRC hRC; // Permanent Rendering Context
|
|
HWND hWnd_; // Holds Our Window Handle
|
|
volatile bool pauseRequested;
|
|
volatile bool resumeRequested;
|
|
HANDLE pauseEvent;
|
|
HANDLE resumeEvent;
|
|
|
|
int xres;
|
|
int yres;
|
|
};
|