   [C++] Loading Textures...
  I'm writing (or wanting to write) a *simple* class that will manage textures within my application. I was just wondering how I can set the contents of a texture. After using IDirect3DDevice9::CreateTexture() to create the IDirect3DTexture9 interface, can I call the IDirect3DTexture9::SetPrivateData() method to set the colour values? Also, what is the REFGUID parameter for?Another question - I'm not exactly sure what the Levels parameter of the IDirect3DDevice9::CreateDevice() method does? Could someone enlighten me?   
  The D3DXCreateTexture functions are your friend.If you need to fill in the data by hand, Lock the surface, copy the data in a scanline at a time (honoring pitch), and Unlock the surface.xyzzy;  If you are creating the texture without D3DX, you need to use LockRect() then memcpy() the data and then UnlockRect(). Check the dx docs for IDirect3DTexture9.I've never really used the D3DX texture loading functions, but I would assume they are fairly straightforward (or completely retarded.. you never know with microsoft)EDIT:Added clicky to interface docs: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/IDirect3DTexture9.asp;  Just as a quick follow-up... the functions you want to be looking at are (I personally think they're more straightfoward than retarded though [smile]):D3DXCreateTextureFromFile()D3DXCreateTextureFromFileEx()You mentioned the IDirect3DTexture9::SetPrivateData() function. In this instance, "private" is for you - not Direct3D. It allows you to attach some data to a texture instance - some advanced texture managers/material systems might find this convenient.Quote:Another question - I'm not exactly sure what the Levels parameter of the IDirect3DDevice9::CreateDevice() method does? Could someone enlighten me?Do you mean IDirect3DDevice9::CreateTexture()? The method you've mentioned doesn't exist, and IDirect3D9::CreateDevice() doesn't have a Levels param [smile]The levels are for mip-mapping. To improve visual quality when sampling textures in a 3D scene, lower resolution textures can be generated and used (for 2N sizes). Setting this parameter to "0" will generate a default mip-chain, and setting it to "1" will disable it. Theres a bit of information here, alternatively googling the term should yield some information.hthJack   ;Quote:Original post by jollyjeffersDo you mean IDirect3DDevice9::CreateTexture()? The method you've mentioned doesn't exist, and IDirect3D9::CreateDevice() doesn't have a Levels param [smile]Yeah, I meant CreateTexture() not CreateDevice(). Sorry, not enough sleep. :DThanks for the info people, much appreciated. Will do some more reading tonight.   