From: <aco...@mi...> - 2003-05-12 12:47:00
|
>Hmm I hadn't thought about the prefix stuff yet. Good point. >You could call your object 'gl' which gives you gl.ProgramEnv... :) >The only way I know to dynamically get all these methods into one object >is to use Proxy, but I don't think this would be very efficient. >So, so far we have: >+ Small memory saving >+ No noop methods >+ Flexible extensibility >- Prefixes before methods If you have 3 extensions, you can't instantiate the 3 classes under the same name "gl" if this what you mean. So it remains a problem. Alban Cousini=E9 wrote: > Hi Pepijn, >=20 > This mechanism is interesting as it is allowing to save memory while > avaoiding loading the extensions not needed. The only thing that annoys > me is the fact that we would have to prefix every call to a > vertexProgram function by the variable name "vertProg.", so in your > sample, we'd have code like : > vertProg.ProgramEnvParameter4dvARB(args); > On the other hand, the memory saved (a few Kilobytes) is not very > interesting on personal computer context. On a PDA or a global phone, > the gain would be much more interesting. >=20 > If we are using, say, 8 different extensions, we'd have to keep in mind > every prefix, which is not easing the programming task. The current > mechanism is more ergonomic because you always prefix your function > calls by "gl" and nothing else, thus you don't have to remember these > extensions class names. >=20 > Ideally, removing any prefix would be the best solution as it would > allow easier porting from c++ OpenGL code (that has no prefix) to > gl4java code, but I don't think this is possible with Java, as a class > cannot be declared static (except if it is an inner class : see article > http://www.javaworld.com/javaworld/javaqa/1999-08/01-qa-static2.html) >=20 > Anyone have any idea if this could possibly be achieved? >=20 > Alban |