00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
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
00034
00035
00036
00037
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