I use an OpenTK GLcontrol as a faster alternative to GDI+ for displaying images and I would like to convert the old deprecated code to OpenGL 4 but I'm having trouble adapting code samples in guides I have found to my needs so would anyone kindly show me how to convert this:
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, rez.Width, rez.Height, PixelFormat.Bgr, PixelType.UnsignedByte, currentframe);
GL.MatrixMode(MatrixMode.Projection);
GL.LoadIdentity();
GL.Ortho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
GL.MatrixMode(MatrixMode.Modelview);
GL.LoadIdentity();
GL.Enable(EnableCap.Texture2D);
GL.BindTexture(TextureTarget.Texture2D, tex);
GL.Begin(PrimitiveType.Quads);
GL.TexCoord2(0.0f, 1.0f);
GL.Vertex2(-1.0f, -1.0f);
GL.TexCoord2(1.0f, 1.0f);
GL.Vertex2(1.0f, -1.0f);
GL.TexCoord2(1.0f, 0.0f);
GL.Vertex2(1.0f, 1.0f);
GL.TexCoord2(0.0f, 0.0f);
GL.Vertex2(-1.0f, 1.0f);
GL.End();
OGLControl.SwapBuffers();