Beispiel #1
0
        /// <summary>
        /// Initialise the scene
        /// </summary>
        /// <param name="window">The IWin32Window to render to.  System.Windows.Forms.Form implements IWin32Window</param>
        /// <param name="target">The render target</param>
        /// <param name="resolution">The resolution to render in</param>
        public void Initialise(IWin32Window window, EnumRenderTarget target, Resolution resolution)
        {
            try {
                R3DRENDERTARGET r3dtarget = convertRenderTarget(target);
                Engine.R3DEngine.Inf_SetRenderTarget(window.Handle.ToInt32(), ref r3dtarget);
                if (resolution != Resolution.Automatic)
                {
                    Engine.R3DEngine.Inf_ForceResolution(resolution.Width, resolution.Height, resolution.ColourDepth);
                }
                Engine.R3DEngine.InitializeMe(false);

                R3DColor color = new R3DColor();
                color.r = 30;
                color.g = 30;
                color.b = 140;
                Engine.Pipeline.SetBackColor(ref color);
                Engine.Pipeline.SetDithering(true);
                Engine.Pipeline.SetFillMode(R3D089_VBasic.R3DFILLMODE.R3DFILLMODE_SOLID);
                R3DColor white = new R3DColor();
                white.r = 128;
                white.b = 128;
                white.g = 128;
                Engine.Pipeline.SetAmbientLight(ref white);
                Engine.Pipeline.SetColorKeying(true);
                Engine.Pipeline.SetSpecular(true);
                Engine.Pipeline.SetMipMapping(false);
                Engine.Pipeline.SetShadeMode(R3DSHADEMODE.R3DSHADEMODE_GOURAUD);
                Engine.Pipeline.SetTextureFilter(R3DTEXTUREFILTER.R3DTEXTUREFILTER_LINEARFILTER);
                _renderTarget = window;
            }
            catch (Exception e) {
                throw new EngineInitialisationException(e);
            }
        }
Beispiel #2
0
		/// <summary>
		/// Initialise the scene
		/// </summary>
		/// <param name="window">The IWin32Window to render to.  System.Windows.Forms.Form implements IWin32Window</param>
		/// <param name="target">The render target</param>
		/// <param name="resolution">The resolution to render in</param>
		public void Initialise(IWin32Window window, EnumRenderTarget target, Resolution resolution) {
			try {
				R3DRENDERTARGET r3dtarget = convertRenderTarget( target );
				Engine.R3DEngine.Inf_SetRenderTarget(window.Handle.ToInt32(), ref r3dtarget);
				if(resolution != Resolution.Automatic) {
					Engine.R3DEngine.Inf_ForceResolution(resolution.Width, resolution.Height, resolution.ColourDepth);
				}
				Engine.R3DEngine.InitializeMe( false );

				R3DColor color = new R3DColor();
				color.r = 30;
				color.g = 30;
				color.b = 140;
				Engine.Pipeline.SetBackColor(ref color);
				Engine.Pipeline.SetDithering(true);
				Engine.Pipeline.SetFillMode(R3D089_VBasic.R3DFILLMODE.R3DFILLMODE_SOLID);
				R3DColor white = new R3DColor();
				white.r = 128;
				white.b = 128;
				white.g = 128;
				Engine.Pipeline.SetAmbientLight(ref white);
				Engine.Pipeline.SetColorKeying(true);
				Engine.Pipeline.SetSpecular(true);
				Engine.Pipeline.SetMipMapping(false);
				Engine.Pipeline.SetShadeMode(R3DSHADEMODE.R3DSHADEMODE_GOURAUD);
				Engine.Pipeline.SetTextureFilter(R3DTEXTUREFILTER.R3DTEXTUREFILTER_LINEARFILTER);
				_renderTarget = window;
			}
			catch(Exception e) {
				throw new EngineInitialisationException(e);
			}
		}