4 Replies - 2191 Views - Last Post: 10 March 2013 - 09:30 AM Rate Topic: -----

#1 XeVile  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 44
  • Joined: 23-August 11

No D3DXCOLOR in the new DirectX 1.1?

Posted 30 December 2012 - 12:37 AM

Hey there 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?

Thanks
Is This A Good Question/Topic? 0
  • +

Replies To: No D3DXCOLOR in the new DirectX 1.1?

#2 Mylo  Icon User is offline

  • Knows all, except most.

Reputation: 265
  • View blog
  • Posts: 747
  • Joined: 11-October 11

Re: No D3DXCOLOR in the new DirectX 1.1?

Posted 30 December 2012 - 01:43 AM

Well I've never written a directX program before so I may be wrong here. But from what I can tell, the struct (or similiar) is still contained in D3DX10Math.h.

It also seems that you can use a float array[4] representing your colours and pass it in the clearRenderTargetView as normal.

Also, cross posting is frowned upon, at least tell us -> http://xboxforums.cr...s/t/109520.aspx

This post has been edited by Mylo: 30 December 2012 - 01:44 AM

Was This Post Helpful? 1
  • +
  • -

#3 XeVile  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 44
  • Joined: 23-August 11

Re: No D3DXCOLOR in the new DirectX 1.1?

Posted 30 December 2012 - 06:00 AM

Sorry for the cross posting, it wont happen again, there were just no replies over there.

Anyways, I tried using DirectXMath according to MSDN documentation but I didn't succeed, but the float array worked.
Thanks
Was This Post Helpful? 0
  • +
  • -

#4 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: No D3DXCOLOR in the new DirectX 1.1?

Posted 30 December 2012 - 06:19 AM

http://msdn.microsof...8(v=vs.85).aspx

D3DX* is deprecated and replaced by DirectXMath. You need to look at those docs, or create your own structure to represent your colors as per the new specification.
Was This Post Helpful? 2
  • +
  • -

#5 BlueSteelAU  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 1
  • Joined: 10-March 13

Re: No D3DXCOLOR in the new DirectX 1.1?

Posted 10 March 2013 - 09:30 AM

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);


Was This Post Helpful? 1
  • +
  • -

Page 1 of 1