~ppsspp/ppsspp/ppsspp_1.3.0

« back to all changes in this revision

Viewing changes to GPU/Directx9/helper/dx_state.cpp

  • 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
#include "dx_state.h"
 
2
#include <assert.h>
 
3
 
 
4
namespace DX9 {
 
5
 
 
6
DirectXState dxstate;
 
7
GLExtensions gl_extensions;
 
8
 
 
9
int DirectXState::state_count = 0;
 
10
 
 
11
void DirectXState::Initialize() {
 
12
        if (initialized)
 
13
                return;
 
14
 
 
15
        Restore();
 
16
 
 
17
        initialized = true;
 
18
}
 
19
 
 
20
void DirectXState::Restore() {
 
21
        int count = 0;
 
22
 
 
23
        blend.restore(); count++;
 
24
        blendSeparate.restore(); count++;
 
25
        blendEquation.restore(); count++;
 
26
        blendFunc.restore(); count++;
 
27
        blendColor.restore(); count++;
 
28
 
 
29
        scissorTest.restore(); count++;
 
30
        scissorRect.restore(); count++;
 
31
 
 
32
        cullMode.restore(); count++;
 
33
 
 
34
        depthTest.restore(); count++;
 
35
        depthFunc.restore(); count++;
 
36
        depthWrite.restore(); count++;
 
37
 
 
38
        colorMask.restore(); count++;
 
39
 
 
40
        viewport.restore(); count++;
 
41
 
 
42
        alphaTest.restore(); count++;
 
43
        alphaTestFunc.restore(); count++;
 
44
        alphaTestRef.restore(); count++;
 
45
 
 
46
        stencilTest.restore(); count++;
 
47
        stencilOp.restore(); count++;
 
48
        stencilFunc.restore(); count++;
 
49
        stencilMask.restore(); count++;
 
50
 
 
51
        dither.restore(); count++;
 
52
 
 
53
        texMinFilter.restore(); count++;
 
54
        texMagFilter.restore(); count++;
 
55
        texMipFilter.restore(); count++;
 
56
        texMipLodBias.restore(); count++;
 
57
        texAddressU.restore(); count++;
 
58
        texAddressV.restore(); count++;
 
59
}
 
60
 
 
61
void CheckGLExtensions() {
 
62
        static bool done = false;
 
63
        if (done)
 
64
                return;
 
65
        done = true;
 
66
        memset(&gl_extensions, 0, sizeof(gl_extensions));
 
67
}
 
68
 
 
69
void DirectXState::SetVSyncInterval(int interval) {
 
70
}
 
71
 
 
72
}  // namespace DX9