support opening multiple remote glx windows

This commit is contained in:
David Rose 2002-04-12 02:45:38 +00:00
parent e6183b8e11
commit 07565f943f
11 changed files with 77 additions and 58 deletions

View File

@ -25,37 +25,49 @@
////////////////////////////////////////////////////////////////////
TypeHandle InteractiveGraphicsPipe::_type_handle;
InteractiveGraphicsPipe::InteractiveGraphicsPipe(const PipeSpecifier& spec)
: GraphicsPipe(spec) {}
InteractiveGraphicsPipe::InteractiveGraphicsPipe(void) {
display_cat.error()
<< "InteractiveGraphicsPipe should not be created with default constructor" << endl;
InteractiveGraphicsPipe::
InteractiveGraphicsPipe(const PipeSpecifier& spec) :
GraphicsPipe(spec)
{
}
InteractiveGraphicsPipe::InteractiveGraphicsPipe(const InteractiveGraphicsPipe&) {
display_cat.error()
<< "InteractiveGraphicsPipes should not be copied" << endl;
InteractiveGraphicsPipe::
~InteractiveGraphicsPipe() {
}
InteractiveGraphicsPipe& InteractiveGraphicsPipe::operator=(const InteractiveGraphicsPipe&) {
display_cat.error()
<< "InteractiveGraphicsPipes should not be assigned" << endl;
return *this;
}
InteractiveGraphicsPipe::~InteractiveGraphicsPipe(void) {}
TypeHandle InteractiveGraphicsPipe::get_class_type(void) {
TypeHandle InteractiveGraphicsPipe::
get_class_type(void) {
return _type_handle;
}
void InteractiveGraphicsPipe::init_type(void) {
void InteractiveGraphicsPipe::
init_type(void) {
GraphicsPipe::init_type();
register_type(_type_handle, "InteractiveGraphicsPipe",
GraphicsPipe::get_class_type());
}
TypeHandle InteractiveGraphicsPipe::get_type(void) const {
TypeHandle InteractiveGraphicsPipe::
get_type(void) const {
return get_class_type();
}
InteractiveGraphicsPipe::
InteractiveGraphicsPipe(void) {
display_cat.error()
<< "InteractiveGraphicsPipe should not be created with default constructor" << endl;
}
InteractiveGraphicsPipe::
InteractiveGraphicsPipe(const InteractiveGraphicsPipe&) {
display_cat.error()
<< "InteractiveGraphicsPipes should not be copied" << endl;
}
InteractiveGraphicsPipe &InteractiveGraphicsPipe::
operator=(const InteractiveGraphicsPipe&) {
display_cat.error()
<< "InteractiveGraphicsPipes should not be assigned" << endl;
return *this;
}

View File

@ -24,10 +24,9 @@
#include "graphicsPipe.h"
class EXPCL_PANDA InteractiveGraphicsPipe : public GraphicsPipe {
public:
PUBLISHED:
InteractiveGraphicsPipe( const PipeSpecifier& );
virtual ~InteractiveGraphicsPipe(void) = 0;
virtual ~InteractiveGraphicsPipe(void);
public:

View File

@ -39,9 +39,13 @@ std::string PipeSpecifier::get_X_specifier(void) const {
std::string ret;
if (!_is_file) {
if (getenv("DISPLAY")) {
ret = getenv("DISPLAY");
} else {
if (_machine.empty()) {
if (getenv("DISPLAY")) {
ret = getenv("DISPLAY");
}
}
if (ret.empty()) {
ostringstream ss;
ss << _machine << ":" << ((_pipe_number<0)?0:_pipe_number) << ".0";
ret = ss.str();

View File

@ -24,7 +24,7 @@
#include <string>
class EXPCL_PANDA PipeSpecifier {
public:
PUBLISHED:
PipeSpecifier(void);
PipeSpecifier(const PipeSpecifier&);
~PipeSpecifier(void);

View File

@ -20,5 +20,7 @@
glxDisplay.I glxDisplay.h \
glxGraphicsPipe.h glxGraphicsWindow.I glxGraphicsWindow.h
#define IGATESCAN glxGraphicsPipe.h
#end lib_target

View File

@ -19,14 +19,20 @@
#ifndef GLXDISPLAY_H
#define GLXDISPLAY_H
#include <pandabase.h>
#include <typedObject.h>
#include "pandabase.h"
#include "typedObject.h"
#include <X11/Xlib.h>
class GraphicsPipe;
class glxGraphicsWindow;
#ifdef CPPPARSER
// A simple hack so interrogate can parse this file.
typedef int Display;
typedef int Window;
#endif
////////////////////////////////////////////////////////////////////
// Class : glxDisplay
// Description : This class is a base class of glxGraphicsPipe, and

View File

@ -15,7 +15,9 @@
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#include "glxGraphicsPipe.h"
#include "glxGraphicsWindow.h"
#include "config_glxdisplay.h"
#include <GL/glx.h>

View File

@ -15,45 +15,37 @@
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef GLXGRAPHICSPIPE_H
#define GLXGRAPHICSPIPE_H
//
////////////////////////////////////////////////////////////////////
// Includes
////////////////////////////////////////////////////////////////////
#include <pandabase.h>
#include "glxGraphicsWindow.h"
#include "pandabase.h"
#include "glxDisplay.h"
#include <interactiveGraphicsPipe.h>
#include "interactiveGraphicsPipe.h"
////////////////////////////////////////////////////////////////////
// Class : glxGraphicsPipe
// Description :
////////////////////////////////////////////////////////////////////
class glxGraphicsPipe : public InteractiveGraphicsPipe, public glxDisplay
{
public:
class glxGraphicsPipe : public InteractiveGraphicsPipe, public glxDisplay {
PUBLISHED:
glxGraphicsPipe( const PipeSpecifier& );
glxGraphicsPipe( const PipeSpecifier& );
virtual TypeHandle get_window_type() const;
virtual TypeHandle get_window_type() const;
public:
virtual glxDisplay *get_glx_display();
virtual glxDisplay *get_glx_display();
public:
static GraphicsPipe* make_glxGraphicsPipe(const FactoryParams &params);
static TypeHandle get_class_type(void);
static void init_type(void);
virtual TypeHandle get_type(void) const;
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
private:
static TypeHandle _type_handle;
public:
static GraphicsPipe *make_glxGraphicsPipe(const FactoryParams &params);
static TypeHandle get_class_type(void);
static void init_type(void);
virtual TypeHandle get_type(void) const;
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
private:
static TypeHandle _type_handle;
};
#endif

View File

@ -22,6 +22,8 @@
#define INCLUDED_SOURCES \
config_wcrdisplay.cxx wcrGraphicsPipe.cxx
#define IGATESCAN wcrGraphicsPipe.h
#end lib_target
#begin test_bin_target

View File

@ -29,7 +29,7 @@ wcrGraphicsPipe::wcrGraphicsPipe(const PipeSpecifier& spec)
////////////////////////////////////////////////////////////////////
// Function: wcrGraphicsPipe::get_window_type
// Access: Public, Virtual
// Access: Published, Virtual
// Description: Returns the TypeHandle of the kind of window
// preferred by this kind of pipe.
////////////////////////////////////////////////////////////////////

View File

@ -35,7 +35,7 @@
// Description :
////////////////////////////////////////////////////////////////////
class EXPCL_PANDACR wcrGraphicsPipe : public InteractiveGraphicsPipe {
public:
PUBLISHED:
wcrGraphicsPipe(const PipeSpecifier&);
virtual TypeHandle get_window_type() const;