Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/display/graphicsPipeSelection.h

Go to the documentation of this file.
00001 // Filename: graphicsPipeSelection.h
00002 // Created by:  drose (15Aug02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef GRAPHICSPIPESELECTION_H
00020 #define GRAPHICSPIPESELECTION_H
00021 
00022 #include "pandabase.h"
00023 
00024 #include "graphicsPipe.h"
00025 #include "pointerTo.h"
00026 #include "typeHandle.h"
00027 #include "pmutex.h"
00028 
00029 class HardwareChannel;
00030 class GraphicsWindow;
00031 
00032 ////////////////////////////////////////////////////////////////////
00033 //       Class : GraphicsPipeSelection
00034 // Description : This maintains a list of GraphicsPipes by type that
00035 //               are available for creation.  Normally there is one
00036 //               default interactive GraphicsPipe, and possibly other
00037 //               types available as well.
00038 ////////////////////////////////////////////////////////////////////
00039 class EXPCL_PANDA GraphicsPipeSelection {
00040 protected:
00041   GraphicsPipeSelection();
00042   ~GraphicsPipeSelection();
00043 
00044 PUBLISHED:
00045   int get_num_pipe_types() const;
00046   TypeHandle get_pipe_type(int n) const;
00047   void print_pipe_types() const;
00048 
00049   PT(GraphicsPipe) make_pipe(TypeHandle type);
00050   PT(GraphicsPipe) make_default_pipe();
00051 
00052   INLINE int get_num_aux_modules() const;
00053   void load_aux_modules();
00054 
00055   INLINE static GraphicsPipeSelection *get_global_ptr();
00056 
00057 public:
00058   typedef PT(GraphicsPipe) PipeConstructorFunc();
00059   bool add_pipe_type(TypeHandle type, PipeConstructorFunc *func);
00060 
00061 private:
00062   INLINE void load_default_module() const;
00063   void do_load_default_module();
00064   void load_named_module(const string &name);
00065 
00066   class PipeType {
00067   public:
00068     INLINE PipeType(TypeHandle type, PipeConstructorFunc *constructor);
00069     TypeHandle _type;
00070     PipeConstructorFunc *_constructor;
00071   };
00072   typedef pvector<PipeType> PipeTypes;
00073   PipeTypes _pipe_types;
00074   Mutex _lock;
00075 
00076   typedef pset<string> DisplayModules;
00077   DisplayModules _display_modules;
00078   string _default_display_module;
00079   string _default_pipe_name;
00080   bool _default_module_loaded;
00081 
00082   static GraphicsPipeSelection *_global_ptr;
00083 };  
00084 
00085 #include "graphicsPipeSelection.I"
00086 
00087 #endif
00088 

Generated on Fri May 2 00:36:29 2003 for Panda by doxygen1.3