Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Ademan555

PLEASE HELP ME LOAD TEXTURES

This topic is 5341 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, im completely new to direct 3d, but i want to load a surface from a file, so i have a tutorial, well actually its a book, "the zen of Direct 3d game programming" and anyways, its a direct x 8 tutorial, and i have the direct x 9 sdk, i realize that the same include files are there as well, but id rather do direct 3d 9. so heres the problem, most of the stuff so far has been identical, dx9 and dx8, a few things, but i was able to figure out what it was supposed to be, but the pDevice->CreateImageSurface(arguements) had NO apparent counterparts in dx9, i found a few but they had some sharing handle stuff which i know nothing about, anyone know what i SHOULD be doing? thanks. -Dan

Share this post


Link to post
Share on other sites
Advertisement
Have you looked at D3DXCreateTextureFromFile? It will load several different formats (jpg, bmp, dib, dds, etc).

Share this post


Link to post
Share on other sites
cool, but does it load to surfaces? this is direct draw, well i guess it and d3d were merged, but its 2d is wut i mean and all i need is a surface, nothing more

Share this post


Link to post
Share on other sites
I think CreateOffScreenImage or something like that is the new version. Either way, that book is crap (I have it).

Share this post


Link to post
Share on other sites
After you load it into a texture with D3DXCreateTextureFromFile, you can access the underlying surface using GetSurfaceLevel (returns a IDirect3DSurface8*). You could then copy from that surface to another using CopyRects. Or, you could lock the texture, and access the data directly in the texture.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!