Skip to content

Commit

Permalink
Build successfully on DX9 mingw i686
Browse files Browse the repository at this point in the history
 - Add a few missing constants
 - Don't take the address of a temporary
  • Loading branch information
cxw42 committed Oct 5, 2018
1 parent 2de3669 commit 45f6de2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Binary file added src/platform_w32_dx9/.Renderer.cpp.swp
Binary file not shown.
16 changes: 15 additions & 1 deletion src/platform_w32_dx9/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@

#define DEVTYPE D3DDEVTYPE_HAL

#if defined(__MINGW32__) && !defined(D3D9b_SDK_VERSION)
#define D3D9b_SDK_VERSION 31
// From https://docs.rs/winapi/0.2.8/i686-pc-windows-gnu/winapi/d3d9/constant.D3D9b_SDK_VERSION.html
#endif

#ifndef WM_MOUSEHWHEEL
#define WM_MOUSEHWHEEL (0x020E)
#endif

const char * shaderKeyword =
" register packoffset static const"
" break continue discard do for if else switch while case default return true false"
Expand Down Expand Up @@ -597,9 +606,14 @@ namespace Renderer
pConstantTable->SetFloat( pDevice, szConstName, x );
}

static D3DXVECTOR4 SetShaderConstant_VEC4;
void SetShaderConstant( const char * szConstName, float x, float y )
{
pConstantTable->SetVector( pDevice, szConstName, &D3DXVECTOR4(x, y, 0, 0) );
SetShaderConstant_VEC4.x = x;
SetShaderConstant_VEC4.y = y;
SetShaderConstant_VEC4.z = 0;
SetShaderConstant_VEC4.w = 0;
pConstantTable->SetVector( pDevice, szConstName, &SetShaderConstant_VEC4 );
}

struct DX9Texture : public Texture
Expand Down

0 comments on commit 45f6de2

Please sign in to comment.