Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New equiavalent to D3DXCOLOR Structure in Directx 11.1?

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?

like image 664
user1930693 Avatar asked Nov 30 '22 01:11

user1930693


1 Answers

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);
like image 152
Cameron Arnott aka BlueSteelAU Avatar answered Dec 06 '22 11:12

Cameron Arnott aka BlueSteelAU