Skip to content

Instantly share code, notes, and snippets.

@codingminecraft
Created December 19, 2020 16:47
Show Gist options
  • Save codingminecraft/9760bc172ec30f03b1a9fd0438516f9a to your computer and use it in GitHub Desktop.
Save codingminecraft/9760bc172ec30f03b1a9fd0438516f9a to your computer and use it in GitHub Desktop.
OpenGL VB Debugging
' I changed lines 85-88 to this
Renderer.AddLayer(BackgroundBuffer.RenderID)
'Renderer.AddLayer(BackgroundBuffer.FrameBufferID, Source, Destination)
Renderer.UpdateImage(GB.RenderID, GB.Image)
Renderer.AddLayer(GB.RenderID)
' I commented out line 95 in UpdateImage:
'GL.Clear(ClearBufferMask.ColorBufferBit)
' I moved the TexParameteri functions, and changed the data types in TexImage2D
' I also changed the function AddImageBuffer (lines 153-163):
Dim Data As BitmapData = Image.LockBits(New Drawing.Rectangle(0, 0, Image.Width, Image.Height), ImageLockMode.ReadOnly, Imaging.PixelFormat.Format32bppArgb)
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, TextureMinFilter.Linear)
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, TextureMagFilter.Linear)
GL.TexImage2D(TextureTarget.Texture2D,
0, PixelInternalFormat.Rgba8,
Image.Width, Image.Height, 0, PixelFormat.Rgba,
PixelType.UnsignedByte, Data.Scan0)
Image.UnlockBits(Data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment