1 package com.insanityengine.ghia.renderer;
2
3 import com.insanityengine.ghia.libograf.*;
4
5 import java.util.*;
6
7 /***
8 *
9 * <P>
10 * </P>
11 *
12 * @author BrianHammond
13 *
14 * $Header: /usr/local/cvsroot/ghia/src/java/com/insanityengine/ghia/renderer/DrawerRegistry.java,v 1.2 2005/03/19 17:50:02 brian Exp $
15 *
16 */
17
18 public class DrawerRegistry implements DrawerRegistryInterface {
19
20 public DrawerRegistry() {}
21
22 /***
23 *
24 * Some renderers are big babys about when it is ok to mess with their goodies.
25 * Hence this cheesy add/remove Drawer mess
26 *
27 * @param drawer to call per frame
28 *
29 */
30 public void addDrawer( DrawingInterface drawer ) {
31 drawers.put( drawer, drawer );
32 }
33
34 /***
35 *
36 * Some renderers are big babys about when it is ok to mess with their goodies.
37 * Hence this cheesy add/remove Drawer mess
38 *
39 * @param drawer to call per frame
40 *
41 */
42 public void removeDrawer( DrawingInterface drawer ) {
43 drawers.remove( drawer );
44 }
45
46 /***
47 *
48 * Invoke any registered DrawingInterfaces
49 *
50 */
51 public void invokeDrawers( LiboGraf gl ) {
52 for ( Enumeration e = drawers.elements() ; e.hasMoreElements() ; ) {
53 ( ( DrawingInterface ) e.nextElement() ).draw( gl );
54 }
55 }
56
57
58
59 private Hashtable drawers = new Hashtable();
60 };
61
62 /***
63 *
64 * $Log: DrawerRegistry.java,v $
65 * Revision 1.2 2005/03/19 17:50:02 brian
66 * repackaging
67 *
68 * Revision 1.1 2004/09/05 03:39:58 brian
69 * track those drawingIfz
70 *
71 *
72 */