Browse Source

Removed Program.cs.
Call getVertexArray() in TestDataSource.

Daniel Kauth 11 years ago
parent
commit
b280776c96
3 changed files with 6 additions and 106 deletions
  1. 0 88
      bbiwarg/Program.cs
  2. 3 17
      bbiwarg/Test/TestDataSource.cs
  3. 3 1
      bbiwarg/bbiwarg.csproj

+ 0 - 88
bbiwarg/Program.cs

@@ -1,88 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Drawing;
-using OpenTK;
-using OpenTK.Graphics.OpenGL;
-using Iisu;
-
-namespace bbiwarg
-{
-    class Program : GameWindow
-    {
-
-        static void Main(string[] args)
-        {
-            Program demo = new Program();
-            demo.init();
-            demo.Run(30);
-        }
-
-        protected override void OnLoad(EventArgs e)
-        {
-            base.OnLoad(e);
-            Title = "Hello OpenTK!";
-            GL.ClearColor(Color.CornflowerBlue);
-        }
-
-        protected override void OnRenderFrame(FrameEventArgs e)
-        {
-            base.OnRenderFrame(e);
-
-           device.UpdateFrame(true);
-           
-
-            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
-
-            Matrix4 modelview = Matrix4.LookAt(Vector3.Zero, Vector3.UnitZ, Vector3.UnitY);
-            GL.MatrixMode(MatrixMode.Modelview);
-            GL.LoadMatrix(ref modelview);
-
-            // triangle
-            GL.Begin(BeginMode.Triangles);
-
-            float x = palmPosition.Value._X;
-            float y = palmPosition.Value._Y;
-            float z = palmPosition.Value._Z;
-
-            GL.Vertex3(-1.0f + x, -1.0f + z, 4.0f - 10*y);
-            GL.Vertex3(1.0f, -1.0f, 4.0f);
-            GL.Vertex3(0.0f, 1.0f, 4.0f);
-            GL.End();
-
-            SwapBuffers();
-            device.ReleaseFrame();
-        }
-
-        protected override void OnResize(EventArgs e)
-        {
-
-            base.OnResize(e);
-
-            GL.Viewport(ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width, ClientRectangle.Height);
-
-            Matrix4 projection = Matrix4.CreatePerspectiveFieldOfView((float)Math.PI / 4, Width / (float)Height, 1.0f, 64.0f);
-
-            GL.MatrixMode(MatrixMode.Projection);
-
-            GL.LoadMatrix(ref projection);
-        }
-
-        private IHandle handle;
-        private IDevice device;
-        private IDataHandle<Iisu.Data.Vector3> palmPosition;
-
-        public void init()
-        {
-            handle = Iisu.Iisu.Context.CreateHandle();
-            device = handle.InitializeDevice();
-            IEventManager em = handle.EventManager;
-
-            palmPosition = device.RegisterDataHandle<Iisu.Data.Vector3>("CI.HAND1.PalmPosition3D");
-
-            device.Start();
-        }
-
-    }
-}

+ 3 - 17
bbiwarg/Test/TestDataSource.cs

@@ -21,25 +21,11 @@ namespace bbiwarg.Test
             {
                 source.updateFrame();
 
-                if ((i % 30) == 0)
-                {
-                    ColorImage image = source.getColorImage();
-
-                    Bitmap bm = new Bitmap(image.getWidth(), image.getHeight());
-                    for (int x = 0; x < image.getWidth(); ++x)
-                    {
-                        for (int y = 0; y < image.getHeight(); ++y) 
-                        {
-                            bm.SetPixel(x, y, Color.FromArgb(image.getA(x, y), image.getR(x, y), image.getG(x, y), image.getB(x, y)));
-                        }
-                    }
-
-                    bm.Save("test." + j + ".png");
-                    j++;
-                }
+                VertexArray v = source.getVertexArray();
+
+
 
                 source.releaseFrame();
-                ++i;
             }
 
             source.stop();

+ 3 - 1
bbiwarg/bbiwarg.csproj

@@ -32,7 +32,7 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <PropertyGroup>
-    <StartupObject>bbiwarg.Test.OutputTest</StartupObject>
+    <StartupObject>bbiwarg.Test.TestDataSource</StartupObject>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="iisuNet, Version=3.0.0.0, Culture=neutral, processorArchitecture=x86">
@@ -56,11 +56,13 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="DataSource\Color4.cs" />
     <Compile Include="DataSource\ColorImage.cs" />
     <Compile Include="DataSource\ConfidenceImage.cs" />
     <Compile Include="DataSource\DepthImage.cs" />
     <Compile Include="DataSource\IisuDataSource.cs" />
     <Compile Include="DataSource\IVideoDataSource.cs" />
+    <Compile Include="DataSource\VertexArray.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Test\OutputTest.cs" />
     <Compile Include="Test\TestDataSource.cs" />