View Full Version : problem with mass-masking
12-26-2002, 12:53 PM
i'm trying to create 3 display lists, but the last one i compile is saved in displaylist...
12-26-2002, 12:54 PM
sorry, wrong topic name...
12-26-2002, 01:18 PM
If it's like OpenGL C code then genlists returns the first integer handle in a contiguous list.
So you need to take the return value and assign it to element zero of your display list array, then increment it and apply in to the second element then increment it and apply it to the third etc. As you can see you don't really need an array.
displayList = gl.glGenLists(3);
displayList = displayList+1;
displayList = displayList+1;
That should fix your code but it might be better to use something like
display_base = gl.glGenLists(3);
and dispense with the array.
C++ wrappers like the OpenGL wrapper you are using are the worst application of C++. Completely useless IMHO.
12-27-2002, 02:45 AM
i'm using java+gl4java, so it's not useless for me
12-28-2002, 02:01 PM
Ah I see I assumed it was C++, it looks the same in this case. I'd preffer a C style of wrapper but each to their own.
12-29-2002, 02:49 PM
Dorbie's response still brings up a good point. How is glGenLists filing the values in your displayList array?
I'm not familiar with gl4Java so maybe there's someplace else where you tell it what array to fill, but from the code you gave, it appears that they have no association.
12-29-2002, 03:40 PM
Yes it sure looks that way. I assume the wrapper is doing exactly what the C call does and the solution is as I have suggested. The whole notion of using an array when the name allocator gives you the base name in a contiguous list seems redundant as I pointed out.
12-30-2002, 08:05 AM
some other display-list-questions :
- are quads converted into small triangle-strips ?
- are displaylists stored in the graphic cards ram ?
12-31-2002, 01:29 AM
is there a limit for display lists ? (maximum number of lists or maximum number of commands)
12-31-2002, 04:35 AM
No, quads aren't converted to triangle strips unless the driver does some sort of optimization underneath. You need to be sure that all the vertices of your quad are coplanar, otherwise the results are undefined.
Display lists can be stored in the graphics memory, but again, it's all a decision up to where the driver decides to put them.
There is no real limits to the number of commands that can be put into a display list. I believe that if you start putting too much in them, it will slow things down, though.
The only limit on the number of lists you can have is the max value of GLuint, which is pretty large. Again, in practice it may start slowing down if you get too many as there would be less chance to get stored in graphics memory.
Regarding your problem, you still haven't told us HOW the values for your displayList array are getting set. I'm guessing your problem is stemming from not correctly setting those values.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.