Sign in to follow this  
ballmar

Loading texture from file

Recommended Posts

Hello.

 

I have a fairly simple question regarding loading texture mechanism in new Windows 8 Direct3D SDK.

 

So far I see that all CreateShaderResourceFromFile, CreateTexturedFromFile and other functions are deprecated and wiped out. Microsoft suggests to use DirectXTex third-party library for operations with textures. In previous SDK's it was very simple to just create DDS file and then load it as resource/texture/whatever. But now they are pushing us to use third-party library.

 

It would be okay for me, but as I'm learning DX myself, I want to load DDS files by using my own framework (kind of) so that I can actually understand how does loading data from file to D3D pipeline occure. I looked at Win8SDK DX tutorials and DirectXTex code, but they are complicated and demand lots of time to understand how things are going inside them.

 

Can you guys suggest some references to learn how can I load textures in D3D11 by myself without using third-party solutions?

 

Thanks.

Edited by GuardianX

Share this post


Link to post
Share on other sites

If you take a look at this site : http://msdn.microsoft.com/en-us/library/windows/desktop/bb943991(v=vs.85).aspx

You will find a detaild guide on how the bytes are pack in the header and how you later can use them for textures and how you bind data to your texture.

 

This is all withing the dds fileformat! realy neat.

Share this post


Link to post
Share on other sites

Well to be completely fair DirectXTex isn't exactly "third-party", since it's been developed by MS employees. But I do agree that it does suck that you have to download an additional library to get basic texture support.

Anyway, I would suggest looking a the DDS texture loader from DirectXTK. It's a much simpler loader than the one you'll find in DirectXTex, and it's specifically designed to be easy to drop in so that you can load textures at runtime.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this