Results 1 to 6 of 6

Thread: Display list question

  1. #1
    Member Newbie
    Join Date
    Jul 2009
    Posts
    33

    Display list question

    I have a display list that is initiated in the init() method.
    The method that the display list calls need two parameters but I get the values to these parameters after the init() method has initiated the display list.

    Is is possible to change the values later or is the only way around this to create the display list outside the init() method?

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: Display list question

    create the display list outside the init()

  3. #3
    Member Newbie
    Join Date
    Jul 2009
    Posts
    33

    Re: Display list question

    Ok, but if put the below lines of code in a listener method that is called each time the user press a button, the list is redeclared.
    Maybe it doesn´t matter? Or do I loose the advantages of display lists if I redeclare it over and over again?
    Code :
    // Init display lists
    quad = gl.glGenLists(1);
    gl.glNewList(quad, GL.GL_COMPILE);
       drawQuads(gl);
    gl.glEndList();

  4. #4
    Member Newbie
    Join Date
    Mar 2011
    Posts
    41

    Re: Display list question

    Only recompile if parameters changed then.

  5. #5
    Member Newbie
    Join Date
    Jul 2009
    Posts
    33

    Re: Display list question

    How do I recompile?

    The only way of recompiling I know is actually to redeclare the whole display list. Or is there any other way of doing this?
    Code :
    quad = gl.glGenLists(1);
    gl.glNewList(quad, GL.GL_COMPILE);
       drawQuads(gl);
    gl.glEndList();

  6. #6
    Senior Member Frequent Contributor scratt's Avatar
    Join Date
    May 2008
    Location
    Thailand
    Posts
    555

    Re: Display list question

    Apart from the fact that display lists are deprecated, although I am sure Mark Killgard will drop from the sky in a minute clutching a flaming pitchfork and try to tell you otherwise, there are far better ways to do what you are doing.

    The thing is you are getting to the point where you need to use other methods so why stick yourself with the extra problem of having to conditionally reconstruct Display Lists, and keep using a subset of OpenGL which is potentially not portable in the future?

    Having said that, you can do this.. GL_COMPILE_AND_EXECUTE, or GL_COMPILE or just GL_EXECUTE on a display list..

    So why not in your main loop check to see if the display list needs to be refactord and if so call the code to init it *but* init the display list with COMPILE_AND_EXECUTE.

    Otherwise just use the existing display list with GL_EXECUTE.

    i.e:
    Code :
    if(display list is no longer valid) initWithCompileAndExecute()
    else gl.glCallList(n);

Similar Threads

  1. Display list question
    By Lindley in forum OpenGL: Advanced Coding
    Replies: 11
    Last Post: 06-02-2010, 02:12 AM
  2. Display List question
    By FrimaMichael in forum OpenGL: Basic Coding
    Replies: 12
    Last Post: 04-19-2010, 06:15 PM
  3. Display list question
    By darkrappey in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-20-2007, 03:44 PM
  4. display list question
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-13-2005, 10:29 AM
  5. Display list question
    By mdog1234 in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 01-14-2003, 02:05 PM

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