Ejemplo n.º 1
0
        public ViewForm()
        {
            InitializeComponent();

            vaultCtx = new vdkContext();

            LoginBox box = new LoginBox(ref vaultCtx);

            box.ShowDialog();

            if (box.GetLoginInfo())
            {
                renderCtx  = new vdkRenderContext();
                renderView = new vdkRenderView();

                vdkWidth  = (uint)panel1.Width;
                vdkHeight = (uint)panel1.Height;

                vdkColorBuffer = new uint[vdkWidth * vdkHeight];
                vdkDepthBuffer = new float[vdkWidth * vdkHeight];

                renderCtx.Create(vaultCtx);
                renderView.Create(vaultCtx, renderCtx, vdkWidth, vdkHeight);
                renderView.SetTargets(ref vdkColorBuffer, 0, ref vdkDepthBuffer);

                bmp = new Bitmap((int)vdkWidth, (int)vdkHeight, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
            }
            else
            {
                closeWhenPossible = true;
            }
        }
Ejemplo n.º 2
0
 void RebuildBuffers(int newWidth, int newHeight)
 {
     InitialiseBuffers(newWidth, newHeight);
     colourTexture.Resize(width, height, TextureFormat.BGRA32, false);
     depthTexture.Resize(width, height, TextureFormat.RFloat, false);
     vRenderView.Destroy();
     vRenderView.Create(GlobalVDKContext.vContext, GlobalVDKContext.renderer, (uint)width, (uint)height);
     vRenderView.SetTargets(ref colourBuffer, 0, ref depthBuffer);
 }
Ejemplo n.º 3
0
    /*
     * creates the render view and sets the targets
     */
    void SetRenderView()
    {
        Debug.Log("creating plane render view");
        renderView = new vdkRenderView();
        if (GlobalVDKContext.isCreated == false)
        {
            GlobalVDKContext.Login();
        }

        renderView.Create(GlobalVDKContext.vContext, GlobalVDKContext.renderer, (uint)widthPix, (uint)heightPix);
        depthBuffer  = new float[widthPix * heightPix];
        colourBuffer = null;
        renderView.SetTargets(ref colourBuffer, 0, ref depthBuffer);
    }
Ejemplo n.º 4
0
 public override void Init()
 {
     try
     {
         GlobalVDKContext.Login();
         InitialiseBuffers(width, height);
         InitialiseTextures();
         vRenderView = new vdkRenderView();
         vRenderView.Create(GlobalVDKContext.vContext, GlobalVDKContext.renderer, (uint)width, (uint)height);
         vRenderView.SetTargets(ref colourBuffer, 0, ref depthBuffer);
     }
     catch
     {
         System.Diagnostics.Debug.WriteLine("Failed to Init");
     }
 }