mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
0e3a84b4a8
It works after the move, on Windows and Android at least. Deletes the D3DX9 shader compiler loader, which was not used.
43 lines
1.2 KiB
C++
43 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include "Common/GPU/thin3d.h"
|
|
|
|
// Init is done differently on each platform, and done close to the creation, so it's
|
|
// expected to be implemented by subclasses.
|
|
class GraphicsContext {
|
|
public:
|
|
virtual ~GraphicsContext() {}
|
|
|
|
virtual bool InitFromRenderThread(std::string *errorMessage) { return true; }
|
|
virtual void ShutdownFromRenderThread() {}
|
|
|
|
virtual void Shutdown() = 0;
|
|
virtual void SwapInterval(int interval) = 0;
|
|
|
|
virtual void SwapBuffers() = 0;
|
|
|
|
// Used during window resize. Must be called from the window thread,
|
|
// not the rendering thread or CPU thread.
|
|
virtual void Pause() {}
|
|
virtual void Resume() {}
|
|
|
|
virtual void Resize() = 0;
|
|
|
|
// Needs casting to the appropriate type, unfortunately. Should find a better solution..
|
|
virtual void *GetAPIContext() { return nullptr; }
|
|
|
|
// Called from the render thread from threaded backends.
|
|
virtual void ThreadStart() {}
|
|
virtual bool ThreadFrame() { return true; }
|
|
virtual void ThreadEnd() {}
|
|
virtual void StopThread() {}
|
|
|
|
// Useful for checks that need to be performed every frame.
|
|
// Should strive to get rid of these.
|
|
virtual void Poll() {}
|
|
|
|
virtual Draw::DrawContext *GetDrawContext() = 0;
|
|
};
|