Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Creating an image and writing data to it in a plugin? - No memblocks

Author
Message
D Ogre
21
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 6th Apr 2011 21:56
I've asked this question before a while back. I know of at least two people that would have the answer to this question. I want to create a new image and write data directly to it without the use of memblocks. I know this involves using the Make functions in the DBProImageDebug.dll. My knowledge of Directx is pretty sparse.

Can someone give me an example? IanM? Sven B?
D Ogre
21
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 6th Apr 2011 22:35 Edited at: 6th Apr 2011 23:14
Nevermind! I think I have my answer.

Just had to search a bit more...
http://forum.thegamecreators.com/?m=forum_view&t=129229&b=20

Use ?Make@@YAPAUIDirect3DTexture9@@HHH@Z
Then read/write to that...
D Ogre
21
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 8th Apr 2011 21:49 Edited at: 8th Apr 2011 21:50
Okay, I have copying from an existing image to memory worked out. I just need to clear up a couple of things before I do the opposite.

If ?Make@@YAPAUIDirect3DTexture9@@HHH@Z takes 3 parameters (ImageID, Width, Height), how does it determine format (bit-depth)?

If you have to use the other make functions to describe the surface texture, what are the correct parameters for each? Do some of those functions directly reflect the data that's in the D3DSURFACE_DESC structure? Like 3D3FORMAT format and DWORD Usage

Function Parameters?

?MakeFormat@@YAPAUIDirect3DTexture9@@HHHW4_D3DFORMAT@@K@Z
?MakeJustFormat@@YAPAUIDirect3DTexture9@@HHHW4_D3DFORMAT@@@Z
?MakeRenderTarget@@YAPAUIDirect3DTexture9@@HHHW4_D3DFORMAT@@@Z
?MakeUsage@@YAPAUIDirect3DTexture9@@HHHK@Z

This function, I assume, returns the bit-depth of a the texture?
?GetBitDepthFromFormat@@YAHW4_D3DFORMAT@@@Z
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Apr 2011 01:17 Edited at: 10th Apr 2011 01:17
Quote: "If ?Make@@YAPAUIDirect3DTexture9@@HHH@Z takes 3 parameters (ImageID, Width, Height), how does it determine format (bit-depth)?"

By default it uses the same depth as your backbuffer.

Quote: "Do some of those functions directly reflect the data that's in the D3DSURFACE_DESC structure? Like 3D3FORMAT format and DWORD Usage"

Yes.

I think the best thing for you to do is to read the code for the plug-in itself so you can see: http://code.google.com/p/darkbasicpro/source/browse/trunk/%20darkbasicpro%20--username%20LeeBamberTGC/Dark%20Basic%20Pro%20SDK/Shared/Image/CImageC.cpp [edit - sorry, it won't link correctly - just copy/paste]

IIRC, all the functions you've named effectively call the MakeFormat function, so there's a good place to start.

D Ogre
21
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 10th Apr 2011 04:49 Edited at: 10th Apr 2011 04:58
Excellent! Thanks for the link, IanM. The source code will help tremendously...

Just in case anyone else wants a quick answer:

LPDIRECT3DTEXTURE9 MakeFormat ( int iID, int iWidth, int iHeight, D3DFORMAT d3dformat, DWORD dwUsage )

Okay. So, the above function is the main one, and the other make functions are just calling to it. Before I seen the source code I thought it might be the case. This just confirms it.

?GetBitDepthFromFormat@@YAHW4_D3DFORMAT@@@Z takes one parameter; a format which is listed in the D3DFORMAT enumeration type. It just returns a bit-depth based on a set of compatible format types Lee has listed in the function, and does not return the actual texture bit-depth from format itself directly.

Login to post a reply

Server time is: 2024-11-21 15:26:49
Your offset time is: 2024-11-21 15:26:49