コード例 #1
0
 private void GlControl1_Paint(object sender, PaintEventArgs e)
 {
     GL.ClearColor(Color.Black);
     GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
     GL.Begin(PrimitiveType.Points);
     for (int i = 0; i < SelectedTexture.RawData.Length; i++)
     {
         GL.Color4(SelectedTexture.RawData[i]);
         GL.Vertex2(i % (SelectedTexture.Width), i / (SelectedTexture.Width));
     }
     GL.End();
     if (SelectedTexture.MipLevels > 0)
     {
         var widthOffset = SelectedTexture.Width;
         for (var i = 0; i < SelectedTexture.MipLevels; ++i)
         {
             var mip      = SelectedTexture.GetMips(i);
             var mipWidth = (SelectedTexture.Width / (1 << (i + 1)));
             GL.Begin(PrimitiveType.Points);
             for (int j = 0; j < mip.Length; ++j)
             {
                 GL.Color4(mip[j]);
                 GL.Vertex2(widthOffset + j % mipWidth, j / mipWidth);
             }
             GL.End();
             widthOffset += mipWidth;
         }
     }
     GlControl1.SwapBuffers();
     Application.DoEvents();
 }
コード例 #2
0
 void GlControl1_Paint(object sender, PaintEventArgs e)
 {
     if (!Loaded)
     {
         return;
     }
     Controller.Paint();
     GlControl1.SwapBuffers();
 }
コード例 #3
0
 private void GlControl1_Paint(object sender, PaintEventArgs e)
 {
     GL.ClearColor(Color.Black);
     GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
     GL.Begin(PrimitiveType.Points);
     for (int i = 0; i < Texture.RawData.Length; i++)
     {
         GL.Color4(Texture.RawData[i]);
         GL.Vertex2(i % (Texture.Width), i / (Texture.Width));
     }
     GL.End();
     GlControl1.SwapBuffers();
     Application.DoEvents();
 }
コード例 #4
0
 private void GlControl1_Paint(object sender, PaintEventArgs e)
 {
     GL.ClearColor(Color.Black);
     GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
     GL.Begin(BeginMode.Points);
     if (!(PSM_Surface == null))
     {
         {
             var withBlock = PSM_Surface[Index];
             ComboBox1.Items.Clear();
             for (int i = 0; i <= withBlock.PSM_Segments.Length - 1; i++)
             {
                 ComboBox1.Items.Add(withBlock.PSM_Segments[i].Name);
             }
             ComboBox1.SelectedIndex = 0;
             uint shift_x = 0;
             uint shift_y = 0;
             for (int i = 0; i <= withBlock.PSM_Segments.Length - 1; i++)
             {
                 if (shift_x + withBlock.PSM_Segments[i].Texture.Width > 512)
                 {
                     shift_x  = 0;
                     shift_y += withBlock.PSM_Segments[i].Texture.Height;
                 }
                 for (int j = 0; j <= withBlock.PSM_Segments[i].Texture.RawData.Length - 1; j++)
                 {
                     if (CheckBox2.Checked)
                     {
                         GL.Color4((byte)255, withBlock.PSM_Segments[i].Texture.Index[j], withBlock.PSM_Segments[i].Texture.Index[j], withBlock.PSM_Segments[i].Texture.Index[j]);
                     }
                     else
                     {
                         GL.Color4(withBlock.PSM_Segments[i].Texture.RawData[j]);
                     }
                     GL.Vertex2(shift_x + j % withBlock.PSM_Segments[i].Texture.Width, shift_y + j / withBlock.PSM_Segments[i].Texture.Width);
                 }
                 shift_x += withBlock.PSM_Segments[i].Texture.Width;
             }
         }
     }
     GL.End();
     GlControl1.SwapBuffers();
     Application.DoEvents();
 }
コード例 #5
0
 private void GlControl1_Paint(object sender, PaintEventArgs e)
 {
     GL.ClearColor(Color.Black);
     GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
     GL.Begin(PrimitiveType.Points);
     for (int i = 0; i <= Texture.RawData.Length - 1; i++)
     {
         if (CheckBox1.Checked == true)
         {
             GL.Color4(Color.FromArgb(255, Texture.Index[i], Texture.Index[i], Texture.Index[i]));
         }
         else
         {
             GL.Color4(Texture.RawData[i]);
         }
         GL.Vertex2(i % (Texture.Width), i / (Texture.Width));
     }
     GL.End();
     GlControl1.SwapBuffers();
     Application.DoEvents();
 }
コード例 #6
0
 private void GlControl1_Paint(object sender, PaintEventArgs e)
 {
     GL.ClearColor(Color.Black);
     GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
     GL.Begin(PrimitiveType.Points);
     if (cbViewFullPSM.Enabled && cbViewFullPSM.Checked)
     {
         var widthOffset = 0;
         var heighOffset = 0;
         var maxWidth    = PTCs.Max(p => p.Texture.Width);
         var maxHeight   = PTCs.Max(p => p.Texture.Height);
         for (int i = 0; i < PTCs.Count; ++i)
         {
             for (int j = 0; j < PTCs[i].Texture.RawData.Length; ++j)
             {
                 GL.Color4(PTCs[i].Texture.RawData[j]);
                 GL.Vertex2(widthOffset + (j % (PTCs[i].Texture.Width)), heighOffset + (j / (PTCs[i].Texture.Width)));
             }
             widthOffset += maxWidth;
             if ((i + 1) % 4 == 0)
             {
                 heighOffset += maxHeight;
                 widthOffset  = 0;
             }
         }
     }
     else
     {
         for (int i = 0; i < SelectedPTC.Texture.RawData.Length; i++)
         {
             GL.Color4(SelectedPTC.Texture.RawData[i]);
             GL.Vertex2(i % (SelectedPTC.Texture.Width), i / (SelectedPTC.Texture.Width));
         }
     }
     GL.End();
     GlControl1.SwapBuffers();
     Application.DoEvents();
 }