Why shouldn't I use Immediate Mode for 2D?

  1. Immediate mode is fast enough for 2D ? (glBegin(GL_TRIANGLES); for (unsigned int i = 0; i < 50000; - Pastebin.com this renders smoothly)
  2. Are there any specific limitations when using Immediate Mode?
  3. Shaders - they work just fine with immediate mode (is this always true?)
  4. Tried vbo streaming batches (// gen vaoglGenVertexArrays(1, &mVaoHandle);// positions vboglGenBuffers - Pastebin.com and for some reason the same example runs waaay slower than the immediate mode example) - am I doing something wrong?

Using glew/SDL2
Target: OpenGL 2.1-4.5

If it’s fast enough for you, use it. Just keep in mind it uses quite a bit more CPU for submitting draw commands to OpenGL than necessary. This ancient mode makes very inefficient use of the CPU and GPU. For a test app only you’re going to use, I wouldn’t worry about it though.

  1. Are there any specific limitations when using Immediate Mode?

Yes. Excessive CPU consumption. There are others, but whether you care about them depends on your use case.

  1. Shaders - they work just fine with immediate mode (is this always true?)

Yes, I believe so.

  1. Tried vbo streaming batches (// gen vaoglGenVertexArrays(1, &mVaoHandle);// positions vboglGenBuffers - Pastebin.com and for some reason the same example runs waaay slower than the immediate mode example) - am I doing something wrong?

Yeah. That’s not really an efficient vbo streaming method. I’d recommend reading this wiki page for more efficient options:

A mid-ground stepping stone between immediate mode and efficiently-employed streaming buffer objects is to use 2) vertex arrays stored in client (app) memory (aka client arrays). This also sets you up pretty well for moving to streaming buffer objects when you’re ready.

[QUOTE=Dark Photon;1286175]If it’s fast enough for you, use it. Just keep in mind it uses quite a bit more CPU for submitting draw commands to OpenGL than necessary. This ancient mode makes very inefficient use of the CPU and GPU. For a test app only you’re going to use, I wouldn’t worry about it though.

Yes. Excessive CPU consumption. There are others, but whether you care about them depends on your use case.

Yes, I believe so.

Yeah. That’s not really an efficient vbostreaming method. I’d recommend reading this wiki page for more efficient options:

A mid-ground stepping stone between immediate mode and efficiently-employed streaming buffer objects is to use 2) vertex arrays stored in client (app) memory (aka client arrays). This also sets you up pretty well for moving to streaming buffer objects when you’re ready.[/QUOTE]

Thank you so much for your reply! It clarified a lot about 2D rendering to me :smiley: .