0

I'm trying to fix a problem while running into those two stackoverflow questons OpenGL with OpenTK wrapper cannot get projections to work and OpenTK Camera in C#. Both state I should use GL functions I just don't have!
What am I doing wrong/how can I get those? All three aren't available, even with the following usings

GL.MatrixMode()
MatrixMode.Projection
GL.LoadMatrix()

using OpenTK.Graphics.OpenGL4;
using OpenTK;

My guess is I missed a using, but since visual studio doesn't show me a single hotfix I'm kind of lost

harlekintiger
  • 337
  • 7
  • 22
  • Does it work if you add the following: `using OpenTK.Graphics.OpenGL;`? – SurvivalMachine Jul 28 '17 at 13:51
  • It actually does, thank you!! Of course, everything else now is ambiguous, I'll delete the using OpenGl4. Is it bad if I use opengl in this one class but opengl4 everywere else? And how am I supposed to get the functionality of those functions in OpenGL4? – harlekintiger Jul 28 '17 at 14:27

1 Answers1

1

I couldn't find up-to-date documentation for OpenTK, but seems that those using statements only import modern OpenGL functionality. As I said in comments, adding using OpenTK.Graphics.OpenGL; imports older functions such as those in your question.

Modern OpenGL doesn't have functions for matrices, you must implement the functionality yourself, eg. declaring a matrix as a float matrix[ 16 ] and upload the matrices as uniforms using GL.UniformMatrix4.

SurvivalMachine
  • 7,946
  • 15
  • 57
  • 87
  • So I should implement them by myself is what you're saying. That's unfortunate, because I came to those described functions exactly because doing it manually didn't work for me..: https://stackoverflow.com/questions/45370564/opentk-after-multiplying-with-projectionmatrix-nothing-is-rendering-anymore?noredirect=1#comment77713666_45370564 – harlekintiger Jul 28 '17 at 15:07