Skip to content
Permalink
Browse files

Merge PR #2522: overlay: remove use of d3dx9, d3dx10 and d3dx11.

overlay: remove use of d3dx9, d3dx10 and d3dx11.
  • Loading branch information...
mkrautz committed Aug 24, 2016
2 parents d657238 + 72f038e commit a017810386a268392b7488687a1287c7bad79988
Showing with 39 additions and 17 deletions.
  1. +0 −2 overlay/D11StateBlock.h
  2. +19 −7 overlay/d3d10.cpp
  3. +19 −7 overlay/d3d11.cpp
  4. +1 −1 overlay/overlay-shared.pro
@@ -40,8 +40,6 @@
// File contains the D11StateBlock class and a function D11CreateStateBlock.

#include <d3d11.h>
#include <d3dx10math.h>
#include <d3dx11.h>

class D11StateBlock;

@@ -6,7 +6,6 @@
#include "lib.h"
#include "overlay.hex"
#include <d3d10.h>
#include <d3dx10.h>
#include <time.h>

D3D10Data *d3d10 = NULL;
@@ -27,9 +26,22 @@ typedef ULONG(__stdcall *ReleaseType)(ID3D10Device *);

#define HMODREF(mod, func) func##Type p##func = (func##Type) GetProcAddress(mod, #func)

struct SimpleVec3 {
FLOAT x;
FLOAT y;
FLOAT z;
SimpleVec3(FLOAT _x, FLOAT _y, FLOAT _z) : x(_x), y(_y), z(_z) {}
};

struct SimpleVec2 {
FLOAT x;
FLOAT y;
SimpleVec2(FLOAT _x, FLOAT _y) : x(_x), y(_y) {}
};

struct SimpleVertex {
D3DXVECTOR3 Pos;
D3DXVECTOR2 Tex;
SimpleVec3 Pos;
SimpleVec2 Tex;
};

class D10State: protected Pipe {
@@ -156,10 +168,10 @@ void D10State::setRect() {

// Create vertex buffer
SimpleVertex vertices[] = {
{ D3DXVECTOR3(left, top, 0.5f), D3DXVECTOR2(texl, text) },
{ D3DXVECTOR3(right, top, 0.5f), D3DXVECTOR2(texr, text) },
{ D3DXVECTOR3(right, bottom, 0.5f), D3DXVECTOR2(texr, texb) },
{ D3DXVECTOR3(left, bottom, 0.5f), D3DXVECTOR2(texl, texb) },
{ SimpleVec3(left, top, 0.5f), SimpleVec2(texl, text) },
{ SimpleVec3(right, top, 0.5f), SimpleVec2(texr, text) },
{ SimpleVec3(right, bottom, 0.5f), SimpleVec2(texr, texb) },
{ SimpleVec3(left, bottom, 0.5f), SimpleVec2(texl, texb) },
};

void *pData = NULL;
@@ -40,7 +40,6 @@
#include "overlay11.vs.h"
#include "overlay11.ps.h"
#include <d3d11.h>
#include <d3dx11.h>
#include <time.h>

D3D11Data *d3d11 = NULL;
@@ -55,9 +54,22 @@ typedef HRESULT(__stdcall *D3D11CreateDeviceAndSwapChainType)(IDXGIAdapter *, D3
typedef ULONG(__stdcall *AddRefType)(ID3D11Device *);
typedef ULONG(__stdcall *ReleaseType)(ID3D11Device *);

struct SimpleVec3 {
FLOAT x;
FLOAT y;
FLOAT z;
SimpleVec3(FLOAT _x, FLOAT _y, FLOAT _z) : x(_x), y(_y), z(_z) {}
};

struct SimpleVec2 {
FLOAT x;
FLOAT y;
SimpleVec2(FLOAT _x, FLOAT _y) : x(_x), y(_y) {}
};

struct SimpleVertex {
D3DXVECTOR3 Pos;
D3DXVECTOR2 Tex;
SimpleVec3 Pos;
SimpleVec2 Tex;
};

static const int VERTEXBUFFER_SIZE = 4 * sizeof(SimpleVertex);
@@ -187,10 +199,10 @@ void D11State::setRect() {

// Create vertex buffer
SimpleVertex vertices[] = {
{ D3DXVECTOR3(left, top, 0.5f), D3DXVECTOR2(texl, text) },
{ D3DXVECTOR3(right, top, 0.5f), D3DXVECTOR2(texr, text) },
{ D3DXVECTOR3(right, bottom, 0.5f), D3DXVECTOR2(texr, texb) },
{ D3DXVECTOR3(left, bottom, 0.5f), D3DXVECTOR2(texl, texb) },
{ SimpleVec3(left, top, 0.5f), SimpleVec2(texl, text) },
{ SimpleVec3(right, top, 0.5f), SimpleVec2(texr, text) },
{ SimpleVec3(right, bottom, 0.5f), SimpleVec2(texr, texb) },
{ SimpleVec3(left, bottom, 0.5f), SimpleVec2(texl, texb) },
};

// map/unmap to temporarily deny GPU access to the resource pVertexBuffer
@@ -29,7 +29,7 @@ QMAKE_CXXFLAGS_RELEASE *= -MT
QMAKE_CXXFLAGS_DEBUG *= -MTd

LIBS *= -ldxguid -luuid -lole32 -luser32 -ladvapi32
LIBS *= -ld3d9 -ld3d10 -ld3d11 -ld3dcompiler -ld3dx9 -ld3dx10 -ld3dx11 -ldxgi
LIBS *= -ld3d9 -ld3d10 -ld3d11 -ld3dcompiler -ldxgi

CONFIG(force-x86_64-toolchain) {
DEFINES += USE_MINHOOK

0 comments on commit a017810

Please sign in to comment.
You can’t perform that action at this time.