|
@@ -32,8 +32,8 @@ namespace bbiwarg.Output.DebugOutput
|
|
private DebugImages debugImages;
|
|
private DebugImages debugImages;
|
|
|
|
|
|
public DebugWindow(InputProvider inputProvider, InputHandler inputHandler)
|
|
public DebugWindow(InputProvider inputProvider, InputHandler inputHandler)
|
|
- : base((int)(Parameters.DebugOutputScaleFactor * Math.Max(1, Math.Min(Parameters.DebugOutputNumImagesPerRow, Parameters.DebugOutputNumImages)) * Parameters.ImageWidth),
|
|
+ : base((int)(Parameters.DebugWindowScaleFactor * Math.Max(1, Math.Min(Parameters.DebugWindowNumImagesPerRow, Parameters.DebugWindowNumImages)) * Parameters.ImageWidth),
|
|
- (int)(Parameters.DebugOutputScaleFactor * (1 + (Parameters.DebugOutputNumImages - 1) / Parameters.DebugOutputNumImagesPerRow) * Parameters.ImageHeight))
|
|
+ (int)(Parameters.DebugWindowScaleFactor * (1 + (Parameters.DebugWindowNumImages - 1) / Parameters.DebugWindowNumImagesPerRow) * Parameters.ImageHeight))
|
|
{
|
|
{
|
|
this.inputProvider = inputProvider;
|
|
this.inputProvider = inputProvider;
|
|
this.inputHandler = inputHandler;
|
|
this.inputHandler = inputHandler;
|
|
@@ -46,16 +46,9 @@ namespace bbiwarg.Output.DebugOutput
|
|
protected override void OnLoad(EventArgs e)
|
|
protected override void OnLoad(EventArgs e)
|
|
{
|
|
{
|
|
base.OnLoad(e);
|
|
base.OnLoad(e);
|
|
- Title = Parameters.DebugOutputTitle;
|
|
+ Title = Parameters.DebugWindowTitle;
|
|
GL.ClearColor(Color.Black);
|
|
GL.ClearColor(Color.Black);
|
|
|
|
|
|
-
|
|
|
|
- GL.Enable(EnableCap.Blend);
|
|
|
|
- GL.BlendEquation(BlendEquationMode.Max);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- GL.Enable(EnableCap.DepthTest);
|
|
|
|
-
|
|
|
|
|
|
|
|
GL.Enable(EnableCap.Texture2D);
|
|
GL.Enable(EnableCap.Texture2D);
|
|
GL.GenTextures(1, out textureID);
|
|
GL.GenTextures(1, out textureID);
|
|
@@ -83,8 +76,8 @@ namespace bbiwarg.Output.DebugOutput
|
|
int screenWidth = ClientRectangle.Width;
|
|
int screenWidth = ClientRectangle.Width;
|
|
int screenHeight = ClientRectangle.Height;
|
|
int screenHeight = ClientRectangle.Height;
|
|
|
|
|
|
- int numRows = 1 + (Parameters.DebugOutputNumImages - 1) / Parameters.DebugOutputNumImagesPerRow;
|
|
+ int numRows = 1 + (Parameters.DebugWindowNumImages - 1) / Parameters.DebugWindowNumImagesPerRow;
|
|
- int numCols = Math.Min(Parameters.DebugOutputNumImages, Parameters.DebugOutputNumImagesPerRow);
|
|
+ int numCols = Math.Min(Parameters.DebugWindowNumImages, Parameters.DebugWindowNumImagesPerRow);
|
|
int heightForWidth = (int)((float)screenWidth / ((float)numCols * Parameters.ImageAspectRatio) * (float)numRows);
|
|
int heightForWidth = (int)((float)screenWidth / ((float)numCols * Parameters.ImageAspectRatio) * (float)numRows);
|
|
|
|
|
|
GL.Viewport(0, (screenHeight - heightForWidth) / 2, screenWidth, heightForWidth);
|
|
GL.Viewport(0, (screenHeight - heightForWidth) / 2, screenWidth, heightForWidth);
|
|
@@ -100,6 +93,9 @@ namespace bbiwarg.Output.DebugOutput
|
|
Timer.start("DebugWindow.OnUpdateFrame");
|
|
Timer.start("DebugWindow.OnUpdateFrame");
|
|
base.OnUpdateFrame(e);
|
|
base.OnUpdateFrame(e);
|
|
|
|
|
|
|
|
+ if (!inputProvider.IsActive)
|
|
|
|
+ Exit();
|
|
|
|
+
|
|
FrameData frameData = inputHandler.FrameData;
|
|
FrameData frameData = inputHandler.FrameData;
|
|
if (frameData != null)
|
|
if (frameData != null)
|
|
{
|
|
{
|
|
@@ -128,7 +124,7 @@ namespace bbiwarg.Output.DebugOutput
|
|
GL.MatrixMode(MatrixMode.Modelview);
|
|
GL.MatrixMode(MatrixMode.Modelview);
|
|
GL.LoadMatrix(ref modelview);
|
|
GL.LoadMatrix(ref modelview);
|
|
|
|
|
|
- Title = Parameters.DebugOutputTitle + " (Frame: " + currentFrameID + ")";
|
|
+ Title = Parameters.DebugWindowTitle + " (Frame: " + currentFrameID + ")";
|
|
|
|
|
|
GL.Enable(EnableCap.Texture2D);
|
|
GL.Enable(EnableCap.Texture2D);
|
|
|
|
|
|
@@ -136,8 +132,8 @@ namespace bbiwarg.Output.DebugOutput
|
|
int imageIndex = 0;
|
|
int imageIndex = 0;
|
|
foreach (OutputImage image in debugImages.Images)
|
|
foreach (OutputImage image in debugImages.Images)
|
|
{
|
|
{
|
|
- int column = imageIndex % Parameters.DebugOutputNumImagesPerRow;
|
|
+ int column = imageIndex % Parameters.DebugWindowNumImagesPerRow;
|
|
- int row = imageIndex / Parameters.DebugOutputNumImagesPerRow;
|
|
+ int row = imageIndex / Parameters.DebugWindowNumImagesPerRow;
|
|
GL.BindTexture(TextureTarget.Texture2D, textureID);
|
|
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.ImageWidth, Parameters.ImageHeight, 0, PixelFormat.Rgb, PixelType.UnsignedByte, image.Image.MIplImage.imageData);
|
|
GL.Begin(PrimitiveType.Quads);
|
|
GL.Begin(PrimitiveType.Quads);
|