Browse Source

Histogram and DepthMap are drawn.

Daniel Kauth 11 years ago
parent
commit
95fac6ded9
1 changed files with 17 additions and 14 deletions
  1. 17 14
      bbiwarg/Graphics/Output2D.cs

+ 17 - 14
bbiwarg/Graphics/Output2D.cs

@@ -80,20 +80,8 @@ namespace bbiwarg.Graphics
                 }
             }
 
-            /*GL.BindTexture(TextureTarget.Texture2D, textureId);
-            GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgb, videoHandle.getWidth(), videoHandle.getHeight(), 0,
-                          PixelFormat.Rgb, PixelType.Short, textureData);
-
-            float size_2 = 0.5f / 2.0f;
-            GL.Begin(PrimitiveType.Quads);
-            GL.Color3(1.0, 1.0, 1.0);
-            GL.TexCoord2(0.0, 0.0); GL.Vertex3(-size_2,  size_2, -0.5);
-            GL.TexCoord2(1.0, 0.0); GL.Vertex3( size_2,  size_2, -0.5);
-            GL.TexCoord2(1.0, 1.0); GL.Vertex3( size_2, -size_2, -0.5);
-            GL.TexCoord2(0.0, 1.0); GL.Vertex3(-size_2, -size_2, -0.5);
-            GL.End();*/
-
-
+            // draw histogram
+            GL.Disable(EnableCap.Texture2D);
             int[] histogram = videoHandle.getHistogram();
             int maxValue = 0;
             for (int i = 0; i < histogram.Length; ++i)
@@ -111,6 +99,21 @@ namespace bbiwarg.Graphics
             }
             GL.End();
 
+            // draw texture
+            GL.Enable(EnableCap.Texture2D);
+            GL.BindTexture(TextureTarget.Texture2D, textureId);
+            GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgb, videoHandle.getWidth(), videoHandle.getHeight(), 0,
+                          PixelFormat.Rgb, PixelType.Short, textureData);
+
+            float size_2 = 0.5f / 2.0f;
+            GL.Begin(PrimitiveType.Quads);
+            GL.Color3(1.0, 1.0, 1.0);
+            GL.TexCoord2(0.0, 0.0); GL.Vertex3(-size_2,  size_2, -0.5);
+            GL.TexCoord2(1.0, 0.0); GL.Vertex3( size_2,  size_2, -0.5);
+            GL.TexCoord2(1.0, 1.0); GL.Vertex3( size_2, -size_2, -0.5);
+            GL.TexCoord2(0.0, 1.0); GL.Vertex3(-size_2, -size_2, -0.5);
+            GL.End();
+
             sw.Stop();
             Console.WriteLine(sw.ElapsedMilliseconds);