   Opengl print
  I used to use displaylist to print stuff onto screen ( learned from Nehe's lessons). But now displaylist is depreciated. What do you use to print?btw, I'm using SDL, Opengl with VC2010.   
  Everything in OpenGL is now done using VBOs and shaders.  i.e. what's fast on the GPU.  It's not a big deal to convert from Display Lists to VBOs.-me   ;  I don't think there's too many elegant solutions, but I think a vbo of textured quads is common practice.   ;  Oh you mean text.  The best way to render text is to create a texture atlas of your font set.  So one big texture with all your glyphs rendered onto it.  Then you use a shader to render the text to the screen.  There are probably more elegant implementations of this but what I did:1) loop your string2) for each character, glDrawArrays your font VBO (a single quad).  you set parameters for the shader for each character telling it the texture coords for the glyph you want to render (you get this from the lookup table to your texture atlas.3) after each character you just move the X & Y rasters (done by modifying the modelview matrix in your shader)That's a super rough explaination that leaves out a lot of data.  But if you google "font texture atlas opengl" you should be able to find some more coherent implementations.Jumping the shader hurdle for the first time makes this stuff seem super daunting.  But once it's under your belt you wonder why you used the fixed function pipeline for so long.-me   ;  Palidine, I'm just curious from reading your implementation, what is the advantage of this versus just calling your whole "string" in a single vbo? I didn't even think you would need a shader for this.Just setup a vbo of textured quads from your atlas and execute in a single glDrawElements:    o---o    |   |o---o   o---o| a | b | c |o---o---o---oAlso how are you modifying the model matrix in the shader? In the geometry shader? I didn't even think you could change uniforms in shader, and even if you could it doesn't make much sense to me, if you have to process four vertices independently, how would you know when to "increment" your matrix to the next position?   ;  So there's only one texture so you're never changing texture state.  And only one shader so you're never changing shader state.  You bind one texture and feed the shader each character to the shader as texture offsets into the main texture.  There's probably a way to do it where you just send the actual string to the shader instead of calling glDrawArray for each quad.In openGL 3.0+, the concept of model view and perspective matrix only exist in the shaders.  the whole suite of glPushMatrix/glTranslate/glPerspective/etc are all deprecated.  So yeah, each iteration I'm feeding the shader a new matrix.  I wasn't overly concerned with performance; as noted above it would perhaps be faster to pass the whole string to the shader somehow.  But my implementation was getting pretty good results so I stopped caring [smile]basicallyglUseShader(myFontShader);glSetUniform(myFontShader, myPerspectiveMatrix);rasterX = startXrasterY = startYfor ( each character ){    if ( character == newline )    {    rasterY += lineHeight;    rasterX = 0;    } else {    rasterX += spaceWidth    } else {myModelViewMatrix.m[12] = rasterXmyModelViewMatrix.m[13] = rasterYglSetUniform(myFontShader, myModelViewMatrix);glSetUniform(myFontShader, this characters texture coords)glDrawArrays(myFontQuadVBO)rasterX += this characters width    }}-me   ;  Btw, everything is now using VBOs and Shaders.I wonder if the 'glBegin() and glEnd()' also depreciated? i.e. we need to use shaders instead of using glBegin()s ?;  They are depreciated. However the choice isn't glBegin vs shaders. You can use immediate mode with or without shaders.Your choice is between:glBegin (depreciated) vs glDrawElements & Vertex BuffersFixed Pipeline (depreciated) vs Shaders;Quote:Original post by PalidineSo there's only one texture so you're never changing texture state.  And only one shader so you're never changing shader state.That doesn't mean you have to render each character one quad at a time. You can just as easily generate an array of vertex/texture coordinate data and an array of indices. Then all you need to do is adjust the vertices and texture coordinates as the text changes. The indices only need to be set when you create the initial array of vertex data, or when you resize the number of characters you can render (in the event you don't have control over the amount of text to be rendered). It also saves a lot of computation time in the event you're rendering hundreds/thousands of characters.   