/[gzz]/gzz/gzz/client/GraphicsAPI.java
ViewVC logotype

Diff of /gzz/gzz/client/GraphicsAPI.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.20 by benja, Thu Sep 26 11:54:07 2002 UTC revision 1.21 by benja, Sat Oct 5 13:59:47 2002 UTC
# Line 42  public abstract class GraphicsAPI { Line 42  public abstract class GraphicsAPI {
42      /** The singleton instance.      /** The singleton instance.
43       */       */
44      private static GraphicsAPI gfxapi;      private static GraphicsAPI gfxapi;
45        private static String type;
46    
47      static {      static {
48          String cl = System.getProperty("gzzclient");          String cl = System.getProperty("gzzclient");
49          if(cl == null || cl.equals("awt"))          if(cl == null || cl.equals("awt")) {
50              gfxapi = new gzz.client.awt.AWTAPI();              gfxapi = new gzz.client.awt.AWTAPI();
51          else if(cl.equals("gl"))              type = "awt";
52            } else if(cl.equals("gl")) {
53              gfxapi = new gzz.client.gl.GLAPI();              gfxapi = new gzz.client.gl.GLAPI();
54          else              type = "gl";
55            } else
56              throw new Error("Invalid client type '"+cl+"': should be awt or gl");              throw new Error("Invalid client type '"+cl+"': should be awt or gl");
57      }      }
58    
59      /** Get the singleton instance.      /** Get the singleton instance.
60       */       */
61      static public GraphicsAPI getInstance() { return gfxapi; }      static public GraphicsAPI getInstance() { return gfxapi; }
62        
63        /** Return the type string of the API ("gl" or "awt").
64         */
65        static public String getTypeString() { return type; }
66    
67      /** Start the update manager thread and run r from that thread.      /** Start the update manager thread and run r from that thread.
68       * Used because e.g. OpenGL and GLX are easier to manage if everything       * Used because e.g. OpenGL and GLX are easier to manage if everything

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26