tweaks to pipe interface

This commit is contained in:
David Rose 2003-01-11 16:48:46 +00:00
parent 62cebed480
commit cec554627e
9 changed files with 67 additions and 15 deletions

View File

@ -40,6 +40,21 @@ wdxGraphicsPipe7::
~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 // Function: wdxGraphicsPipe7::pipe_constructor
// Access: Public, Static // Access: Public, Static

View File

@ -32,6 +32,7 @@ public:
wdxGraphicsPipe7(); wdxGraphicsPipe7();
virtual ~wdxGraphicsPipe7(); virtual ~wdxGraphicsPipe7();
virtual string get_interface_name() const;
static PT(GraphicsPipe) pipe_constructor(); static PT(GraphicsPipe) pipe_constructor();
protected: protected:

View File

@ -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 // Function: wdxGraphicsPipe8::pipe_constructor
// Access: Public, Static // Access: Public, Static

View File

@ -45,6 +45,7 @@ public:
wdxGraphicsPipe8(); wdxGraphicsPipe8();
virtual ~wdxGraphicsPipe8(); virtual ~wdxGraphicsPipe8();
virtual string get_interface_name() const;
static PT(GraphicsPipe) pipe_constructor(); static PT(GraphicsPipe) pipe_constructor();
protected: protected:
@ -61,7 +62,6 @@ private:
private: private:
HINSTANCE _hDDrawDLL; HINSTANCE _hDDrawDLL;
HINSTANCE _hD3D8_DLL; HINSTANCE _hD3D8_DLL;
bool _is_valid;
typedef LPDIRECT3D8 (WINAPI *Direct3DCreate8_ProcPtr)(UINT SDKVersion); typedef LPDIRECT3D8 (WINAPI *Direct3DCreate8_ProcPtr)(UINT SDKVersion);
typedef HRESULT (WINAPI * LPDIRECTDRAWCREATEEX)(GUID FAR * lpGuid, LPVOID *lplpDD, REFIID iid, IUnknown FAR *pUnkOuter); typedef HRESULT (WINAPI * LPDIRECTDRAWCREATEEX)(GUID FAR * lpGuid, LPVOID *lplpDD, REFIID iid, IUnknown FAR *pUnkOuter);

View File

@ -544,26 +544,15 @@ make_window_framework() {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void PandaFramework:: void PandaFramework::
make_default_pipe() { 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 // This depends on the shared library or libraries (DLL's to you
// Windows folks) that have been loaded in at runtime from the // 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(); GraphicsPipeSelection *selection = GraphicsPipeSelection::get_global_ptr();
selection->resolve_modules(); selection->print_pipe_types();
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";
}
_default_pipe = selection->make_default_pipe(); _default_pipe = selection->make_default_pipe();
if (_default_pipe == (GraphicsPipe*)NULL) { 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";
} }
} }

View File

@ -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 // Function: glxGraphicsPipe::pipe_constructor
// Access: Public, Static // Access: Public, Static

View File

@ -43,6 +43,7 @@ public:
glxGraphicsPipe(const string &display = string()); glxGraphicsPipe(const string &display = string());
virtual ~glxGraphicsPipe(); virtual ~glxGraphicsPipe();
virtual string get_interface_name() const;
static PT(GraphicsPipe) pipe_constructor(); static PT(GraphicsPipe) pipe_constructor();
INLINE Display *get_display() const; INLINE Display *get_display() const;

View File

@ -39,6 +39,21 @@ wglGraphicsPipe::
~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 // Function: wglGraphicsPipe::pipe_constructor
// Access: Public, Static // Access: Public, Static

View File

@ -33,6 +33,7 @@ public:
wglGraphicsPipe(); wglGraphicsPipe();
virtual ~wglGraphicsPipe(); virtual ~wglGraphicsPipe();
virtual string get_interface_name() const;
static PT(GraphicsPipe) pipe_constructor(); static PT(GraphicsPipe) pipe_constructor();
protected: protected: