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 / any more advanced C/C++ examples out there?

Author
Message
Xception
19
Years of Service
User Offline
Joined: 14th Mar 2005
Location:
Posted: 23rd Mar 2005 03:34
like using the backbuffer pointer.
Do I have to create my own D3D9 object and device or can I get it somehow from the backbuffer pointer?
A small example that plots a point on the backbuffer would be nice.

And how can I store a bitmap or the screen of a foreign window in a DBPRO image?
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 23rd Mar 2005 11:58
hmmm yes i also request even some basic examples on backbuffers and how to really access things such as bitmap pointers and such
and here is the closest i have got to backbuffer program

or well nvm
for some reason my code wont work

X-Patch x-patch.exe(gui):75% make.exe:5% x-patch.dll(runtime dll):0% developed on win xp home sp2
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Mar 2005 21:04
I'll post something tonight ... after I've written it.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 24th Mar 2005 07:23
Here's example code for getting the backbuffer pointer and details.

This code fills the backbuffer with red, whether in 16 bit or 32 bit colour mode.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk

Attachments

Login to view attachments
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 24th Mar 2005 07:26
That code gives you access to the backbuffer using calls that are built into the DBPro runtime.

This next piece of code allows you to access images directly using DirectX calls. It's the code that I wrote for Dostej (I think) as an example. I've just cleaned it up to removes its dependency on the Interface library.

That's all that I've got to give away at the moment ... there may be more later

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk

Attachments

Login to view attachments
Xception
19
Years of Service
User Offline
Joined: 14th Mar 2005
Location:
Posted: 24th Mar 2005 08:23 Edited at: 24th Mar 2005 08:26
Thanks first!
But what is the pointer I get with "get backbuffer pointer()"?
I thought it was the pointer to a DIRECT3DSURFACE9 and tried(with passing "get backbuffer pointer()" as backbuffer to the function):
Quote: "IDirect3DDevice9 *ppDevice=0;
((LPDIRECT3DSURFACE9)backbuffer)->GetDevice(&ppDevice);
ppBackBuffer->GetDevice(&ppDevice);
ppDevice->ColorFill(ppBackBuffer,0,color);
ppDevice->Release;"

But it always crashed and I thought I either have to use DirectX 9.c instead of 9.0 SDK or it is because I did not initialize COM.
But you did not use any DirectX code in the backbuffer example.
It's late here now, I take a look at it tomorrow and try to understand it.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 24th Mar 2005 15:34
It's a pointer to the backbuffer memory - it's not a DX pointer at all.

If for some reason you need it, you might try and get the backbuffer surface from the GlobStruct (pHoldBackBufferPtr). That would make your code something like this:



You can also get the DX Device from the Setup dll using the function 'GetDirect3DDevice' that is included there.

I've never tried this myself, so let me know how it turns out

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
Xception
19
Years of Service
User Offline
Joined: 14th Mar 2005
Location:
Posted: 24th Mar 2005 18:51
Many thanks, Ian.
It works great now:

Login to post a reply

Server time is: 2024-11-21 14:57:39
Your offset time is: 2024-11-21 14:57:39