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();
}