1
// Copyright (c) 2015- PPSSPP Project.
3
// This program is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, version 2.0 or later versions.
7
// This program is distributed in the hope that it will be useful,
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
// GNU General Public License 2.0 for more details.
12
// A copy of the GPL 2.0 should have been included with the program.
13
// If not, see http://www.gnu.org/licenses/
15
// Official git repository and contact information can be found at
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
18
// Modelled on OpenD3DBase. Might make a cleaner interface later.
22
#include "Common/CommonWindows.h"
23
#include "Windows/GPU/WindowsGraphicsContext.h"
28
class D3D9Context : public WindowsGraphicsContext {
30
D3D9Context() : has9Ex(false), d3d(nullptr), d3dEx(nullptr), adapterId(-1), device(nullptr), deviceEx(nullptr), hDC(nullptr), hRC(nullptr), hWnd(nullptr), hD3D9(nullptr) {
31
memset(&pp, 0, sizeof(pp));
34
bool Init(HINSTANCE hInst, HWND window, std::string *error_message) override;
35
void Shutdown() override;
36
void SwapInterval(int interval) override;
37
void SwapBuffers() override;
39
void Resize() override;
41
Thin3DContext *CreateThin3DContext() override;
48
LPDIRECT3DDEVICE9 device;
49
LPDIRECT3DDEVICE9EX deviceEx;
50
HDC hDC; // Private GDI Device Context
51
HGLRC hRC; // Permanent Rendering Context
52
HWND hWnd; // Holds Our Window Handle
54
D3DPRESENT_PARAMETERS pp;