# New ReleaseD3D9Client Development

#### Abloheet

Thanks for the suggestion. The default settings were very washed out. By changing those settings, I got it much closer to reality. Also I now got the sun to look yellower from Earth

#### Marg

##### Active member
I wanted to write down that smoke during lift off is still visible below ground level in d3d9 client...

#### kuddel

##### Donator
Donator
It wouldn't hurt to have the change history copied into a new location but I am OK just having the head revision to start with, which can be downloaded from codeplex.

No problem, I've already started...it's a painfully and slow process, but we are not in a hurry.
Maybe on the weekend I'm through with this (2-3 hours each day...)
The actual procedure of 'uploading' to OrbitHangar is also not 100% settled.

The "history" is worth it (and it's my free time I waste )

By the way: Committing to CodePlex is not forbidden! Any commits will be in the "backup" in the end.
As soon as the switch to OrbitHangar will take place, I will announce the "dead of CodePlex".

/Kuddel

#### Interceptor

##### Well-known member
I wanted to write down that smoke during lift off is still visible below ground level in d3d9 client...
which version orbiter beta,or orbiter 2010?

#### Marg

##### Active member
in Orbiter Beta...

#### asbjos

##### tuanibrO
While launching a scenario with OrbiterBeta (v.151104) with D3D9Client for Orbiter Beta r38 found here (http://orbiter-forum.com/showthread.php?p=518714&postcount=3210), I get an error saying
D3D9Client Initialization Failed

I have gotten this the last few weeks with several versions of Orbiter and D3D9Client (but this is a new computer, so I have never gotten it to work).
But D3D9Client works on Orbiter2010. Any tips?

---------- Post added 7th Nov 2015 at 12:59 ---------- Previous post was 6th Nov 2015 at 20:13 ----------

By the way, Orbiter.log:
Code:
**** Orbiter.log
000000.000: Build Oct 31 2015 [v.151031]
000000.000: Timer precision: 3.94757e-007 sec
000000.000: Found 0 joystick(s)
000000.000: Module AtlantisConfig.dll .... [Build 150906, API 150906]
000000.000: Module AtmConfig.dll ......... [Build 150906, API 150906]
000000.000: Module DGConfigurator.dll .... [Build 150906, API 150906]
000000.000: Module D3D9Client.dll ........ [Build 151030, API 151028]
000000.000:
000000.000: **** Creating simulation session
000000.000: D3D9Client: [DirectX 9 Initialized]
000000.000: D3D9Client: Sytem has XNA math support
000000.000: D3D9Client: [3DDevice Initialized]
000000.000: D3D9Surface.cpp Line:2274 Error:-2147024770 D3DXCreateEffectFromFileA(pDev, name, 0, 0, 0, 0, &FX, &errors)
000000.000: Failed to create an Effect (Modules/D3D9Client/CKBlit.fx)
000000.000: D3D9TextMgr.cpp Line:581 Error:-2147024770 D3DXCreateEffectFromFileA(pDev, name, 0, 0, 0, 0, &FX, &errors)
000000.000: Failed to create an Effect (Modules/D3D9Client/CKBlit.fx)
000000.000: D3D9Pad.cpp Line:107 Error:-2147024770 D3DXCreateEffectFromFileA(pDev, name, 0, 0, 0, 0, &FX, &errors)
000000.000: Failed to create an Effect (Modules/D3D9Client/CKBlit.fx)
000000.000: D3D9Effect.cpp Line:251 Error:-2147024770 D3DXCreateEffectFromFileA(pDev, name, macro, 0, 0, 0, &FX, &errors)
000000.000: Failed to create an Effect (Modules/D3D9Client/D3D9Client.fx)
000000.000: D3D9Client: [Compiling Effects for Shader Model 3.0]
000000.000: PlanetRenderer.cpp Line:137 Error:-2147024770 D3DXCreateEffectFromFileA(pDev, name, macro, 0, 0, 0, &pShader, &errors)
000000.000: Failed to create an Effect (Modules/D3D9Client/Surface.fx)
000000.000: Scene.cpp Line:2016 Error:-2147024770 D3DXCreateEffectFromFile(pDev, name, 0, 0, 0, 0, &FX, &errors)
000000.000: Failed to create an Effect (Modules/D3D9Client/SceneTech.fx)

I'm using Windows 10, vanilla Orbiter install, only with required texture packs. Orbiter.exe with inline client works.

#### kuddel

##### Donator
Donator
While launching a scenario with OrbiterBeta (v.151104) with D3D9Client for Orbiter Beta r38 found here (http://orbiter-forum.com/showthread.php?p=518714&postcount=3210), I get an error saying
[...]
I have gotten this the last few weeks with several versions of Orbiter and D3D9Client (but this is a new computer, so I have never gotten it to work).
But D3D9Client works on Orbiter2010. Any tips?
[...]
I'm using Windows 10, vanilla Orbiter install, only with required texture packs. Orbiter.exe with inline client works.
Hi, I am not sure what exactly your setup is so my 'tips' might be wrong.
First: Do you *always* get the error on your new machine? Or only on some installations. If only some installations fail, this might be due to Win10 behavior I can't reproduce (I am working on Win7 and have no experience with Win10).

Second: Did you install the runtime libraries? The message "DirectX Runtimes may be missing" assumes that you did not.
The download location for the runtime libraries are in the D3D9Client documentation (as stated by the error message).

Sorry if I can't provide any better help.
/Kuddel

Last edited:

#### asbjos

##### tuanibrO
Hi, I am not sure what exactly your setup is so my 'tips' might be wrong.
First: Do you *always* get the error on your new machine? Or only on some installations. If only some installations fail, this might be due to Win10 behavior I can't reproduce (I am working on Win7 and have no experience with Win10).

Second: Did you install the runtime libraries? The message "DirectX Runtimes may be missing" assumes that you did not.
The download location for the runtime libraries are in the D3D9Client documentation (as stated by the error message).

Sorry if I can't provide any better help.
/Kuddel

Yes, the D3D9Client for Beta always gives me this error when loading up a scenario. But the D3D9Client works for Orbiter2010, and both Orbiter2010 and OrbiterBeta work with inline graphics.
Yes, I have the runtimes linked to in the documentation installed. Dxdiag tells me I have DirectX version 12.

And yes, I use Windows 10 (Intel Core i7-4720HQ, Intel HD Graphics 4600, NVIDIA GeForce GTX 950M).

#### kuddel

##### Donator
Donator
Yes, the D3D9Client for Beta always gives me this error when loading up a scenario. But the D3D9Client works for Orbiter2010, and both Orbiter2010 and OrbiterBeta work with inline graphics.
Ah! This might be the clue.
Note that there are two different releases for D3D9Client:
one for Orbiter BETA (named like D3D9ClientBeta12-forBETA r##(r#####).zip )
and one for Orbiter 2010-P1 (named like D3D9ClientR15-for2010-P1(r#####).zip )!
You cannot mix these. Be sure you download and install the correct release for the installation.

/Kuddel

#### asbjos

##### tuanibrO
Ah! This might be the clue.
Note that there are two different releases for D3D9Client:
one for Orbiter BETA (named like D3D9ClientBeta12-forBETA r##(r#####).zip )
and one for Orbiter 2010-P1 (named like D3D9ClientR15-for2010-P1(r#####).zip )!
You cannot mix these. Be sure you download and install the correct release for the installation.

/Kuddel

I did not mix them. I used D3D9ClientBeta12-forBETA r38(r37214).zip for OrbiterBeta and D3D9ClientR15.zip for Orbiter2010
But as I'm the only one reporting this problem, I guess it's something on my end.
I will not take too much of your time, so I will just accept the problem, and hope that everything magically works by the next release.
I will notify you if it suddently works later. Thank you for your time.

#### jarmonik

Beta Tester
Latest beta build requires d3dx9_43.dll instead of d3dx9_42.dll. So the required DX run-times are newer/later than February 2010. Very likely June 2010 if I remember correctly.

#### asbjos

##### tuanibrO
Latest beta build requires d3dx9_43.dll instead of d3dx9_42.dll. So the required DX run-times are newer/later than February 2010. Very likely June 2010 if I remember correctly.

#### fred18

Donator
Hi there,

is there any limit to dialogs with D3D9? I'm having a CTD while defining the 9th dialog as dialogParam, while this is not happening with inline client.
Since the procedure is exactly the same of the previous eight I wonder if the problem is within d3d9 client.

a bit of code:
The main dialog process function (the added redline is the one causing the CTD):
Code:
switch (uMsg) {
case WM_INITDIALOG:
{
InitDialog(hWnd,uMsg,wParam,lParam);
SetDlgItemText(hWnd,IDC_FILENAME,CompleteFileIniName);

hChild[CD_VIEW]= CreateDialogParam(hInst,MAKEINTRESOURCE(IDD_VIEWTXT),hDlg,DlgProcViewTxt,LPARAM(this));
hChild[CD_FAIRING]= CreateDialogParam(hInst,MAKEINTRESOURCE(IDD_FAIRING),hDlg,DlgProcFairing,LPARAM(this));
hChild[CD_PARTICLE] = CreateDialogParam(hInst,MAKEINTRESOURCE(IDD_PARTICLE),hDlg,DlgProcParticle,LPARAM(this));
hChild[CD_MISC] = CreateDialogParam(hInst,MAKEINTRESOURCE(IDD_MISC),hDlg,DlgProcMisc,LPARAM(this));
hChild[CD_TEX] = CreateDialogParam(hInst,MAKEINTRESOURCE(IDD_TEX),hDlg,DlgProcTex,LPARAM(this));
hChild[CD_BOOSTER] = CreateDialogParam(hInst,MAKEINTRESOURCE(IDD_BOOSTERS),hDlg,DlgProcBooster,LPARAM(this));
hChild[CD_CURVE] = CreateDialogParam(hInst,MAKEINTRESOURCE(IDD_BOOSTER_CURVE),hDlg,DlgProcCurve,LPARAM(this));
[B][COLOR="Red"]hChild[CD_STAGE] = CreateDialogParam(hInst,MAKEINTRESOURCE(IDD_STAGES),hDlg,DlgProcStage,LPARAM(this));[/COLOR][/B]
ShowWindow(GetDlgItem(hWnd,IDC_SAVEINI),SW_HIDE);
return FALSE;
}

the dialog param process function is simply:
Code:
BOOL DevModeDlg::StageProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
return oapiDefDialogProc (hWnd, uMsg, wParam, lParam);
}

I used the very same procedure for other 8 dialogs and this is working with inline, so I cannot figure out what disturbes d3d9 :shrug:

EDIT: I'm using orbiter BETA

#### fort

##### Active member
Latest beta build requires d3dx9_43.dll instead of d3dx9_42.dll. So the required DX run-times are newer/later than February 2010. Very likely June 2010 if I remember correctly.

d3dx9_43.dll, 26/05/2010 here.

#### kuddel

##### Donator
Donator
Hi there,

is there any limit to dialogs with D3D9? I'm having a CTD while defining the 9th dialog as dialogParam, while this is not happening with inline client.
Since the procedure is exactly the same of the previous eight I wonder if the problem is within d3d9 client.
The D3D9Client doesn't do anything with any CreateDialogParam() calls. It's just the win32 library (User32.lib/dll) function you are using.

Did you really make the hChild member big enough to hold 9 handles?
And is CD_STAGE really defined as 8?

Sometimes the most obvious things are hardest to see*

[*] personal experience

I used the very same procedure for other 8 dialogs and this is working with inline, so I cannot figure out what disturbes d3d9 :shrug:

EDIT: I'm using orbiter BETA
This is strange, but there is nothing in the D3D9Client that should interfere with the CreateDialogParam() calls. But as every DLL used memory different, the behavior is unpredictable when e.g. the Array is not big enough.

Last edited:

#### fred18

Donator
Thanks!

yep basics were fine and checked already: CD_STAGE is actually 1 and hChild i hChild[10] (I'm not over yet).

What I found out is that it's the dialog itself that is causing some troubles: i tried to use another dialog and it worked. For the time being I'm keeping the work with the inline, in order to see if I found out what element of the dialog is causing the crash with d3d9 (could be a combobox not filled in?).

---------- Post added at 22:21 ---------- Previous post was at 22:19 ----------

Sometimes the most obvious things are hardest to see*

[*] personal experience

That's an absolute truth. Sometimes I start to write questions here in the forum and I find what the error is while writing. So if I get to the end of the message without finding the mistake I press submit, otherwise I press cancel :lol:

#### SolarLiner

##### It's necessary, TARS.
That's an absolute truth. Sometimes I start to write questions here in the forum and I find what the error is while writing. So if I get to the end of the message without finding the mistake I press submit, otherwise I press cancel :lol:

That is why, I sometimes use my bedroom wall as a quiet listener to talk to him about my code and what I am writing. More than once I've been talking out loud to it, and then stopped, finally understanding what causes the bug I've been tracking for 3 days.

Using alternatives such as invisible aliens, or for waifus for the ones that want some realism thrown into the explaining experience might help if the plain wall version doesn't help. :lol:

#### fred18

Donator
Situation is getting a bit worse. I get CTD with two specific windows when I try to open them plus some random CTD when I press buttons here and there in the various dialogs...

This does not happen at all with the inline client, which is totally stable, I can do pretty much whatever I want and nothing ever happens there.

Could it be related to this? (from the documentation)
There is also a conflict between a GDI based dialog (i.e. pop-up) windows and
anti-aliasing in a true fullscreen mode which will disable the anti-aliasing.

Even if this happens in all full screen and in window mode...

---------- Post added at 04:04 ---------- Previous post was at 03:55 ----------

It seems also to be related to focus...

I have no idea of what happens with D3D9 and dialogs :shrug:

This is really a big issue for me, I want my system to be fully compatible with both inline and D3D9 but there is something that D3D9 doesn't like about my dialogs :sos:

#### jarmonik

Beta Tester
It would be necessary to run the program under a debugger and see where the CTD occur and what's stored in a call stack. It would help to diagnose the problem if I could reproduce the CTD on my computer.

Also, does it work if the parent window is set to desktop (i.e. NULL) instead of the render window ?

hChild[CD_STAGE] = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_STAGES), NULL, DlgProcStage, LPARAM(this));

Last edited: