Jump to content

  • Log In with Google      Sign In   
  • Create Account


D3DX11 and tga


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 jchmack   Members   -  Reputation: 186

Like
0Likes
Like

Posted 26 February 2011 - 08:04 PM

I cannot get a tga file loaded via D3DX11CreateShaderResourceViewFromFile

hr = D3DX11CreateShaderResourceViewFromFile( g_pd3dDevice, Input.c_str(), NULL, NULL, &Result->mShaderResourceView, NULL );

the hr results in 16389 (with HRESULT_CODE(hr) )


according to msdn it should return one of the values on this list:

http://msdn.microsoft.com/en-us/library/ff476174(v=vs.85).aspx

and 16389 isnt on that list.




Im pretty sure DX11 can support old school TGA right? It works fine with dds, bmp, etc. Just the few TGAs i have tried do not. Any reasons why this wouldn't work?






Sponsor:

#2 andur   Members   -  Reputation: 561

Like
0Likes
Like

Posted 26 February 2011 - 09:33 PM

D3DX11 doesn't support tga loading anymore, Microsoft removed it for some reason. However, it is an easy format to write your own loader for. http://en.wikipedia.org/wiki/Truevision_TGA gives you the file format. Either that, or you can convert/produce your textures in a format that D3DX11 does support.

#3 e3d_ALiVE   Members   -  Reputation: 205

Like
0Likes
Like

Posted 27 February 2011 - 02:55 AM

or you can load it with FreeImage
here's a snippet how to do it
http://pastebin.com/40BV7vV0
don't mind e3d_Std it's just log functions
Crazy dude smoking D3D11, AngelScript, PhysX, 3D Sound, Network, DB, FBX, and some other weird things, doing that on Visual Studio 2010 + Visual Assist X on Overclocked CPU

#4 Dawoodoz   Members   -  Reputation: 294

Like
0Likes
Like

Posted 28 February 2011 - 10:00 AM

PNG is more for photos with many colors but still my favourite format for textures in DirextX 11. It works great with GIMP because alpha filtering looks the same in the image editor and the game.

My open source DirectX 10/11 graphics engine. https://sites.google.com/site/dawoodoz

"My design pattern is the simplest to understand. Everyone else is just too stupid to understand it."





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS