I am having trouble finding the D3DXCOLOR
struct, it seems it is no longer there in DirectX 11.1 (d3d11_1.h
).
I have searched for an equal of it but to no luck. Can someone help me with it? Also could you tell me how to use it if it has changed a lot?
Asked
Active
Viewed 6,592 times
4

Mario
- 35,726
- 5
- 62
- 78

user1930693
- 43
- 1
- 5
4 Answers
10
I'm a total noob to this and i too had the problem with a sample tutorial where they used it. So after many hours searching the net. drumroll Tada....
Here is how I've converted it in my code
old code
// clear the back buffer to a deep blue
devcon->ClearRenderTargetView(backbuffer, D3DXCOLOR{ 0.0f, 0.2f, 0.4f, 1.0f };
new code
// clear the back buffer to a deep blue
float color[4] = { 0.0f, 0.2f, 0.4f, 1.0f };
devcon->ClearRenderTargetView(backbuffer, color);

Cameron Arnott aka BlueSteelAU
- 101
- 1
- 3
2
How about declaring once
using RGBA = float[4]; //c++11
or
typedef float RGBA[4]; //pre-c++11
and then using wherever needed like this
devcon->ClearRenderTargetView(backbuffer, RGBA{0.0f, 0.2f, 0.4f, 1.0f});

sunny moon
- 1,313
- 3
- 16
- 30
0
D3DX or the DirectX Utility library has been removed, instead Microsoft wants you to use the XNA Math Library counterparts (that use SSEs & stuff, but in my case it kind of crashes sometimes so I stopped using it)

RelativeGames
- 1,593
- 2
- 18
- 27