kwizatz's picture

OpenTK.OpenGL.GL.GetFloatv not returning anything

Hi,

Ok, I swear I made this question already about a year (maybe more) ago but I guess you changed forums because is nowhere to be found.

I am unable to retrieve the projection and model view matrices using OpenTK.OpenGL.GL.GetFloatv,
I was able to with a stale binary I kept since I asked the question last time, now I upgraded, and after making all the changes
required for my project to compile I am getting 2 matrices full of zeroes again at runtime.

I cant remember what was the issue last time, I think it was something I overlooked and not a bug in the code,
but without the forum post I cant recall what was it.

Anyway this is the current code:

float[] proj = new float[16], modl = new float[16], clip = new float[16];
OpenTK.OpenGL.GL.GetFloatv(GL.Enums.GetPName.PROJECTION_MATRIX, proj);
OpenTK.OpenGL.GL.GetFloatv(GL.Enums.GetPName.MODELVIEW_MATRIX, modl);

Thanks in advance for your help :)

Edit: If its any help, the version of OpenTK.OpenGL.dll I was using was 0.3.4.1

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler.'s picture

I think I remember this issue :) I'll search the old forum to make sure, but didn't it have something to do with calling GetFloatv being illegal within a Begin - End block?

Edit: aha, here it is!

kwizatz's picture

Thanks... but thats odd, I don't think this is the same situation, It worked before I upgraded OTK, granted it took a lot of changes to get it to compile again.

Anyway, many thanks! I'll see if somehow I am calling it between begin/end calls.