The program below produces a window with a rotating white rectangle from an array in OpenGL 3.2+ :Īpart from a few glBind.(0) calls, the example is minimal - drawing simple things the "new" way in OpenGL is unfortunately pretty involved. I don't understand these things either or if I need them, hence the question.ĮDIT updated the program to display data that changes over time Previously (years ago) I have used things like glBindBuffers, glGenBuffers, etc. In function called when CTRL+C is pressed: GlVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, points) // No idea what this is or how it works GLfloat* points = new GLfloat // x, y, z points Inside esMainLoop, inside drawing function: Fill my_points with some data to be drawn as a continuous line on the screen in x-y space. I think that I have misunderstood, or not understood some of the steps for drawing data with OpenGL.Īssuming that I can open an OpenGL context, please could you (a SO user reading this question) clarify all the steps required to render an array of points describing a line in OpenGL.Ĭurrently I have been doing this: // In main: I am new to the "new OpenGL" method of doing things.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |