Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C#. OpenTK same code as OpenGL?

Tags:

c#

opengl

opentk

I'm thinking about learning OpenGL with C# and i'm planning to use OpenTK. I'm wondering if the code is the same for OpenTK and "real OpenGL"?. Do i have to read books/tutorials on OpenTK or can i read about OpenGL and still learn to code with it in C#?

like image 439
user1621127 Avatar asked Sep 07 '12 10:09

user1621127


1 Answers

I'd say learn OpenGL, then check out some of the minor differences between C++/OpenGL and C#/OpenTK on their website. As I stated the differences are overall minor, and OpenTK will only make things easier for you, it won't make them more complicated.

Also what I've noticed about OpenTK, is that they are trying to make some of the basic types look like XNA. I.e., you'll find glVertex3f(float, float, float); in OpenGL/C++, which you can write like GL.Vertex3(Vector3); , of which they 'stole' the Vector3 data type from XNA (although you're not required to do this with a Vector3), so with things like that it might be handy to read some of the OpenTK documentation. Although this is not necessary, it might help simplify some things.

As for myself, I started learning OpenTK with prior experience in XNA, so I already knew the main logic behind games, and the switch to OpenTK was so simple that I found all the information I needed on-line!

like image 195
antonijn Avatar answered Sep 30 '22 06:09

antonijn