View Javadoc

1   /*
2    * To change this template, choose Tools | Templates
3    * and open the template in the editor.
4    */
5   
6   package nl.tudelft.goal.ut2004.visualizer.timeline.map;
7   
8   import javax.media.opengl.GL;
9   import javax.media.opengl.GLEventListener;
10  
11  
12  
13  /**
14   * This is a subrenderer, it's job is to render some stuff.
15   * Basically I had few {@link GLEventListener}s and there were troubles
16   * with using them directly (order of rendering), so I have now only these
17   * subrenderes that are part of {@link CollectionRenderer}.
18   *
19   * @param <T> Class of object this renderer draws.
20   * @author Honza
21   */
22  public interface ISubGLRenderer<T> {
23      /**
24       * Here should be done preparation for rendering (e.g. generation of display
25       * lists from massive data)
26       * @param gl
27       */
28      public void prepare(GL gl);
29  
30      /**
31       * Display stuff you want to. Assume that settings have already been set in
32       * {@link CollectionRenderer}
33       * @param gl
34       */
35      public void render(GL gl);
36  
37      /**
38       * Return object this renderer draws.
39       *
40       * Because objects we want to draw can change rapidly, we have to remove and
41       * add subrenderers based on passed objects (renderer R draws object A, now
42       * we don't want to draw A anymore, we have to go through subrenderers to find
43       * which ones draws it).
44       * @return Object this renderer draws.
45       */
46      public T getObject();
47  
48      
49      public int getGLName();
50  
51      /**
52       * Call renderer to clean up any resources it used.
53       */
54  	public void destroy();
55  
56  }