From: Jason M. <ko...@gm...> - 2008-08-24 03:00:30
|
Stefanos A. wrote: > If I understand correctly, what we actually need is a way to generate > geometry for the tutorials. Which means we just need the > vertex/texcoord/normal/element arrays. > > While it's good to have functions that *generate* this data, is it really > a good idea to hide the *drawing* part behind a glsDrawShape function? > Maybe it would be better to simply return these four arrays and handle the > drawing inside the tutorial? > > Just trying to understand the focus of the shape functions. What do you > say? > Well, the problem with any form of generation of that type is this: where are you going to put it? You can't put it into a user-supplied buffer object because it might be too big (and having a query for the size makes creating them very complex). And if you have it create the buffer, how do you communicate the data format to the user? Basically, we want these things to be as simple as possible for the user to use. This isn't production code, so flexibility is not a concern. We want them to be able to go: //initialize GL/create window. GLSshape myBox = glsCreateShapeBox(params); while(true) { //setup context. glsShapeDraw(myBox); } glsDestroyShape(param); The goal being that you can't make that fail. The user can't do something wrong. And it's immediately obvious how it works. |