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.

DarkBASIC Professional Discussion / Hmm... i know the problem, now i need a solution (iDirect3D8)

Author
Message
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 22nd May 2003 23:21
now Lee's suggested i just forget about this and wait for the team to impliment it, however i can't do that.

right now i'm having a problem creating a DirectX plugin for DBpro, now i'm trying to make an AntiAlias function (yeah i know i've tried this before) ... well i've finally sussed what the problem is conserning it - however i can't seem to find a reference to actually get the information i need.

whats even worse is that Detonator drivers show me that its possible to achieve this ... but how i can't figure out.

now if i setup the LPDIRECT3D8, this creates a blank pointer - ironically the only way to fill this pointer if either with

CreateDirect3D8( &d3d )
d3dDevice->GetDirect3D( &d3d )

now the first doesn't work due to unresolved external symbol, and the second you'd need to get the Device which can be done like this

d3dResource->GetDevice( &d3dDevice )

which just leads to another problem... the data is empty because there is no way i can see to populate the Resource,

so first way doesn't work because of link problems, and the second doesn't work (any why it was crashing before) because there is no data and i'm trying edit a non existance instance.
so the question is how can i populate either of these?
once that question is answered everything else will fall neatly into place.
Within the Epic battle of the fates the Shadow and the Angel will meet. With it will harbinger the very fight of good vs evil!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd May 2003 01:19
*smug mode on* I know how to get hold of the D3D pointer and device pointer.

Put this code into a TPC DLL:



And test with this code:



Note the 'cls 0' at the top? It's important. Until you draw something to the display, the 'pCurrentBitmapSurface' is not populated inside the GlobStruct.

This code (in combination) just gets the pointers, saves them in memory passed from DBPro, then releases them. Then DBPro displays the values to prove it got something.

There will be a cleaner way to do this in the future - courtesy of the command library

*exit smug mode*
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 23rd May 2003 03:58
ahh i see... so the screen is actually attached to the backbuffer "pCurrentBitmapSurface"

cool thanks, i knew it had to be something to do with one of the Direct3D Surfaces - just didn't know they're structure allowed them to pull the device.

thanks ian

Within the Epic battle of the fates the Shadow and the Angel will meet. With it will harbinger the very fight of good vs evil!
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 23rd May 2003 18:49
oki... well new day new problems
well oki its an old problem, but its a new day

RavenDx8.cpp


RavenDx8.h


you should be able to create the string table on your own
now, in the RavenDx8.cpp file the following lines cause the program to crash ->
if( bEdge==FALSE )
{
d3dDevice->SetRenderState( D3DRS_MULTISAMPLEANTIALIAS, TRUE );
}
else
{
d3dDevice->SetRenderState( D3DRS_EDGEANTIALIAS, TRUE );
}
why? ... becuase d3dDevice appears to be invalid, yet oddly the d3d data that was obtained from it is completely valid.
if you run this in debugger mode you'll see what i mean, this is why i have posted the source so you can veiw the actual debug steps,

notice how &d3dDevice is a valid device, but the d3dDevice isn't.
its odd because it should be populated now ... however atleast now i can create and destroy d3d devices which is comming in handy with current Shader Extensions i'm working on.

but i just think the current problem is a little odd, no doubt on of you guys can figure it out - i've never had to yank the Dx inteface before so this is kinda odd.

Within the Epic battle of the fates the Shadow and the Angel will meet. With it will harbinger the very fight of good vs evil!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd May 2003 20:39
I'm not sure that it's possible to do what you are trying to do.

Why? Because you are trying to create a new device, when the original device still exists and has ownership of the display.

And you can't change the settings on the existing device, because it has already been used to create surfaces, and you can't add anti-aliasing to an existing surface.

Unless you can close down DBPro's display device, recreate it, and pass it back to DBPro, I don't see how you can do this ... and before you ask, no I don't know how to close down DBPro's device either

Disclaimer: I am not even reasonably good at DX programming, so some, none or all of the above may be complete and utter tosh
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 23rd May 2003 20:55
i think it might be possible to do it using the device reset, because although i have the device parameters i need to reactive the device to initilise the AA.

now in a standard program recreating the device using the original instance actually rewrites the current state instance...
so its wouldn't be really CreateDevice, really me ReInitiliseDevice.
the device its using as the template to create this should be the one that Pro already has in play which actually confuses me to why that it cannot find any data to actually create the new device.

i mean to change and reinitilise the DBpro device in DBpro itself it'll be doing the exact same thing - so it really has me baffled, and i can't seem to find any DirectX communities to ask this kinda thing. So ironic i can find communities on everything else and if i was doing this in GL it wouldn't be a problem, but do it in Dx and suddenly the world of help gets alot smaller

well i've taken a break to design DBS Dev Studios, got a nice futuristic look going on hehee - probably try and wrack my brain over this again in a little while though, i'm sure i'll crack it.

Within the Epic battle of the fates the Shadow and the Angel will meet. With it will harbinger the very fight of good vs evil!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd May 2003 21:04
Hmmm, that rang a bell. Have a look at the IDirect3DDevice8::Reset function. That allows you to pass something called presentation parameters to the device - one of which is the multisample type.

You could try this, followed by setting the render state, instead of creating a new device.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 23rd May 2003 21:15 Edited at: 23rd May 2003 21:26
ian... remark the d3dDevice->SetRenderState( D3DRS_MULTISAMPLEANTIALIAS, TRUE );

you'll see what i mean about it being the device being empty, i think your right about passing it back to DBpro though.

[edit-]
just tried resetting the device, it did what i thought it would and couldn't create any objects because the surface didn't exist
was a good idea though ... thing is i have to recreate the device once i've changed the parameters - reason being that if you don't recreate the device all the changes you make don't happen.

i mean think about it

we take the Present Parameters and put them into d3dpp ... you alter d3dpp and that'll change that structure but the device doesn't use d3dpp, ya know kinda like doing this in dbpro



ofcourse in dbp you'd have to setup d3dpp as a pointer and entire the data as a whole in a function - but you get the idea

Within the Epic battle of the fates the Shadow and the Angel will meet. With it will harbinger the very fight of good vs evil!

Login to post a reply

Server time is: 2026-07-11 13:58:37
Your offset time is: 2026-07-11 13:58:37