Example #1
0
        public void Draw(RendererContext context)
        {
            if (!isInitialized)
            {
                return;
            }

            GDIHelper.SetDIBitsToDevice(handle, 0, 0, width, height, 0, 0, 0, height, ref context.Buffer[0], ref info, 0);
        }
Example #2
0
        public RendererContext(int Width, int Height)
        {
            Size        = new Math.Vector2(Width, Height);
            Buffer      = new int[Width * Height];
            depthBuffer = new float[Width * Height];

            this.Width  = Width;
            this.Height = Height;

            CurrentContext = this;
        }
Example #3
0
        private void OnLoad(object sender, EventArgs e)
        {
            context = new RendererContext(Width, Height);
            context.ResetDepthBuffer();
            rendererBox.InitGDI(Width, Height);

            object3D = new Object3D(Primitives.GetPrimitive("Cube"));

            rendererTimer          = new Timer();
            rendererTimer.Interval = 1;
            rendererTimer.Tick    += OnUpdate;
            rendererTimer.Start();
        }
Example #4
0
 private void Engine_Resize(object sender, EventArgs e)
 {
     context = new RendererContext(Width, Height);
     context.ResetDepthBuffer();
     rendererBox.InitGDI(Width, Height);
 }