cliffski
10-28-2006, 06:58 AM
ok here goes....
I use FreeImage to load in a JPG file (works great) I then create a direct draw surface of the right size, and copy the data from the free image loaded bitmap into it, so that my directx calls can use it (works great).
I now have some nifty system for loading in a bitmap thats just got alpha data in it, and I want to apply this alpha data to my earlier loaded jpg data (I want jpg compression, but with alpha)
Anyway, it doesn't work, and it looks like it doesn't work because the surface I created to stick my jpg data in has no idea where its alpha should be.
If I just load in a standard bitmap (letting d3dx handle the loading) and apply my alpha to that, it works just dandy, but that defeats the object of the exercise.
Am I right in guessing that I need to somehow set up lots of DDSURFACEDESC2 and DDCAPS data on the surface that I am creating (the one I put the jpg data in)
Feel free to tell me I'm insane and should be doing it another way entirely.
I use FreeImage to load in a JPG file (works great) I then create a direct draw surface of the right size, and copy the data from the free image loaded bitmap into it, so that my directx calls can use it (works great).
I now have some nifty system for loading in a bitmap thats just got alpha data in it, and I want to apply this alpha data to my earlier loaded jpg data (I want jpg compression, but with alpha)
Anyway, it doesn't work, and it looks like it doesn't work because the surface I created to stick my jpg data in has no idea where its alpha should be.
If I just load in a standard bitmap (letting d3dx handle the loading) and apply my alpha to that, it works just dandy, but that defeats the object of the exercise.
Am I right in guessing that I need to somehow set up lots of DDSURFACEDESC2 and DDCAPS data on the surface that I am creating (the one I put the jpg data in)
Feel free to tell me I'm insane and should be doing it another way entirely.