Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    18
  • comments
    21
  • views
    11684

L.A.M.E

Sign in to follow this  
Asheh

399 views

Ok so today, im annoyed, stressed. ive been coding for the past 8 hours or so, well probably closer to 5 but still, its annoyed me.

I managed to get somthing up and running, my code now generates an environment class with a list of environment "chunks", each of these chunks contains information for where it is placed and what texture it relates to.

But the issue arose that all the textures were the same, i was like wtf. This isnt right, Oluseyi thought it was my memcpy so i spent an hour or so figuring it out with him. no luck. (btw thanks Oluseyi)

I sat and thought and looked and debugged for a further hour and realised it was down to DX. Tricking me!!!!! god damn.


HRESULT WINAPI D3DXCreateTextureFromFileEx( LPDIRECT3DDEVICE9 pDevice,
LPCTSTR pSrcFile,
UINT Width,
UINT Height,
UINT MipLevels,
DWORD Usage,
D3DFORMAT Format,
D3DPOOL Pool,
DWORD Filter,
DWORD MipFilter,
D3DCOLOR ColorKey,
D3DXIMAGE_INFO *pSrcInfo,
PALETTEENTRY *pPalette,
LPDIRECT3DTEXTURE9 *ppTexture
);





This function has a parameter D3DXIMAGE_INFO *pSrcInfo as stated by the SDK:

[in, out] Pointer to a D3DXIMAGE_INFO structure to be filled in with a description of the data in the source image file, or NULL

A fsking DESCRIPTION OF THE DATA IN THE IMAGE FILE. Ok, so i forgot about this for a while.

An hour later it turns out, after calling these few functions:


IDirect3DSurface9 *surf;
D3DSURFACE_DESC pDesc;
tempLargeTexture->GetSurfaceLevel(0, &surf);
surf->GetDesc(&pDesc);



the actual surface level of the texture is auto-matically scaled down to fit the graphics card. It would have been nice if the data contained within the D3DIMAGE_INFO was correct, then i wouldnt have spent 5 hours on this 1 damn bug.

god damn microsoft.


on a lighter note, can anyone suggest a way to disable this auto-scaling, or maybe some way of loading an "A1R5G5B5" texture, there is no documentation on this texture type as a bitmap, but for some reason windows and everything else can load it. (btw i haveto load this texture type)

On this note, i must sleep, my arms hurt, my fingers hurt, my eyes hurt and im annoyed, DirectX let me down.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

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
  • 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!