LPD3DXSPRITE and display of a .tga with alpha channel ??

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Gotta couple of problems with LPD3DXSPRITE.

I am display a sprite with the texture loaded from a .tga file. The .tga is
32 bit file with alpha channel and a resolution of 700x525.

My laptop display is 1400x1050.

Here is my call to ->draw:

pSprite->Draw( p_tgatex, NULL, NULL, NULL, 0, NULL, 0xFFFFFFFF);

The sprite displays on the screen but here are my problems:

1) I expect the sprite to take 1/4 of the display since I do no scaling. But
what I see is that on width it takes up about 3/4 of the screen and height it
takes up about 90% of the display. I have confirmed the resolution of the
file using photoshop (it is 700x525) and confirmed my laptop display
resolution. As I change the resolution of the file (to expriment) I see
non-linear changes in how much of the display the sprite takes up.

2) Most of the .tga is black and I expect it to be transparent. But mesh
objects I put on the screen are covered by the black areas of the sprite. My
code draws the mesh objects first. I also draw billboards using .tga files
and their transparency is fine.

I am, of course, coding a game and am using sprite to display the "control
panel" or cockpit while the rest of my display is all meshes and billboards.

Aside from creating the sprite interface and then calling draw I do no other
setup for sprites.

Any help on what might be going on appreciated. If I need to supply more
info pls let me know.



.


Quantcast