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.

Dark GDK / D3dFormat gone?

Author
Message
TerryRussell
13
Years of Service
User Offline
Joined: 11th Dec 2010
Location: Chichester, UK
Posted: 11th Dec 2010 17:43
Hi.

I am in the middle of converting some of my DBPRO HLSL code into C++ so that I can drive GDK from it (it goes a lot faster that way). I am having one problem though (probably more to come later).

Does anyone have any idea how to convert
SET CAMERA TO IMAGE Camera Number, Image Number, Width, Height, Generate Alpha Mode, D3D Format

into the equivalent instruction for GDK?

The GDK version seems to have dropped or lost the D3DFORMAT parameter. I get the message that none of the overloaded functions take 6 arguments when I try to use my C++ instruction:

dbSetCameraToImage(Camera[1],RenderTarget[1],Width,Height,3,D3DFormat);

(all of the parameters do resolve to appropriate values. I've checked that carefully. The problem seems to be that the D3DFormat parameter seems to have dropped off the face of the earth).

Amazing Simulation
www.amazing-forum.com
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 12th Dec 2010 10:24
Have you tried to manually add the declaration in the .h header file? Maybe it is just the function declaration that is missing

TerryRussell
13
Years of Service
User Offline
Joined: 11th Dec 2010
Location: Chichester, UK
Posted: 12th Dec 2010 18:44
Hi Morcilla.

I haven't done that yet. But I was going to do it shortly. Thanks.

I love the simplicity of the Darkbasic Pro product, but I have been very disappointed by the high level of errors, bugs and omissions in the various products. Shame, really.

There are so many errors in the GDK documentation that it is barely usable, it seems.

Amazing Simulation
www.amazing-forum.com
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 13th Dec 2010 01:04
So use the DBP documentation instead. That's what I do.

JTK
TerryRussell
13
Years of Service
User Offline
Joined: 11th Dec 2010
Location: Chichester, UK
Posted: 13th Dec 2010 23:24
And that's precisely what I was doing. But as I said, the DBPRO instruction is
"SET CAMERA TO IMAGE Camera Number, Image Number, Width, Height, Generate Alpha Mode, D3D Format"
but the GDK instruction doesn't accept the D3D Format parameter. So using the DBPRO guide is of precisely no use at all...

I assume that means that you don't know the answer to my question, then? I'm getting the feeling that perhaps no-one here knows.

Oh well, it was worth a try. I guess I'll go write some C++/DirectX 9.0c code and create a dll to achieve what this function should do.

Thanks anyway.

Amazing Simulation
www.amazing-forum.com
TerryRussell
13
Years of Service
User Offline
Joined: 11th Dec 2010
Location: Chichester, UK
Posted: 18th Dec 2010 16:30
This morning I downloaded the source files and took a look at the GDK code. I found that the problem was in CcameraC.cpp

In it there are two overloaded dbSetCameraToImage functions that link to SetCameraToImageEx. One acceptes ID, Image ID, Width, and Height. The other accepts those four parameters plus the GenAlpha value.

This second version calls SetCameraToImageEx function but only passes a value of zero for the D3DFormat.

The SetCameraToImageEx function has two overloaded versions, one of which can handle the D3DFormat instruction -
DARKSDK void SetCameraToImageEx ( int iID, int iImage, int iWidth, int iHeight, int iGenerateCameraAlpha, DWORD dwOwnD3DFMTValue ).

So, someone seemed to have forgotten to add the overloaded dbSetCameraToImage function that acceptes the DWORD parameter for D3DFORMAT and passes that to SetCameraToImageEx.

I have now modified and recompiled the Dark GDK libraries and all seemed to work perfectly. I am now going to go away and test it all.

For anyone who is interested, I simply added this function:
void dbSetCameraToImage ( int iID, int iImage, int iWidth, int iHeight, int iGenAlpha, DWORD dwD3DFORMAT )
{
SetCameraToImageEx ( iID, iImage, iWidth, iHeight, iGenAlpha, dwD3DFORMAT );
}

Hope that is of use to anyone else with this problem.

Amazing Simulation
www.amazing-forum.com
silken
20
Years of Service
User Offline
Joined: 13th May 2004
Location:
Posted: 19th Dec 2010 18:28
Hi,

cool, I'm interesting by this command to.

Can you send us the recompiled Camera.lib ?
TerryRussell
13
Years of Service
User Offline
Joined: 11th Dec 2010
Location: Chichester, UK
Posted: 24th Dec 2010 17:06
Hi Silken.

Sorry, but I have added a number of my own proprietary functions when I recompiled the library. But, even easier, in your forward declarations (where you declare all of the functions you will be using), just add this line and all will be well, I think.

void SetCameraToImageEx (int, int, int, int, int, DWORD);

The use SetCameraToImageEx wherever you would have called dbSetCameraToImage.

The parameters used to call that function are:
SetCameraToImageEx ( iID, iImage, iWidth, iHeight, iGenAlpha, dwD3DFORMAT );

I haven't yet tested this on a machine without my recompiled library, but I think it should work OK.

Also add this one to you rforward declarations, and the "Add LOD to Object" function will work as well!

void dbAddLODToObject(int, int, int, float);

Please let me know if this works OK!

Amazing Simulation
www.amazing-forum.com

Login to post a reply

Server time is: 2024-06-28 01:48:44
Your offset time is: 2024-06-28 01:48:44