Hi Andreas,

2008/2/18 Kremser, Andreas (Praktikant) <[EMAIL PROTECTED]>:
> we are going to replace every occurance of glBegin and glEnd with vertex
> arrays due to the following reasons:
>
> 1. not supported on opengl es & opengl 3
> 2. bad performance
>
> or are there any objections to it?

For OpenGL ES and OpenGL 3.x you will certainly need to drop all the
glBegin and glEnd paths.  Rather than replace I'd suggest #ifdef out
all the glBegin()/glEnd() parts and see how you get on.  Most OSG
plugins create scene graphs that won't use the glBegin()/glEnd()
pathways so you should be able to get quite a long way without need of
glBegin/glEnd them.

One thing I have been considering for quite some while is to move the
code in src/osg/Geometry.cpp that requires glBegin/glEnd out into a
separate GeometryWithIndices class.  Its the vertex inidices which
causes the fallback to glBegin/End so the
setVertexIndices/setColorIndices etc will all have to go with it.
This will simplify the osg::Geometry class, and offer my cleaner
forwards compatibility, but will break backwards compatibility with
codes that currently use vertex indices.  Its more efficient OpenGL
wise to use DrawElements anyway so adding this extra hurdle is not
something deem a wholly bad thing - right now its too easy to see a
feature an make use of it because its convenient, without realising
its inefficient at rendering.

Robert.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to