Hi Dmitriy and everyone,
Thank you for your prompt reply. Can you please give me an example of
how to up-cast the methods as you described in your reply?
Here is a more detailed description of the problem I am experiencing. I
wrote and application that uses Direct3D to render the mechanism. To
drive the mechanism i use complex 6D numerical algorithm that uses
System.Math to get solutions. Both graphical and mathematical parts work
fine separately. However when i want to run graphical interface and
numerical engine in parallel in a single application I get the following
problem:
The System.Math starts to behave in a wired way, round function does not
work well/at all. If I try to round to two decimal places, it rounds to
13, when I try to print the rounded number to console it prints the
number with 13 decimal places rather than two. Also the actual math is
performed at a very slow rate.
If I can compile both applications separately ( as independent
executables) all works fine, simultaneously.
I tired to backtrack what causes the problem, and apparently the problem
comes once create the d3d device is executed:
// Create the device
device = new Device(graphicsSettings.AdapterOrdinal,
graphicsSettings.DevType, windowed ? RenderTarget : this , createFlags,
presentParams);
To write Direct3D engine, i directly adopted example 'Enhanced Mesh'
provided by DirectXSDK.
I think something happens to memory or to resources, but not sure about
it. Even if i dipose the device after it was created the problem is
still present. Also when I move the mouse over the function Round (after
typing Math.) it say in part of the hint text +3 overloads. So my
suspicion is that direct3d in some way affects system math and that some
functions are executed in different way.
Any ideas what is going wrong here, or how to easily isolate the two
parts to avoid all this?
Thanks,
ARK