00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef WGLGRAPHICSPIPE_H
00016 #define WGLGRAPHICSPIPE_H
00017
00018 #include "pandabase.h"
00019 #include "winGraphicsPipe.h"
00020
00021 class wglGraphicsStateGuardian;
00022
00023
00024
00025
00026
00027
00028
00029 class EXPCL_PANDAGL wglGraphicsPipe : public WinGraphicsPipe {
00030 public:
00031 wglGraphicsPipe();
00032 virtual ~wglGraphicsPipe();
00033
00034 virtual string get_interface_name() const;
00035 static PT(GraphicsPipe) pipe_constructor();
00036
00037 protected:
00038 virtual PT(GraphicsOutput) make_output(const string &name,
00039 const FrameBufferProperties &fb_prop,
00040 const WindowProperties &win_prop,
00041 int flags,
00042 GraphicsEngine *engine,
00043 GraphicsStateGuardian *gsg,
00044 GraphicsOutput *host,
00045 int retry,
00046 bool &precertify);
00047 virtual PT(GraphicsStateGuardian) make_callback_gsg(GraphicsEngine *engine);
00048
00049 private:
00050
00051 static string format_pfd_flags(DWORD pfd_flags);
00052 static void wgl_make_current(HDC hdc, HGLRC hglrc, PStatCollector *collector);
00053
00054 static bool _current_valid;
00055 static HDC _current_hdc;
00056 static HGLRC _current_hglrc;
00057
00058 public:
00059 static TypeHandle get_class_type() {
00060 return _type_handle;
00061 }
00062 static void init_type() {
00063 WinGraphicsPipe::init_type();
00064 register_type(_type_handle, "wglGraphicsPipe",
00065 WinGraphicsPipe::get_class_type());
00066 }
00067 virtual TypeHandle get_type() const {
00068 return get_class_type();
00069 }
00070 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00071
00072 private:
00073 static TypeHandle _type_handle;
00074
00075 friend class wglGraphicsBuffer;
00076 friend class wglGraphicsWindow;
00077 friend class wglGraphicsStateGuardian;
00078 };
00079
00080 #include "wglGraphicsPipe.I"
00081
00082 #endif