~ppsspp/ppsspp/ppsspp_1.3.0

« back to all changes in this revision

Viewing changes to Windows/GPU/D3D9Context.h

  • Committer: Sérgio Benjamim
  • Date: 2017-01-02 00:12:05 UTC
  • Revision ID: sergio_br2@yahoo.com.br-20170102001205-cxbta9za203nmjwm
1.3.0 source (from ppsspp_1.3.0-r160.p5.l1762.a165.t83~56~ubuntu16.04.1.tar.xz).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) 2015- PPSSPP Project.
 
2
 
 
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.
 
6
 
 
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.
 
11
 
 
12
// A copy of the GPL 2.0 should have been included with the program.
 
13
// If not, see http://www.gnu.org/licenses/
 
14
 
 
15
// Official git repository and contact information can be found at
 
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
 
17
 
 
18
// Modelled on OpenD3DBase. Might make a cleaner interface later.
 
19
 
 
20
#pragma once
 
21
 
 
22
#include "Common/CommonWindows.h"
 
23
#include "Windows/GPU/WindowsGraphicsContext.h"
 
24
#include <d3d9.h>
 
25
 
 
26
class Thin3DContext;
 
27
 
 
28
class D3D9Context : public WindowsGraphicsContext {
 
29
public:
 
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));
 
32
        }
 
33
 
 
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;
 
38
 
 
39
        void Resize() override;
 
40
 
 
41
        Thin3DContext *CreateThin3DContext() override;
 
42
 
 
43
private:
 
44
        bool has9Ex;
 
45
        LPDIRECT3D9 d3d;
 
46
        LPDIRECT3D9EX d3dEx;
 
47
        int adapterId;
 
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
 
53
        HMODULE hD3D9;
 
54
        D3DPRESENT_PARAMETERS pp;
 
55
};
 
56