示例#1
0
        public NetGLControl()
        {
            if (DesignMode)
            {
                AddLabel("3D will be here");
                return;
            }

            var      time     = new SceneTime();
            Graphics graphics = null;

            try {
                graphics = new Graphics(this, time, ShadingTechnique.Forward);
            }
            catch (GLException ex) {
                Log.Exception(ex);

                AddLabel("Failed to initialize 3D: " + ex.Message);
                return;
            }
            Graphics = graphics;
            _scene   = new Scene.Scene(this, graphics, time);

            RenderDispatcher = RenderDispatcher.Current;

            SetStyle(ControlStyles.UserPaint, false);
            StartRenderLoop();
        }
示例#2
0
        internal Scene(NetGLControl control, Graphics graphics, SceneTime time)
        {
            Assert.NotNull(control);

            _control  = control;
            _time     = time;
            _graphics = graphics;

            SceneObjects = _sceneObjects.AsReadOnly();

            DrawCalls = 0;
            FrameNo   = 0;
        }
示例#3
0
 public Bitmap ReadImage()
 {
     return(Graphics.ReadImage());
 }