From cec554627eff1438c78b7a8e5f47c04bb281b034 Mon Sep 17 00:00:00 2001 From: David Rose Date: Sat, 11 Jan 2003 16:48:46 +0000 Subject: [PATCH] tweaks to pipe interface --- panda/src/dxgsg7/wdxGraphicsPipe7.cxx | 15 +++++++++++++++ panda/src/dxgsg7/wdxGraphicsPipe7.h | 1 + panda/src/dxgsg8/wdxGraphicsPipe8.cxx | 15 +++++++++++++++ panda/src/dxgsg8/wdxGraphicsPipe8.h | 2 +- panda/src/framework/pandaFramework.cxx | 17 +++-------------- panda/src/glxdisplay/glxGraphicsPipe.cxx | 15 +++++++++++++++ panda/src/glxdisplay/glxGraphicsPipe.h | 1 + panda/src/wgldisplay/wglGraphicsPipe.cxx | 15 +++++++++++++++ panda/src/wgldisplay/wglGraphicsPipe.h | 1 + 9 files changed, 67 insertions(+), 15 deletions(-) diff --git a/panda/src/dxgsg7/wdxGraphicsPipe7.cxx b/panda/src/dxgsg7/wdxGraphicsPipe7.cxx index 13b560a8b6..58fd1a82e3 100644 --- a/panda/src/dxgsg7/wdxGraphicsPipe7.cxx +++ b/panda/src/dxgsg7/wdxGraphicsPipe7.cxx @@ -40,6 +40,21 @@ wdxGraphicsPipe7:: ~wdxGraphicsPipe7() { } +//////////////////////////////////////////////////////////////////// +// Function: wdxGraphicsPipe7::get_interface_name +// Access: Published, Virtual +// Description: Returns the name of the rendering interface +// associated with this GraphicsPipe. This is used to +// present to the user to allow him/her to choose +// between several possible GraphicsPipes available on a +// particular platform, so the name should be meaningful +// and unique for a given platform. +//////////////////////////////////////////////////////////////////// +string wdxGraphicsPipe7:: +get_interface_name() const { + return "DirectX7"; +} + //////////////////////////////////////////////////////////////////// // Function: wdxGraphicsPipe7::pipe_constructor // Access: Public, Static diff --git a/panda/src/dxgsg7/wdxGraphicsPipe7.h b/panda/src/dxgsg7/wdxGraphicsPipe7.h index 26e8e93e6c..b404aeb7fc 100644 --- a/panda/src/dxgsg7/wdxGraphicsPipe7.h +++ b/panda/src/dxgsg7/wdxGraphicsPipe7.h @@ -32,6 +32,7 @@ public: wdxGraphicsPipe7(); virtual ~wdxGraphicsPipe7(); + virtual string get_interface_name() const; static PT(GraphicsPipe) pipe_constructor(); protected: diff --git a/panda/src/dxgsg8/wdxGraphicsPipe8.cxx b/panda/src/dxgsg8/wdxGraphicsPipe8.cxx index 01d5ab201a..a151db10b3 100644 --- a/panda/src/dxgsg8/wdxGraphicsPipe8.cxx +++ b/panda/src/dxgsg8/wdxGraphicsPipe8.cxx @@ -58,6 +58,21 @@ wdxGraphicsPipe8:: } } +//////////////////////////////////////////////////////////////////// +// Function: wdxGraphicsPipe8::get_interface_name +// Access: Published, Virtual +// Description: Returns the name of the rendering interface +// associated with this GraphicsPipe. This is used to +// present to the user to allow him/her to choose +// between several possible GraphicsPipes available on a +// particular platform, so the name should be meaningful +// and unique for a given platform. +//////////////////////////////////////////////////////////////////// +string wdxGraphicsPipe8:: +get_interface_name() const { + return "DirectX7"; +} + //////////////////////////////////////////////////////////////////// // Function: wdxGraphicsPipe8::pipe_constructor // Access: Public, Static diff --git a/panda/src/dxgsg8/wdxGraphicsPipe8.h b/panda/src/dxgsg8/wdxGraphicsPipe8.h index fffe66e652..3ff301baa8 100644 --- a/panda/src/dxgsg8/wdxGraphicsPipe8.h +++ b/panda/src/dxgsg8/wdxGraphicsPipe8.h @@ -45,6 +45,7 @@ public: wdxGraphicsPipe8(); virtual ~wdxGraphicsPipe8(); + virtual string get_interface_name() const; static PT(GraphicsPipe) pipe_constructor(); protected: @@ -61,7 +62,6 @@ private: private: HINSTANCE _hDDrawDLL; HINSTANCE _hD3D8_DLL; - bool _is_valid; typedef LPDIRECT3D8 (WINAPI *Direct3DCreate8_ProcPtr)(UINT SDKVersion); typedef HRESULT (WINAPI * LPDIRECTDRAWCREATEEX)(GUID FAR * lpGuid, LPVOID *lplpDD, REFIID iid, IUnknown FAR *pUnkOuter); diff --git a/panda/src/framework/pandaFramework.cxx b/panda/src/framework/pandaFramework.cxx index 5669b0a0ca..dd73542997 100644 --- a/panda/src/framework/pandaFramework.cxx +++ b/panda/src/framework/pandaFramework.cxx @@ -544,26 +544,15 @@ make_window_framework() { //////////////////////////////////////////////////////////////////// void PandaFramework:: make_default_pipe() { - // We use the GraphicsPipe factory to make us a renderable pipe - // without knowing exactly what kind of pipes we have available. We - // don't care, so long as we can render to it interactively. - // This depends on the shared library or libraries (DLL's to you // Windows folks) that have been loaded in at runtime from the - // load-display Configrc variable. + // load-display and/or aux-display Configrc variables. GraphicsPipeSelection *selection = GraphicsPipeSelection::get_global_ptr(); - selection->resolve_modules(); - - nout << "Known pipe types:" << endl; - int num_pipe_types = selection->get_num_pipe_types(); - for (int i = 0; i < num_pipe_types; i++) { - nout << " " << selection->get_pipe_type(i) << "\n"; - } - + selection->print_pipe_types(); _default_pipe = selection->make_default_pipe(); if (_default_pipe == (GraphicsPipe*)NULL) { - nout << "No interactive pipe is available! Check your Configrc!\n"; + nout << "No graphics pipe is available! Check your Configrc!\n"; } } diff --git a/panda/src/glxdisplay/glxGraphicsPipe.cxx b/panda/src/glxdisplay/glxGraphicsPipe.cxx index 888dab11f4..1e029490bf 100644 --- a/panda/src/glxdisplay/glxGraphicsPipe.cxx +++ b/panda/src/glxdisplay/glxGraphicsPipe.cxx @@ -81,6 +81,21 @@ glxGraphicsPipe:: } } +//////////////////////////////////////////////////////////////////// +// Function: glxGraphicsPipe::get_interface_name +// Access: Published, Virtual +// Description: Returns the name of the rendering interface +// associated with this GraphicsPipe. This is used to +// present to the user to allow him/her to choose +// between several possible GraphicsPipes available on a +// particular platform, so the name should be meaningful +// and unique for a given platform. +//////////////////////////////////////////////////////////////////// +string glxGraphicsPipe:: +get_interface_name() const { + return "OpenGL"; +} + //////////////////////////////////////////////////////////////////// // Function: glxGraphicsPipe::pipe_constructor // Access: Public, Static diff --git a/panda/src/glxdisplay/glxGraphicsPipe.h b/panda/src/glxdisplay/glxGraphicsPipe.h index f0cb804cce..3c7f385deb 100644 --- a/panda/src/glxdisplay/glxGraphicsPipe.h +++ b/panda/src/glxdisplay/glxGraphicsPipe.h @@ -43,6 +43,7 @@ public: glxGraphicsPipe(const string &display = string()); virtual ~glxGraphicsPipe(); + virtual string get_interface_name() const; static PT(GraphicsPipe) pipe_constructor(); INLINE Display *get_display() const; diff --git a/panda/src/wgldisplay/wglGraphicsPipe.cxx b/panda/src/wgldisplay/wglGraphicsPipe.cxx index 6e4d829848..504f4734e9 100644 --- a/panda/src/wgldisplay/wglGraphicsPipe.cxx +++ b/panda/src/wgldisplay/wglGraphicsPipe.cxx @@ -39,6 +39,21 @@ wglGraphicsPipe:: ~wglGraphicsPipe() { } +//////////////////////////////////////////////////////////////////// +// Function: wglGraphicsPipe::get_interface_name +// Access: Published, Virtual +// Description: Returns the name of the rendering interface +// associated with this GraphicsPipe. This is used to +// present to the user to allow him/her to choose +// between several possible GraphicsPipes available on a +// particular platform, so the name should be meaningful +// and unique for a given platform. +//////////////////////////////////////////////////////////////////// +string wglGraphicsPipe:: +get_interface_name() const { + return "OpenGL"; +} + //////////////////////////////////////////////////////////////////// // Function: wglGraphicsPipe::pipe_constructor // Access: Public, Static diff --git a/panda/src/wgldisplay/wglGraphicsPipe.h b/panda/src/wgldisplay/wglGraphicsPipe.h index 379299e805..5b7a9c9279 100644 --- a/panda/src/wgldisplay/wglGraphicsPipe.h +++ b/panda/src/wgldisplay/wglGraphicsPipe.h @@ -33,6 +33,7 @@ public: wglGraphicsPipe(); virtual ~wglGraphicsPipe(); + virtual string get_interface_name() const; static PT(GraphicsPipe) pipe_constructor(); protected: