|
@@ -34,14 +34,7 @@ namespace bbiwarg.Output.GlassesOutput
|
|
|
base.OnLoad(e);
|
|
|
Title = Parameters.GlassesWindowTitle;
|
|
|
GL.ClearColor(Color.Black);
|
|
|
- /*
|
|
|
- // transparency
|
|
|
- GL.Enable(EnableCap.Blend);
|
|
|
- GL.BlendEquation(BlendEquationMode.Max);
|
|
|
-
|
|
|
- // Depth Test
|
|
|
- GL.Enable(EnableCap.DepthTest);
|
|
|
- */
|
|
|
+
|
|
|
// Texture
|
|
|
GL.Enable(EnableCap.Texture2D);
|
|
|
GL.GenTextures(1, out textureID);
|
|
@@ -65,14 +58,9 @@ namespace bbiwarg.Output.GlassesOutput
|
|
|
|
|
|
int screenWidth = ClientRectangle.Width;
|
|
|
int screenHeight = ClientRectangle.Height;
|
|
|
- /*
|
|
|
- int numRows = 1 + (Parameters.DebugWindowNumImages - 1) / Parameters.DebugWindowNumImagesPerRow;
|
|
|
- int numCols = Math.Min(Parameters.DebugWindowNumImages, Parameters.DebugWindowNumImagesPerRow);
|
|
|
- int heightForWidth = (int)((float)screenWidth / ((float)numCols * Parameters.ImageAspectRatio) * (float)numRows);
|
|
|
- */
|
|
|
- GL.Viewport(0, 0, screenWidth, screenHeight);
|
|
|
- //GL.Viewport(0, (screenHeight - heightForWidth) / 2, screenWidth, heightForWidth);
|
|
|
|
|
|
+ GL.Viewport(0, 0, screenWidth, screenHeight);
|
|
|
+
|
|
|
//Matrix4 projection = Matrix4.CreateOrthographicOffCenter(0, numCols, numRows, 0, 0.001f, 10f);
|
|
|
Matrix4 projection = Matrix4.CreateOrthographicOffCenter(0, 1, 1, 0, 0.001f, 10f);
|
|
|
GL.MatrixMode(MatrixMode.Projection);
|
|
@@ -98,6 +86,8 @@ namespace bbiwarg.Output.GlassesOutput
|
|
|
|
|
|
Timer.start("GlassesWindow.OnUpdateFrame::updateImage");
|
|
|
//TODO update image
|
|
|
+ if (image != null)
|
|
|
+ image.Dispose();
|
|
|
image = new OutputImage(Parameters.GlassesWindowWidth, Parameters.GlassesWindowHeight);
|
|
|
Timer.stop("GlassesWindow.OnUpdateFrame::updateImage");
|
|
|
}
|
|
@@ -124,7 +114,7 @@ namespace bbiwarg.Output.GlassesOutput
|
|
|
Timer.start("GlassesWindow.OnRenderFrame::drawImage");
|
|
|
|
|
|
GL.BindTexture(TextureTarget.Texture2D, textureID);
|
|
|
- GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgb, Parameters.ImageWidth, Parameters.ImageHeight, 0, PixelFormat.Rgb, PixelType.UnsignedByte, image.Image.MIplImage.imageData);
|
|
|
+ GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgb, Parameters.GlassesWindowWidth, Parameters.GlassesWindowHeight, 0, PixelFormat.Rgb, PixelType.UnsignedByte, image.Image.MIplImage.imageData);
|
|
|
GL.Begin(PrimitiveType.Quads);
|
|
|
GL.Color3(1.0, 1.0, 1.0);
|
|
|
GL.TexCoord2(0, 0); GL.Vertex3(0, 0, -1);
|
|
@@ -144,7 +134,7 @@ namespace bbiwarg.Output.GlassesOutput
|
|
|
|
|
|
private void handleKeyDown(object sender, KeyboardKeyEventArgs e)
|
|
|
{
|
|
|
- Console.WriteLine("jens ist plööhöhöhöhööt");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|