What exactly is an "OpenGL Context"? How does it work?

Started by
13 comments, last by Aks9 12 years, 10 months ago

This isn't a direct answer to your question, but I would recommend the NeHe tutorial for learning openGL. It will take you through creating a Window, setting up openGL, drawing on the Window, and much more.

http://nehe.gamedev....on.asp?index=01


Just remember that following a tutorial is no substitute for reading the documentation. A tutorial shows you how to use a hammer to drive in a nail. If someone then gives you a screw you will think to yourself "this looks a lot like a nail, better use a hammer!". Read the documentation on nails, screws and hammers is all I'm saying :D
Advertisement
For your review, I just added this section to the Wiki FAQ
http://www.opengl.org/wiki/FAQ#GL_context

I am keeping it short. I did not go into the actual calls needed since these are OS specific and you can get that info from other parts of the web.

You can give feedback. Modify the Wiki to your liking, etc.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
No offense V-man, but you didn't write about any important aspect of the rendering context except that we need it in order to execute any GL code. You didn't even answer on your own question (why do we need a window?). Anyway it is good that beginners can read something, although I don't think they really read wiki. It is easier to ask a question on the forum. :)
You need a window because that is how it is designed. It is as simple as that. I have made a slight modification to that section.
You can of course modify it or make suggestions right here if you want things worded differently.

Anyway it is good that beginners can read something, although I don't think they really read wiki.[/quote]
You can say that about any other webpage.
The Wiki is not for stopping people from asking questions.

Before the Wiki was around, people asked questions and received many nice answers and that followed by "Why isn't this documented somewhere?". At some point, whoever manages opengl.org decided that a Wiki would be a good idea.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
You need a window because that is how it is designed. It is as simple as that.


No comment. (Or to be more precise, I've already commented such answers)


You can of course modify it or make suggestions right here if you want things worded differently.


I don't like writing wikis, because they are so impersonal. Although I have to admit that Wikipedia is really great.


Concerning OpenGL rendering context (RC), I think I've said what I have to say. The most important aspects are: what it is, how it can be created, what the scope of RC is, how resources can be shared, profiles and forward compatibility. But since OP hasn't reacted on our posts, we are probably uselessly fiddling. :D

This topic is closed to new replies.

Advertisement