Skip to content

What is the equivalent of...

Bryn

Asked Jun 17, 2006, 6:13 AM EDT1 answer
Share
LinkedInX

I'm sort of new to C#, and have begun learning the TrueVision SDK for it, unfortunately the truevision help file only contains C++ versions of the code (or at least I assume it to be) and conversions are usually pretty much straight forward, except now that I am trying to get lighting to work I am finding it difficult to do certian things, as my knowledge of C# and C++ are both limited (C++ to me I only have done the hello world thing) So what I am looking for is the C# equivalent of this code

Dim LightEngine As New TVLightEngine

Dim Light As D3DLIGHT8

Light.Type = D3DLIGHT_DIRECTIONAL

Light.Diffuse = DXColor(1, 1, 1, 1)

Light.Ambient = DXColor(1, 1, 1, 1)

DirectionalLight = LightEngine.CreateLight(Light, "light1")

What I have made of this is that

Dim LightEngine as New TVLightEngine

in C# is

LightEngine = new TVLightEngine();

However I am needing to use a 'D3DLIGHT8' according to the help file if I want to use the 'create light command' which in the code above is '(Light,' however to use that process in C# is where I am clueless.

I have tried all the possibilities that came to mind, but my knowledge is very limited, so can anyone help.

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    TVLightEngine LightEngine = new TVLightEngine; //You may need to instantiate this unless it is a static class D3DLIGHT8 Light; Light.Type = D3DLIGHT_DIRECTIONAL; Light.Diffuse = DXColor(1, 1, 1, 1); Light.Ambient = DXColor(1, 1, 1, 1); DirectionalLight = LightEngine.CreateLight(Light, "light1"); TVLightEngine LightEngine = new TVLightEngine; Not 100% that will compile because I don't have those object libraries on my laptop... but the syntax is correct.
    0