From: Steve B. <st...@sj...> - 2008-10-29 23:13:43
|
Sven Panne wrote: > As one can see, the required changes to freeglut are minimal: Give the user a > way to specify the major/minor version of the OpenGL context wanted, plus the > ability to specify a forward compatible/debug variant of it. Sadly - that's nowhere near enough. If the user were to use your new API to select a GL context that's "3.1"-ish then a whole bunch of functionality disappears (and rightly so, IMHO). This includes (to pick a REALLY obvious example) "glBegin()...glEnd()". That alone requires at least 70 source changes to freeglut. (Mostly in freeglut_geometry.c - but also in freeglut_menu.c, freeglut_font.c and freeglut_teapot.c). That's a very simple example - but there is much worse to come. The basic idea of "post 2.x" OpenGL is that the fixed function pipeline is going to disappear. That means that (for example) we need to implement a shader to render the text in the glut font stuff...several shaders in fact because we offer a choice between textured fonts and stroked fonts. glutDrawTeapot uses all sorts of weird glMap2d and glEvalMesh2d stuff for bezier patch skinning (I've been using OpenGL since the very first SGI implementation - and I've never seen those calls used anywhere other than here!) That functionality is probably going away - so a total rewrite is called for. Ideally - we should be using the new shader types that allow you to skin patches using the GPU - but hardly any graphics cards support that yet - so we may need to write our own patch skinning code in the CPU - in such a way that we can migrate it over to the GPU once the majority of the world has that kind of GPU hardware. We could maybe steal the implementation of glMap2d and glEvalMesh2d from Mesa's implementation...but still it's not gonna be simple. That's only the stuff we'd be FORCED to change...we would also need to consider revamping all of our demo programs to use 3.x technology. -- Steve |