XCom.GraphicsControl.GraphicsControl C# (CSharp) Method

GraphicsControl() private method

Constructor. Initializes DirectDraw Device and surfaces.
private GraphicsControl ( Form RenderControl ) : System
RenderControl System.Windows.Forms.Form /// The control the device is connected to. ///
return System
		private GraphicsControl(Form RenderControl)
		{
			// Save reference to target control
			this.target = RenderControl; 
			// Create DirectDraw device
			graphicsDevice = new Device();

#if windowed
			// In debug mode, use windowed level
			graphicsDevice.SetCooperativeLevel(this.target, 
				CooperativeLevelFlags.Normal);
#else
			// In release mode, use fullscreen...
			graphicsDevice.SetCooperativeLevel(this.target, 
			CooperativeLevelFlags.FullscreenExclusive);

			// ...and 640x480x16 resolution with 85Hz frequency
			graphicsDevice.SetDisplayMode(640, 480, 32, 85, true);
#endif

			// create surfaces
			this.CreateSurfaces();
		}