Results 1 to 10 of 10

Thread: problem with mass-masking

  1. #1
    Senior Member Regular Contributor
    Join Date
    Dec 2002
    Posts
    156

    problem with mass-masking

    gl.glGenLists(3);

    gl.glNewList(displayList[0], GL_COMPILE);
    GLDraw.executeStrips(testMe);
    gl.glEndList();

    gl.glNewList(displayList[1], GL_COMPILE);
    wald.drawForestTrees(gl,glu,null,texture,treeTex);
    gl.glEndList();

    gl.glNewList(displayList[2], GL_COMPILE);
    wald.drawForest2DObjects(gl,glu,null,texture,treeT ex);
    gl.glEndList();

    i'm trying to create 3 display lists, but the last one i compile is saved in displaylist[0]...
    go vegan

  2. #2
    Senior Member Regular Contributor
    Join Date
    Dec 2002
    Posts
    156

    Re: problem with mass-masking

    sorry, wrong topic name...
    go vegan

  3. #3
    Super Moderator OpenGL Guru imported_dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    3,966

    Re: problem with mass-masking

    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[0] = gl.glGenLists(3);
    displayList[1] = displayList[0]+1;
    displayList[2] = displayList[1]+1;

    That should fix your code but it might be better to use something like

    display_base = gl.glGenLists(3);

    glCallList(display_base+n);

    and dispense with the array.

    C++ wrappers like the OpenGL wrapper you are using are the worst application of C++. Completely useless IMHO.

  4. #4
    Senior Member Regular Contributor
    Join Date
    Dec 2002
    Posts
    156

    Re: problem with mass-masking

    i'm using java+gl4java, so it's not useless for me
    go vegan

  5. #5
    Super Moderator OpenGL Guru imported_dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    3,966

    Re: problem with mass-masking

    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.

  6. #6
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: problem with mass-masking

    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.
    Deiussum
    Software Engineer and OpenGL enthusiast

  7. #7
    Super Moderator OpenGL Guru imported_dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    3,966

    Re: problem with mass-masking

    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.

  8. #8
    Senior Member Regular Contributor
    Join Date
    Dec 2002
    Posts
    156

    Re: problem with mass-masking

    some other display-list-questions :
    - are quads converted into small triangle-strips ?
    - are displaylists stored in the graphic cards ram ?
    go vegan

  9. #9
    Senior Member Regular Contributor
    Join Date
    Dec 2002
    Posts
    156

    Re: problem with mass-masking

    is there a limit for display lists ? (maximum number of lists or maximum number of commands)
    go vegan

  10. #10
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: problem with mass-masking

    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.
    Deiussum
    Software Engineer and OpenGL enthusiast

Similar Threads

  1. Masking problem
    By thefunnyfish in forum OpenVG
    Replies: 4
    Last Post: 11-02-2010, 07:13 PM
  2. problem with masking
    By _patrice_ in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 11-23-2009, 06:30 AM
  3. Texture masking problem
    By in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 11-14-2005, 03:30 PM
  4. problem with mass-masking
    By HamsterofDeath in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 12-27-2002, 01:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean