1

I've been having a problem trying to get OpenGL 3.2 to work and after spending a few hours trying to figure out what was wrong I realized that it does not support glBegin. I use that command probably about 50-100 times in my engine to draw full screen quads and GUI elements. So what is a simple way to just draw a rectangle with OpenGL 3.2? Do I actually have to create a vertex buffer, fragment shader, and vertex shader to do something so simple?!

SteveDeFacto
  • 1,317
  • 4
  • 19
  • 35
  • If you want to use the _modern_ api then yeah, you will have to create vertex and fragment shaders... The fixed pipeline is gone, unless you use the compatibility extension. – K-ballo Dec 24 '12 at 05:22
  • You can always revert to compatibility profile but then you gain nothing in using the newer version.Also there is no point getting stuff with Fixed pipeline.The programmable pipeline is not the future , it already here. – Michael IV Dec 24 '12 at 10:04

1 Answers1

5

Do I actually have to create a vertex buffer, fragment shader, and vertex shader to do something so simple?!

Yep, no freebies in Core profile.

genpfault
  • 51,148
  • 11
  • 85
  • 139
  • 2
    @SteveDeFacto: Not really. Writing a shader is much less work than dealing with all the state management involved in fixed function pipeline. With shaders it's just a simple `glUseProgram`, with fixed pipeline a gazillion of `glEnable` and `glDisable` calls, setting at least projection and modelview, setting up a dozen of glTexEnvi calls to get the texture right, etc. – datenwolf Dec 24 '12 at 10:14
  • It will be better in the end but it's going to suck converting my whole library. – SteveDeFacto Dec 24 '12 at 10:53
  • @SteveDeFacto A bit of a chore to convert old stuff, but worth the effort. I did got rid of all fixed pipeline stuff recently dropping compatibility mode completely. I would say that just made things a lot cleaner and simpler. Not to mention a pretty nice performance boost. – Grimmy Dec 27 '12 at 09:17
  • @Grimmy Actually, I've been trying to get it to work and no matter what I do it won't. I believe it is CG that is causing it but I can't not use CG... Maybe you will know what I did wrong? http://stackoverflow.com/questions/14038001/why-wont-cg-shaders-work-with-gl-3-2 – SteveDeFacto Dec 27 '12 at 10:45
  • What do you mean? I did post another question with code. I linked it above^ – SteveDeFacto Dec 27 '12 at 12:54