Does anyone know how to convert the ClipSprite3D code from Stefan Moebius to work with the DirectX9 subsystem?
Here's the original code:
http://www.purebasic.fr/english/viewtop ... 78&start=5
I tried it myself but I failed. All I could figure out is that the datatype for width, height and others has to be changed from WORD to LONG.
ClipSprite3D for DirectX9 subsystem
- Fluid Byte
- Addict

- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
ClipSprite3D for DirectX9 subsystem
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
- Fluid Byte
- Addict

- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
- Kaeru Gaman
- Addict

- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
- Fluid Byte
- Addict

- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Uhmm...., where can I do that and what exactly I have to look for? Sorry, I'm totally overstrained with the 3D/DirectX stuff.Kaeru Gaman wrote:did you manage to look up the changes of structures for DX9 on the MSDN or is there some doc coming with the DX9-SDK?
Or like Kwaï said:
I'm a asshole in programming with a egg head
I appreciate that man. At least I'm not clueless aloneKaeru Gaman wrote:(I have no idea myself, just don't wanna leave you completely alone here... )
Well, I searched the forums a little and had a closer look at the posts from S.M. Now I know the exact size of a memory block for a Sprite3D and the correct offsets for the Width/Height. I think it's possible to remove the dependency for IDirectDrawSurface7 and hardcode the needed values. So a little more Peek&Poke madness ...
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
- Kaeru Gaman
- Addict

- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
well, I would guess the IDirectDrawSurface7 struct should be replaced by a IDirectDrawSurface9 struct or whatever it's named now...
the dx9sdk is somewhere avaliable for download... I downloaded it last summer...
I don't remember from where, but have a search in the german forums, maybe ts told me the link...
the dx9sdk is somewhere avaliable for download... I downloaded it last summer...
I don't remember from where, but have a search in the german forums, maybe ts told me the link...
oh... and have a nice day.
- Fluid Byte
- Addict

- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Try a search for IDirectDrawSurface9 on Google
The problem is that DirectDraw has been discontinued and DX9 only uses Direct3D.
The problem is that DirectDraw has been discontinued and DX9 only uses Direct3D.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
- Kaeru Gaman
- Addict

- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
I looked in the code once more...
when I understand it halfways, this Interface is only used to verify the surface itself.
to "clip" the texture, you only need to re-define the tu/tv Vectors in the Sprite3D structure.
here the values from DDSDESC are only used as divisor for your pixelwise clip-coordinates.
so it seems, if you get the correct divisors on your own, you only need to access PB's Sprite3D struct, nothing else...
I would suspect, the vectors are floats between 0 and 1,
so the width and heigth of your origin 2D texturesprite should do the jobs as divisors...
when I understand it halfways, this Interface is only used to verify the surface itself.
Code: Select all
*DDS.IDirectDrawSurface7=*Sprite3D\Texture
DDSDESC.DDSURFACEDESC2
DDSDESC\dwSize=SizeOf(DDSURFACEDESC2)
Result=*DDS\GetSurfaceDesc(DDSDESC) here the values from DDSDESC are only used as divisor for your pixelwise clip-coordinates.
so it seems, if you get the correct divisors on your own, you only need to access PB's Sprite3D struct, nothing else...
I would suspect, the vectors are floats between 0 and 1,
so the width and heigth of your origin 2D texturesprite should do the jobs as divisors...
oh... and have a nice day.
- Fluid Byte
- Addict

- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany

The ZIP-file for the download of the DX9 Subsystem v0.5 contains a modified version of ClipSprite3D!
http://www.purebasic.fr/english/viewtopic.php?t=22184
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
- Kaeru Gaman
- Addict

- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
