so whats in opengl version 3?

Started by
8 comments, last by swiftcoder 14 years, 9 months ago
version 2 was the shaders and FBOs etc so whats in version 3 ? cheers
Advertisement
How do you mean this?

Just check the specs?!
OpenGL 2.x doesn't have FBOs, 3.0 included them.

You can see a small summary of new features in: http://en.wikipedia.org/wiki/OpenGL#OpenGL_3.0

However, in GL 3.0, what's new is not so important, but more important is what is deprecated and later removed in 3.1.
well the specs were as clear as mud. They seem to suggest that
glbegin, glEnd have been deprecated as has many of the functions needed to do vertex arrays. I also read that the entire fixed functionality has been removed as well. Has anyone got some simple code they can show to highliught the differences before and after 3.1.
Apparently the simple code below can't be done in 3.1 as most of the calls are deprecated - just draws a green square. So how would you draw a green square using 3.1 ?

glClear( GL_COLOR_BUFFER_BIT );This statement clears the color buffer, so that the screen will start blank. glMatrixMode( GL_PROJECTION );      /* Subsequent matrix commands will affect the projection matrix */glLoadIdentity();                   /* Initialise the projection matrix to identity */glFrustum( -1, 1, -1, 1, 1, 1000 ); /* Apply a perspective-projection matrix */glMatrixMode( GL_MODELVIEW );       /* Subsequent matrix commands will affect the modelview matrix */glLoadIdentity();                   /* Initialise the modelview to identity */glTranslatef( 0, 0, -3 );           /* Translate the modelview 3 units along the Z axis */glBegin( GL_POLYGON );              /* Begin issuing a polygon */glColor3f( 0, 1, 0 );               /* Set the current color to green */glVertex3f( -1, -1, 0 );            /* Issue a vertex */glVertex3f( -1, 1, 0 );             /* Issue a vertex */glVertex3f( 1, 1, 0 );              /* Issue a vertex */glVertex3f( 1, -1, 0 );             /* Issue a vertex */glEnd();               

What about vbo. I have never used immediate mode drawing.
If you did d3d before, you would have thought that there is something like imm-mode...

Alex

P.S. Stop using immediate-mode now! Use vbos for drawing!
Basically, you need to setup everything yourself now using vertex buffers and shaders. For simple programs like that, to draw a square, is much more troublesome than before (assuming you have't set up some framework to handle it already), but OpenGL is not aimed to make test cases simple. It's aimed to make a performant API for heavier cases than a single square.
OpenGL 3.0 is fully backwards compatible, and will run any program written for OpenGL 2.x, or even 1.x.

If you allocate a 'forward-compatible' context, then all the obsolete cruft is disabled, including:
  • Immediate mode: Move to glDrawElements() and glDrawArrays()
  • Vertex arrays: Move to VBO
  • Fixed-function: Move to Shaders
  • Matrix stacks: Manage your own matrices (i.e. with CML) and upload them as shader uniforms
  • Named vertex attributes: use generic shader attributes

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

feck !!! I need a course ! Seems way too hard for me now !
Quote:Original post by ade-the-heat
feck !!! I need a course ! Seems way too hard for me now !
It is worth remembering that there is no pressing need to move to a forward-compatible context, backwards-compatible will be around for the foreseeable future.

On the other hand, all the deprecated stuff has actually been deprecated for a *very* long time, and you do need to learn VBO, shaders, etc. if you plan to pursue a career/serious hobby in this direction [smile]

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

This topic is closed to new replies.

Advertisement