From 7af1350e4ec0bba1e9b1f45fa0b82cc4a805d77f Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 25 Feb 2009 23:04:45 +0000 Subject: [PATCH] pass GraphicsEngine through to constructors --- panda/src/display/graphicsBuffer.cxx | 4 ++-- panda/src/display/graphicsBuffer.h | 3 ++- panda/src/display/graphicsEngine.cxx | 6 +++--- panda/src/display/graphicsOutput.I | 13 +++++++++++++ panda/src/display/graphicsOutput.cxx | 3 ++- panda/src/display/graphicsOutput.h | 6 +++++- panda/src/display/graphicsPipe.cxx | 1 + panda/src/display/graphicsPipe.h | 2 ++ panda/src/display/graphicsStateGuardian.cxx | 10 ++++++---- panda/src/display/graphicsStateGuardian.h | 2 +- panda/src/display/graphicsWindow.cxx | 4 ++-- panda/src/display/graphicsWindow.h | 3 ++- panda/src/display/parasiteBuffer.cxx | 3 ++- panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx | 4 ++-- panda/src/dxgsg8/dxGraphicsStateGuardian8.h | 2 +- panda/src/dxgsg8/wdxGraphicsBuffer8.cxx | 6 +++--- panda/src/dxgsg8/wdxGraphicsBuffer8.h | 2 +- panda/src/dxgsg8/wdxGraphicsPipe8.cxx | 5 +++-- panda/src/dxgsg8/wdxGraphicsPipe8.h | 1 + panda/src/dxgsg8/wdxGraphicsWindow8.cxx | 6 +++--- panda/src/dxgsg8/wdxGraphicsWindow8.h | 2 +- panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx | 4 ++-- panda/src/dxgsg9/dxGraphicsStateGuardian9.h | 2 +- panda/src/dxgsg9/wdxGraphicsBuffer9.cxx | 6 +++--- panda/src/dxgsg9/wdxGraphicsBuffer9.h | 2 +- panda/src/dxgsg9/wdxGraphicsPipe9.cxx | 5 +++-- panda/src/dxgsg9/wdxGraphicsPipe9.h | 1 + panda/src/dxgsg9/wdxGraphicsWindow9.cxx | 6 +++--- panda/src/dxgsg9/wdxGraphicsWindow9.h | 2 +- panda/src/glstuff/glGraphicsBuffer_src.cxx | 4 ++-- panda/src/glstuff/glGraphicsBuffer_src.h | 2 +- .../glstuff/glGraphicsStateGuardian_src.cxx | 4 ++-- .../src/glstuff/glGraphicsStateGuardian_src.h | 2 +- panda/src/glxdisplay/glxGraphicsBuffer.cxx | 8 ++++---- panda/src/glxdisplay/glxGraphicsBuffer.h | 2 +- panda/src/glxdisplay/glxGraphicsPipe.cxx | 7 ++++--- panda/src/glxdisplay/glxGraphicsPipe.h | 1 + .../glxdisplay/glxGraphicsStateGuardian.cxx | 4 ++-- .../src/glxdisplay/glxGraphicsStateGuardian.h | 2 +- panda/src/glxdisplay/glxGraphicsWindow.cxx | 8 ++++---- panda/src/glxdisplay/glxGraphicsWindow.h | 2 +- panda/src/mesadisplay/osMesaGraphicsBuffer.cxx | 6 +++--- panda/src/mesadisplay/osMesaGraphicsBuffer.h | 2 +- panda/src/mesadisplay/osMesaGraphicsPipe.cxx | 3 ++- panda/src/mesadisplay/osMesaGraphicsPipe.h | 1 + .../osMesaGraphicsStateGuardian.cxx | 5 ++--- .../mesadisplay/osMesaGraphicsStateGuardian.h | 2 +- panda/src/tinydisplay/tinyGraphicsBuffer.cxx | 6 +++--- panda/src/tinydisplay/tinyGraphicsBuffer.h | 2 +- .../tinydisplay/tinyGraphicsStateGuardian.cxx | 6 +++--- .../tinydisplay/tinyGraphicsStateGuardian.h | 2 +- .../tinydisplay/tinyOffscreenGraphicsPipe.cxx | 3 ++- .../tinydisplay/tinyOffscreenGraphicsPipe.h | 1 + panda/src/tinydisplay/tinyWinGraphicsPipe.cxx | 6 ++++-- panda/src/tinydisplay/tinyWinGraphicsPipe.h | 1 + .../src/tinydisplay/tinyWinGraphicsWindow.cxx | 6 +++--- panda/src/tinydisplay/tinyWinGraphicsWindow.h | 2 +- panda/src/tinydisplay/tinyXGraphicsPipe.cxx | 7 ++++--- panda/src/tinydisplay/tinyXGraphicsPipe.h | 1 + panda/src/tinydisplay/tinyXGraphicsWindow.cxx | 18 +++++++++--------- panda/src/tinydisplay/tinyXGraphicsWindow.h | 2 +- panda/src/wgldisplay/wglGraphicsBuffer.cxx | 8 ++++---- panda/src/wgldisplay/wglGraphicsBuffer.h | 2 +- panda/src/wgldisplay/wglGraphicsPipe.cxx | 7 ++++--- panda/src/wgldisplay/wglGraphicsPipe.h | 1 + .../wgldisplay/wglGraphicsStateGuardian.cxx | 4 ++-- .../src/wgldisplay/wglGraphicsStateGuardian.h | 2 +- panda/src/wgldisplay/wglGraphicsWindow.cxx | 8 ++++---- panda/src/wgldisplay/wglGraphicsWindow.h | 2 +- panda/src/windisplay/winGraphicsWindow.cxx | 4 ++-- panda/src/windisplay/winGraphicsWindow.h | 2 +- 71 files changed, 163 insertions(+), 121 deletions(-) diff --git a/panda/src/display/graphicsBuffer.cxx b/panda/src/display/graphicsBuffer.cxx index 6136e5a171..ae643593cc 100644 --- a/panda/src/display/graphicsBuffer.cxx +++ b/panda/src/display/graphicsBuffer.cxx @@ -24,13 +24,13 @@ TypeHandle GraphicsBuffer::_type_handle; // GraphicsEngine::make_buffer() function. //////////////////////////////////////////////////////////////////// GraphicsBuffer:: -GraphicsBuffer(GraphicsPipe *pipe, +GraphicsBuffer(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsOutput(pipe, name, fb_prop, win_prop, flags, gsg, host) + GraphicsOutput(engine, pipe, name, fb_prop, win_prop, flags, gsg, host) { #ifdef DO_MEMORY_USAGE MemoryUsage::update_type(this, this); diff --git a/panda/src/display/graphicsBuffer.h b/panda/src/display/graphicsBuffer.h index 93a7595ab4..5cda4fa5b5 100644 --- a/panda/src/display/graphicsBuffer.h +++ b/panda/src/display/graphicsBuffer.h @@ -29,7 +29,8 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDA_DISPLAY GraphicsBuffer : public GraphicsOutput { protected: - GraphicsBuffer(GraphicsPipe *pipe, + GraphicsBuffer(GraphicsEngine *engine, + GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, diff --git a/panda/src/display/graphicsEngine.cxx b/panda/src/display/graphicsEngine.cxx index a261c7dc54..4a6bbb6919 100644 --- a/panda/src/display/graphicsEngine.cxx +++ b/panda/src/display/graphicsEngine.cxx @@ -368,7 +368,7 @@ make_output(GraphicsPipe *pipe, for (int retry=0; retry<10; retry++) { bool precertify = false; PT(GraphicsOutput) window = - pipe->make_output(name, fb_prop, win_prop, flags, gsg, host, retry, precertify); + pipe->make_output(name, fb_prop, win_prop, flags, this, gsg, host, retry, precertify); if (window != (GraphicsOutput *)NULL) { window->_sort = sort; if ((precertify) && (gsg != 0) && (window->get_gsg()==gsg)) { @@ -1820,6 +1820,7 @@ void GraphicsEngine:: do_add_window(GraphicsOutput *window, const GraphicsThreadingModel &threading_model) { LightReMutexHolder holder(_lock); + nassertv(window->get_engine() == this); // We have a special counter that is unique per window that allows // us to assure that recently-added windows end up on the end of the @@ -1886,9 +1887,8 @@ do_add_gsg(GraphicsStateGuardian *gsg, GraphicsPipe *pipe, const GraphicsThreadingModel &threading_model) { LightReMutexHolder holder(_lock); + nassertv(gsg->get_pipe() == pipe && gsg->get_engine() == this); gsg->_threading_model = threading_model; - gsg->_pipe = pipe; - gsg->_engine = this; if (!_default_loader.is_null()) { gsg->set_loader(_default_loader); } diff --git a/panda/src/display/graphicsOutput.I b/panda/src/display/graphicsOutput.I index 92ae7d97ac..77d403b195 100644 --- a/panda/src/display/graphicsOutput.I +++ b/panda/src/display/graphicsOutput.I @@ -45,6 +45,19 @@ get_pipe() const { return _pipe; } +//////////////////////////////////////////////////////////////////// +// Function: GraphicsOutput::get_engine +// Access: Published +// Description: Returns the graphics engine that created this output. +// Since there is normally only one GraphicsEngine +// object in an application, this is usually the same as +// the global GraphicsEngine. +//////////////////////////////////////////////////////////////////// +INLINE GraphicsEngine *GraphicsOutput:: +get_engine() const { + return _engine; +} + //////////////////////////////////////////////////////////////////// // Function: GraphicsOutput::get_name // Access: Published diff --git a/panda/src/display/graphicsOutput.cxx b/panda/src/display/graphicsOutput.cxx index e08e37120b..65578e5ae9 100644 --- a/panda/src/display/graphicsOutput.cxx +++ b/panda/src/display/graphicsOutput.cxx @@ -68,7 +68,7 @@ static CubeFaceDef cube_faces[6] = { // GraphicsEngine::make_window() function. //////////////////////////////////////////////////////////////////// GraphicsOutput:: -GraphicsOutput(GraphicsPipe *pipe, +GraphicsOutput(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, @@ -82,6 +82,7 @@ GraphicsOutput(GraphicsPipe *pipe, #ifdef DO_MEMORY_USAGE MemoryUsage::update_type(this, this); #endif + _engine = engine; _pipe = pipe; _gsg = gsg; _host = host; diff --git a/panda/src/display/graphicsOutput.h b/panda/src/display/graphicsOutput.h index bf7f3e066b..1109e5e6aa 100644 --- a/panda/src/display/graphicsOutput.h +++ b/panda/src/display/graphicsOutput.h @@ -36,6 +36,7 @@ #include "nodePath.h" class PNMImage; +class GraphicsEngine; //////////////////////////////////////////////////////////////////// // Class : GraphicsOutput @@ -59,7 +60,8 @@ class PNMImage; //////////////////////////////////////////////////////////////////// class EXPCL_PANDA_DISPLAY GraphicsOutput : public TypedWritableReferenceCount, public DrawableRegion { protected: - GraphicsOutput(GraphicsPipe *pipe, + GraphicsOutput(GraphicsEngine *engine, + GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, @@ -91,6 +93,7 @@ PUBLISHED: INLINE GraphicsStateGuardian *get_gsg() const; INLINE GraphicsPipe *get_pipe() const; + INLINE GraphicsEngine *get_engine() const; INLINE const string &get_name() const; INLINE int count_textures() const; @@ -236,6 +239,7 @@ protected: RenderTextureMode _rtm_mode; }; PT(GraphicsStateGuardian) _gsg; + GraphicsEngine *_engine; PT(GraphicsPipe) _pipe; PT(GraphicsOutput) _host; FrameBufferProperties _fb_properties; diff --git a/panda/src/display/graphicsPipe.cxx b/panda/src/display/graphicsPipe.cxx index 64604fa6a7..d447b8d375 100644 --- a/panda/src/display/graphicsPipe.cxx +++ b/panda/src/display/graphicsPipe.cxx @@ -128,6 +128,7 @@ make_output(const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, + GraphicsEngine *engine, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, diff --git a/panda/src/display/graphicsPipe.h b/panda/src/display/graphicsPipe.h index 735b043103..7f6f6febf0 100644 --- a/panda/src/display/graphicsPipe.h +++ b/panda/src/display/graphicsPipe.h @@ -23,6 +23,7 @@ #include "lightMutex.h" #include "displayInformation.h" +class GraphicsEngine; class GraphicsOutput; class GraphicsWindow; class GraphicsBuffer; @@ -116,6 +117,7 @@ protected: const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, + GraphicsEngine *engine, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index 2dd0b5180c..81cd77c1e6 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -123,9 +123,10 @@ TypeHandle GraphicsStateGuardian::_type_handle; //////////////////////////////////////////////////////////////////// GraphicsStateGuardian:: GraphicsStateGuardian(CoordinateSystem internal_coordinate_system, - GraphicsPipe *pipe) : + GraphicsEngine *engine, GraphicsPipe *pipe) : _internal_coordinate_system(internal_coordinate_system), - _pipe(pipe) + _pipe(pipe), + _engine(engine) { _coordinate_system = CS_invalid; _internal_transform = TransformState::make_identity(); @@ -230,8 +231,6 @@ GraphicsStateGuardian(CoordinateSystem internal_coordinate_system, _gamma = 1.0f; _texture_quality_override = Texture::QL_default; - - _engine = NULL; } //////////////////////////////////////////////////////////////////// @@ -255,6 +254,9 @@ GraphicsStateGuardian:: // Function: GraphicsStateGuardian::get_engine // Access: Published // Description: Returns the graphics engine that created this GSG. +// Since there is normally only one GraphicsEngine +// object in an application, this is usually the same as +// the global GraphicsEngine. //////////////////////////////////////////////////////////////////// GraphicsEngine *GraphicsStateGuardian:: get_engine() const { diff --git a/panda/src/display/graphicsStateGuardian.h b/panda/src/display/graphicsStateGuardian.h index 70c03c296b..e83475364a 100644 --- a/panda/src/display/graphicsStateGuardian.h +++ b/panda/src/display/graphicsStateGuardian.h @@ -67,7 +67,7 @@ class EXPCL_PANDA_DISPLAY GraphicsStateGuardian : public GraphicsStateGuardianBa // public: GraphicsStateGuardian(CoordinateSystem internal_coordinate_system, - GraphicsPipe *pipe); + GraphicsEngine *engine, GraphicsPipe *pipe); virtual ~GraphicsStateGuardian(); PUBLISHED: diff --git a/panda/src/display/graphicsWindow.cxx b/panda/src/display/graphicsWindow.cxx index a34ab1282b..50a1336f52 100644 --- a/panda/src/display/graphicsWindow.cxx +++ b/panda/src/display/graphicsWindow.cxx @@ -32,14 +32,14 @@ TypeHandle GraphicsWindow::_type_handle; // GraphicsEngine::make_window() function. //////////////////////////////////////////////////////////////////// GraphicsWindow:: -GraphicsWindow(GraphicsPipe *pipe, +GraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsOutput(pipe, name, fb_prop, win_prop, flags, gsg, host), + GraphicsOutput(engine, pipe, name, fb_prop, win_prop, flags, gsg, host), _input_lock("GraphicsWindow::_input_lock"), _properties_lock("GraphicsWindow::_properties_lock") { diff --git a/panda/src/display/graphicsWindow.h b/panda/src/display/graphicsWindow.h index ea158c8726..849e1382de 100644 --- a/panda/src/display/graphicsWindow.h +++ b/panda/src/display/graphicsWindow.h @@ -36,7 +36,8 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDA_DISPLAY GraphicsWindow : public GraphicsOutput { protected: - GraphicsWindow(GraphicsPipe *pipe, + GraphicsWindow(GraphicsEngine *engine, + GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, diff --git a/panda/src/display/parasiteBuffer.cxx b/panda/src/display/parasiteBuffer.cxx index 72287f62a1..dfd1bac9e1 100644 --- a/panda/src/display/parasiteBuffer.cxx +++ b/panda/src/display/parasiteBuffer.cxx @@ -27,7 +27,8 @@ TypeHandle ParasiteBuffer::_type_handle; ParasiteBuffer:: ParasiteBuffer(GraphicsOutput *host, const string &name, int x_size, int y_size, int flags) : - GraphicsOutput(host->get_pipe(), name, host->get_fb_properties(), + GraphicsOutput(host->get_engine(), host->get_pipe(), + name, host->get_fb_properties(), WindowProperties::size(x_size, y_size), flags, host->get_gsg(), host) { diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx index 4af15cf8fb..09a7f46833 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx @@ -81,8 +81,8 @@ unsigned char *DXGraphicsStateGuardian8::_safe_buffer_start = NULL; // Description: //////////////////////////////////////////////////////////////////// DXGraphicsStateGuardian8:: -DXGraphicsStateGuardian8(GraphicsPipe *pipe) : - GraphicsStateGuardian(CS_yup_left, pipe) +DXGraphicsStateGuardian8(GraphicsEngine *engine, GraphicsPipe *pipe) : + GraphicsStateGuardian(CS_yup_left, engine, pipe) { // Assume that we will get a hardware-accelerated context, unless // the window tells us otherwise. diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.h b/panda/src/dxgsg8/dxGraphicsStateGuardian8.h index a4794c1f80..7735eef605 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.h +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.h @@ -43,7 +43,7 @@ class DXIndexBufferContext8; //////////////////////////////////////////////////////////////////// class EXPCL_PANDADX DXGraphicsStateGuardian8 : public GraphicsStateGuardian { public: - DXGraphicsStateGuardian8(GraphicsPipe *pipe); + DXGraphicsStateGuardian8(GraphicsEngine *engine, GraphicsPipe *pipe); ~DXGraphicsStateGuardian8(); FrameBufferProperties diff --git a/panda/src/dxgsg8/wdxGraphicsBuffer8.cxx b/panda/src/dxgsg8/wdxGraphicsBuffer8.cxx index 703216a405..e9160c59e2 100644 --- a/panda/src/dxgsg8/wdxGraphicsBuffer8.cxx +++ b/panda/src/dxgsg8/wdxGraphicsBuffer8.cxx @@ -37,14 +37,14 @@ TypeHandle wdxGraphicsBuffer8::_type_handle; // Description: //////////////////////////////////////////////////////////////////// wdxGraphicsBuffer8:: -wdxGraphicsBuffer8(GraphicsPipe *pipe, +wdxGraphicsBuffer8(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host): - GraphicsBuffer(pipe, name, fb_prop, win_prop, flags, gsg, host) + GraphicsBuffer(engine, pipe, name, fb_prop, win_prop, flags, gsg, host) { // initialize all class members _cube_map_index = -1; @@ -523,7 +523,7 @@ open_buffer() { // GSG creation/initialization. if (_gsg == 0) { - _dxgsg = new DXGraphicsStateGuardian8(_pipe); + _dxgsg = new DXGraphicsStateGuardian8(_engine, _pipe); _gsg = _dxgsg; } else { DCAST_INTO_R(_dxgsg, _gsg, false); diff --git a/panda/src/dxgsg8/wdxGraphicsBuffer8.h b/panda/src/dxgsg8/wdxGraphicsBuffer8.h index d4b99f2524..57aba45ce8 100644 --- a/panda/src/dxgsg8/wdxGraphicsBuffer8.h +++ b/panda/src/dxgsg8/wdxGraphicsBuffer8.h @@ -32,7 +32,7 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDADX wdxGraphicsBuffer8 : public GraphicsBuffer { public: - wdxGraphicsBuffer8(GraphicsPipe *pipe, + wdxGraphicsBuffer8(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, diff --git a/panda/src/dxgsg8/wdxGraphicsPipe8.cxx b/panda/src/dxgsg8/wdxGraphicsPipe8.cxx index 57e5f3710d..95eccd51cc 100644 --- a/panda/src/dxgsg8/wdxGraphicsPipe8.cxx +++ b/panda/src/dxgsg8/wdxGraphicsPipe8.cxx @@ -86,6 +86,7 @@ make_output(const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, + GraphicsEngine *engine, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, @@ -121,7 +122,7 @@ make_output(const string &name, return NULL; } } - return new wdxGraphicsWindow8(this, name, fb_prop, win_prop, + return new wdxGraphicsWindow8(engine, this, name, fb_prop, win_prop, flags, gsg, host); } @@ -159,7 +160,7 @@ make_output(const string &name, (gsg->get_supports_render_texture())) { precertify = true; } - return new wdxGraphicsBuffer8(this, name, fb_prop, win_prop, + return new wdxGraphicsBuffer8(engine, this, name, fb_prop, win_prop, flags, gsg, host); } diff --git a/panda/src/dxgsg8/wdxGraphicsPipe8.h b/panda/src/dxgsg8/wdxGraphicsPipe8.h index dc9325be2c..91606306f6 100644 --- a/panda/src/dxgsg8/wdxGraphicsPipe8.h +++ b/panda/src/dxgsg8/wdxGraphicsPipe8.h @@ -56,6 +56,7 @@ protected: const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, + GraphicsEngine *engine, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, diff --git a/panda/src/dxgsg8/wdxGraphicsWindow8.cxx b/panda/src/dxgsg8/wdxGraphicsWindow8.cxx index 762c7d73f5..919239938d 100644 --- a/panda/src/dxgsg8/wdxGraphicsWindow8.cxx +++ b/panda/src/dxgsg8/wdxGraphicsWindow8.cxx @@ -35,14 +35,14 @@ TypeHandle wdxGraphicsWindow8::_type_handle; // Description: //////////////////////////////////////////////////////////////////// wdxGraphicsWindow8:: -wdxGraphicsWindow8(GraphicsPipe *pipe, +wdxGraphicsWindow8(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host): - WinGraphicsWindow(pipe, name, fb_prop, win_prop, flags, gsg, host) + WinGraphicsWindow(engine, pipe, name, fb_prop, win_prop, flags, gsg, host) { // dont actually create the window in the constructor. reason: // multi-threading requires panda C++ window object to exist in @@ -281,7 +281,7 @@ open_window() { // GSG creation/initialization. if (_gsg == 0) { - _dxgsg = new DXGraphicsStateGuardian8(_pipe); + _dxgsg = new DXGraphicsStateGuardian8(_engine, _pipe); _gsg = _dxgsg; } else { DCAST_INTO_R(_dxgsg, _gsg, false); diff --git a/panda/src/dxgsg8/wdxGraphicsWindow8.h b/panda/src/dxgsg8/wdxGraphicsWindow8.h index 0f2a4a9945..a9d080dd61 100644 --- a/panda/src/dxgsg8/wdxGraphicsWindow8.h +++ b/panda/src/dxgsg8/wdxGraphicsWindow8.h @@ -30,7 +30,7 @@ class wdxGraphicsPipe8; //////////////////////////////////////////////////////////////////// class EXPCL_PANDADX wdxGraphicsWindow8 : public WinGraphicsWindow { public: - wdxGraphicsWindow8(GraphicsPipe *pipe, + wdxGraphicsWindow8(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index 15927d6034..410750675e 100755 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -93,8 +93,8 @@ LPDIRECT3DDEVICE9 DXGraphicsStateGuardian9::_cg_device = NULL; // Description: //////////////////////////////////////////////////////////////////// DXGraphicsStateGuardian9:: -DXGraphicsStateGuardian9(GraphicsPipe *pipe) : - GraphicsStateGuardian(CS_yup_left, pipe) +DXGraphicsStateGuardian9(GraphicsEngine *engine, GraphicsPipe *pipe) : + GraphicsStateGuardian(CS_yup_left, engine, pipe) { if (dxgsg9_cat.is_debug()) { dxgsg9_cat.debug() diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.h b/panda/src/dxgsg9/dxGraphicsStateGuardian9.h index a8a4925240..39683a886a 100755 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.h +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.h @@ -64,7 +64,7 @@ class DXIndexBufferContext9; //////////////////////////////////////////////////////////////////// class EXPCL_PANDADX DXGraphicsStateGuardian9 : public GraphicsStateGuardian { public: - DXGraphicsStateGuardian9(GraphicsPipe *pipe); + DXGraphicsStateGuardian9(GraphicsEngine *engine, GraphicsPipe *pipe); ~DXGraphicsStateGuardian9(); FrameBufferProperties diff --git a/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx b/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx index 93e040a26d..2a3238b697 100644 --- a/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx @@ -29,14 +29,14 @@ TypeHandle wdxGraphicsBuffer9::_type_handle; // Description: //////////////////////////////////////////////////////////////////// wdxGraphicsBuffer9:: -wdxGraphicsBuffer9(GraphicsPipe *pipe, +wdxGraphicsBuffer9(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host): - GraphicsBuffer(pipe, name, fb_prop, win_prop, flags, gsg, host) + GraphicsBuffer(engine, pipe, name, fb_prop, win_prop, flags, gsg, host) { // initialize all class members _cube_map_index = -1; @@ -745,7 +745,7 @@ open_buffer() { // GSG creation/initialization. if (_gsg == 0) { - _dxgsg = new DXGraphicsStateGuardian9(_pipe); + _dxgsg = new DXGraphicsStateGuardian9(_engine, _pipe); _gsg = _dxgsg; } else { DCAST_INTO_R(_dxgsg, _gsg, false); diff --git a/panda/src/dxgsg9/wdxGraphicsBuffer9.h b/panda/src/dxgsg9/wdxGraphicsBuffer9.h index 9392cace07..1270546292 100644 --- a/panda/src/dxgsg9/wdxGraphicsBuffer9.h +++ b/panda/src/dxgsg9/wdxGraphicsBuffer9.h @@ -32,7 +32,7 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDADX wdxGraphicsBuffer9 : public GraphicsBuffer { public: - wdxGraphicsBuffer9(GraphicsPipe *pipe, + wdxGraphicsBuffer9(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, diff --git a/panda/src/dxgsg9/wdxGraphicsPipe9.cxx b/panda/src/dxgsg9/wdxGraphicsPipe9.cxx index b960a7795e..161ac79234 100755 --- a/panda/src/dxgsg9/wdxGraphicsPipe9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsPipe9.cxx @@ -86,6 +86,7 @@ make_output(const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, + GraphicsEngine *engine, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, @@ -121,7 +122,7 @@ make_output(const string &name, return NULL; } } - return new wdxGraphicsWindow9(this, name, fb_prop, win_prop, + return new wdxGraphicsWindow9(engine, this, name, fb_prop, win_prop, flags, gsg, host); } @@ -155,7 +156,7 @@ make_output(const string &name, (gsg->get_supports_render_texture())) { precertify = true; } - return new wdxGraphicsBuffer9(this, name, fb_prop, win_prop, + return new wdxGraphicsBuffer9(engine, this, name, fb_prop, win_prop, flags, gsg, host); } diff --git a/panda/src/dxgsg9/wdxGraphicsPipe9.h b/panda/src/dxgsg9/wdxGraphicsPipe9.h index dc6fc63be4..ce81485889 100755 --- a/panda/src/dxgsg9/wdxGraphicsPipe9.h +++ b/panda/src/dxgsg9/wdxGraphicsPipe9.h @@ -56,6 +56,7 @@ protected: const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, + GraphicsEngine *engine, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, diff --git a/panda/src/dxgsg9/wdxGraphicsWindow9.cxx b/panda/src/dxgsg9/wdxGraphicsWindow9.cxx index 5ca1517ca3..e99e4ab237 100755 --- a/panda/src/dxgsg9/wdxGraphicsWindow9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsWindow9.cxx @@ -35,14 +35,14 @@ TypeHandle wdxGraphicsWindow9::_type_handle; // Description: //////////////////////////////////////////////////////////////////// wdxGraphicsWindow9:: -wdxGraphicsWindow9(GraphicsPipe *pipe, +wdxGraphicsWindow9(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host): - WinGraphicsWindow(pipe, name, fb_prop, win_prop, flags, gsg, host) + WinGraphicsWindow(engine, pipe, name, fb_prop, win_prop, flags, gsg, host) { // dont actually create the window in the constructor. reason: // multi-threading requires panda C++ window object to exist in @@ -283,7 +283,7 @@ open_window() { bool discard_device = always_discard_device; if (_gsg == 0) { - _dxgsg = new DXGraphicsStateGuardian9(_pipe); + _dxgsg = new DXGraphicsStateGuardian9(_engine, _pipe); _gsg = _dxgsg; } else { DCAST_INTO_R(_dxgsg, _gsg, false); diff --git a/panda/src/dxgsg9/wdxGraphicsWindow9.h b/panda/src/dxgsg9/wdxGraphicsWindow9.h index 43f8783171..6b0b430c88 100755 --- a/panda/src/dxgsg9/wdxGraphicsWindow9.h +++ b/panda/src/dxgsg9/wdxGraphicsWindow9.h @@ -30,7 +30,7 @@ class wdxGraphicsPipe9; //////////////////////////////////////////////////////////////////// class EXPCL_PANDADX wdxGraphicsWindow9 : public WinGraphicsWindow { public: - wdxGraphicsWindow9(GraphicsPipe *pipe, + wdxGraphicsWindow9(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, diff --git a/panda/src/glstuff/glGraphicsBuffer_src.cxx b/panda/src/glstuff/glGraphicsBuffer_src.cxx index d00c5bfd4b..bcf498feee 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.cxx +++ b/panda/src/glstuff/glGraphicsBuffer_src.cxx @@ -20,14 +20,14 @@ TypeHandle CLP(GraphicsBuffer)::_type_handle; // Description: //////////////////////////////////////////////////////////////////// CLP(GraphicsBuffer):: -CLP(GraphicsBuffer)(GraphicsPipe *pipe, +CLP(GraphicsBuffer)(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsBuffer(pipe, name, fb_prop, win_prop, flags, gsg, host) + GraphicsBuffer(engine, pipe, name, fb_prop, win_prop, flags, gsg, host) { // An FBO doesn't have a back buffer. _draw_buffer_type = RenderBuffer::T_front; diff --git a/panda/src/glstuff/glGraphicsBuffer_src.h b/panda/src/glstuff/glGraphicsBuffer_src.h index 3453934d70..22d7c1fd21 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.h +++ b/panda/src/glstuff/glGraphicsBuffer_src.h @@ -52,7 +52,7 @@ class EXPCL_GL CLP(GraphicsBuffer) : public GraphicsBuffer { public: - CLP(GraphicsBuffer)(GraphicsPipe *pipe, + CLP(GraphicsBuffer)(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 6ab84be9f0..8a0af25cf5 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -254,8 +254,8 @@ fix_component_ordering(PTA_uchar &new_image, // Description: //////////////////////////////////////////////////////////////////// CLP(GraphicsStateGuardian):: -CLP(GraphicsStateGuardian)(GraphicsPipe *pipe) : - GraphicsStateGuardian(CS_yup_right, pipe) +CLP(GraphicsStateGuardian)(GraphicsEngine *engine, GraphicsPipe *pipe) : + GraphicsStateGuardian(CS_yup_right, engine, pipe) { _error_count = 0; diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index 998bc83b33..d4855b66fe 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -108,7 +108,7 @@ typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); //////////////////////////////////////////////////////////////////// class EXPCL_GL CLP(GraphicsStateGuardian) : public GraphicsStateGuardian { public: - CLP(GraphicsStateGuardian)(GraphicsPipe *pipe); + CLP(GraphicsStateGuardian)(GraphicsEngine *engine, GraphicsPipe *pipe); virtual ~CLP(GraphicsStateGuardian)(); virtual void reset(); diff --git a/panda/src/glxdisplay/glxGraphicsBuffer.cxx b/panda/src/glxdisplay/glxGraphicsBuffer.cxx index 44112ac879..d360bad90a 100644 --- a/panda/src/glxdisplay/glxGraphicsBuffer.cxx +++ b/panda/src/glxdisplay/glxGraphicsBuffer.cxx @@ -33,14 +33,14 @@ TypeHandle glxGraphicsBuffer::_type_handle; // Description: //////////////////////////////////////////////////////////////////// glxGraphicsBuffer:: -glxGraphicsBuffer(GraphicsPipe *pipe, +glxGraphicsBuffer(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsBuffer(pipe, name, fb_prop, win_prop, flags, gsg, host) + GraphicsBuffer(engine, pipe, name, fb_prop, win_prop, flags, gsg, host) { glxGraphicsPipe *glx_pipe; DCAST_INTO_V(glx_pipe, _pipe); @@ -169,7 +169,7 @@ open_buffer() { glxGraphicsStateGuardian *glxgsg; if (_gsg == 0) { // There is no old gsg. Create a new one. - glxgsg = new glxGraphicsStateGuardian(_pipe, NULL); + glxgsg = new glxGraphicsStateGuardian(_engine, _pipe, NULL); glxgsg->choose_pixel_format(_fb_properties, glx_pipe->get_display(), glx_pipe->get_screen(), true); _gsg = glxgsg; } else { @@ -177,7 +177,7 @@ open_buffer() { // new one that shares with the old gsg. DCAST_INTO_R(glxgsg, _gsg, false); if (!glxgsg->get_fb_properties().subsumes(_fb_properties)) { - glxgsg = new glxGraphicsStateGuardian(_pipe, glxgsg); + glxgsg = new glxGraphicsStateGuardian(_engine, _pipe, glxgsg); glxgsg->choose_pixel_format(_fb_properties, glx_pipe->get_display(), glx_pipe->get_screen(), true); _gsg = glxgsg; } diff --git a/panda/src/glxdisplay/glxGraphicsBuffer.h b/panda/src/glxdisplay/glxGraphicsBuffer.h index a60262c511..a5545e4f5d 100644 --- a/panda/src/glxdisplay/glxGraphicsBuffer.h +++ b/panda/src/glxdisplay/glxGraphicsBuffer.h @@ -31,7 +31,7 @@ //////////////////////////////////////////////////////////////////// class glxGraphicsBuffer : public GraphicsBuffer { public: - glxGraphicsBuffer(GraphicsPipe *pipe, + glxGraphicsBuffer(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, diff --git a/panda/src/glxdisplay/glxGraphicsPipe.cxx b/panda/src/glxdisplay/glxGraphicsPipe.cxx index 33b4ace079..5a545ee0d7 100644 --- a/panda/src/glxdisplay/glxGraphicsPipe.cxx +++ b/panda/src/glxdisplay/glxGraphicsPipe.cxx @@ -202,6 +202,7 @@ make_output(const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, + GraphicsEngine *engine, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, @@ -235,7 +236,7 @@ make_output(const string &name, ((flags&BF_can_bind_every)!=0)) { return NULL; } - return new glxGraphicsWindow(this, name, fb_prop, win_prop, + return new glxGraphicsWindow(engine, this, name, fb_prop, win_prop, flags, gsg, host); } @@ -268,7 +269,7 @@ make_output(const string &name, (fb_prop.is_basic())) { precertify = true; } - return new GLGraphicsBuffer(this, name, fb_prop, win_prop, + return new GLGraphicsBuffer(engine, this, name, fb_prop, win_prop, flags, gsg, host); } @@ -285,7 +286,7 @@ make_output(const string &name, ((flags&BF_can_bind_every)!=0)) { return NULL; } - return new glxGraphicsBuffer(this, name, fb_prop, win_prop, + return new glxGraphicsBuffer(engine, this, name, fb_prop, win_prop, flags, gsg, host); } #endif // HAVE_GLXFBCONFIG diff --git a/panda/src/glxdisplay/glxGraphicsPipe.h b/panda/src/glxdisplay/glxGraphicsPipe.h index ffba429592..3c1e9f2f6f 100644 --- a/panda/src/glxdisplay/glxGraphicsPipe.h +++ b/panda/src/glxdisplay/glxGraphicsPipe.h @@ -122,6 +122,7 @@ protected: const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, + GraphicsEngine *engine, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, diff --git a/panda/src/glxdisplay/glxGraphicsStateGuardian.cxx b/panda/src/glxdisplay/glxGraphicsStateGuardian.cxx index 903a47f1a1..f759d2b820 100644 --- a/panda/src/glxdisplay/glxGraphicsStateGuardian.cxx +++ b/panda/src/glxdisplay/glxGraphicsStateGuardian.cxx @@ -28,9 +28,9 @@ TypeHandle glxGraphicsStateGuardian::_type_handle; // Description: //////////////////////////////////////////////////////////////////// glxGraphicsStateGuardian:: -glxGraphicsStateGuardian(GraphicsPipe *pipe, +glxGraphicsStateGuardian(GraphicsEngine *engine, GraphicsPipe *pipe, glxGraphicsStateGuardian *share_with) : - GLGraphicsStateGuardian(pipe) + GLGraphicsStateGuardian(engine, pipe) { _share_context=0; _context=0; diff --git a/panda/src/glxdisplay/glxGraphicsStateGuardian.h b/panda/src/glxdisplay/glxGraphicsStateGuardian.h index 7745ec3900..e3497392e5 100644 --- a/panda/src/glxdisplay/glxGraphicsStateGuardian.h +++ b/panda/src/glxdisplay/glxGraphicsStateGuardian.h @@ -85,7 +85,7 @@ public: int _screen, bool need_pbuffer); - glxGraphicsStateGuardian(GraphicsPipe *pipe, + glxGraphicsStateGuardian(GraphicsEngine *engine, GraphicsPipe *pipe, glxGraphicsStateGuardian *share_with); virtual ~glxGraphicsStateGuardian(); diff --git a/panda/src/glxdisplay/glxGraphicsWindow.cxx b/panda/src/glxdisplay/glxGraphicsWindow.cxx index f0306629fa..575e528e93 100644 --- a/panda/src/glxdisplay/glxGraphicsWindow.cxx +++ b/panda/src/glxdisplay/glxGraphicsWindow.cxx @@ -47,14 +47,14 @@ TypeHandle glxGraphicsWindow::_type_handle; // Description: //////////////////////////////////////////////////////////////////// glxGraphicsWindow:: -glxGraphicsWindow(GraphicsPipe *pipe, +glxGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsWindow(pipe, name, fb_prop, win_prop, flags, gsg, host) + GraphicsWindow(engine, pipe, name, fb_prop, win_prop, flags, gsg, host) { glxGraphicsPipe *glx_pipe; DCAST_INTO_V(glx_pipe, _pipe); @@ -616,7 +616,7 @@ open_window() { glxGraphicsStateGuardian *glxgsg; if (_gsg == 0) { // There is no old gsg. Create a new one. - glxgsg = new glxGraphicsStateGuardian(_pipe, NULL); + glxgsg = new glxGraphicsStateGuardian(_engine, _pipe, NULL); glxgsg->choose_pixel_format(_fb_properties, glx_pipe->get_display(), glx_pipe->get_screen(), false); _gsg = glxgsg; } else { @@ -624,7 +624,7 @@ open_window() { // new one that shares with the old gsg. DCAST_INTO_R(glxgsg, _gsg, false); if (!glxgsg->get_fb_properties().subsumes(_fb_properties)) { - glxgsg = new glxGraphicsStateGuardian(_pipe, glxgsg); + glxgsg = new glxGraphicsStateGuardian(_engine, _pipe, glxgsg); glxgsg->choose_pixel_format(_fb_properties, glx_pipe->get_display(), glx_pipe->get_screen(), false); _gsg = glxgsg; } diff --git a/panda/src/glxdisplay/glxGraphicsWindow.h b/panda/src/glxdisplay/glxGraphicsWindow.h index 1d533dad4d..0ec5490242 100644 --- a/panda/src/glxdisplay/glxGraphicsWindow.h +++ b/panda/src/glxdisplay/glxGraphicsWindow.h @@ -28,7 +28,7 @@ //////////////////////////////////////////////////////////////////// class glxGraphicsWindow : public GraphicsWindow { public: - glxGraphicsWindow(GraphicsPipe *pipe, + glxGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, diff --git a/panda/src/mesadisplay/osMesaGraphicsBuffer.cxx b/panda/src/mesadisplay/osMesaGraphicsBuffer.cxx index 0d4d848861..99220a8c23 100644 --- a/panda/src/mesadisplay/osMesaGraphicsBuffer.cxx +++ b/panda/src/mesadisplay/osMesaGraphicsBuffer.cxx @@ -25,14 +25,14 @@ TypeHandle OsMesaGraphicsBuffer::_type_handle; // Description: //////////////////////////////////////////////////////////////////// OsMesaGraphicsBuffer:: -OsMesaGraphicsBuffer(GraphicsPipe *pipe, +OsMesaGraphicsBuffer(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsBuffer(pipe, name, fb_prop, win_prop, flags, gsg, host) + GraphicsBuffer(engine, pipe, name, fb_prop, win_prop, flags, gsg, host) { _type = GL_UNSIGNED_BYTE; _screenshot_buffer_type = _draw_buffer_type; @@ -131,7 +131,7 @@ close_buffer() { bool OsMesaGraphicsBuffer:: open_buffer() { if (_gsg == 0) { - _gsg = new OSMesaGraphicsStateGuardian(_pipe, NULL); + _gsg = new OSMesaGraphicsStateGuardian(_engine, _pipe, NULL); } _image = PTA_uchar::empty_array(_x_size * _y_size * 4); diff --git a/panda/src/mesadisplay/osMesaGraphicsBuffer.h b/panda/src/mesadisplay/osMesaGraphicsBuffer.h index 476fcd791b..cf513b2559 100644 --- a/panda/src/mesadisplay/osMesaGraphicsBuffer.h +++ b/panda/src/mesadisplay/osMesaGraphicsBuffer.h @@ -28,7 +28,7 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDAMESA OsMesaGraphicsBuffer : public GraphicsBuffer { public: - OsMesaGraphicsBuffer(GraphicsPipe *pipe, + OsMesaGraphicsBuffer(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, diff --git a/panda/src/mesadisplay/osMesaGraphicsPipe.cxx b/panda/src/mesadisplay/osMesaGraphicsPipe.cxx index b12bfef757..7705645e64 100644 --- a/panda/src/mesadisplay/osMesaGraphicsPipe.cxx +++ b/panda/src/mesadisplay/osMesaGraphicsPipe.cxx @@ -78,6 +78,7 @@ make_output(const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, + GraphicsEngine *engine, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, @@ -103,7 +104,7 @@ make_output(const string &name, FrameBufferProperties fb_prop2 = fb_prop; fb_prop2.set_back_buffers(0); - return new OsMesaGraphicsBuffer(this, name, fb_prop2, win_prop, + return new OsMesaGraphicsBuffer(engine, this, name, fb_prop2, win_prop, flags, gsg, host); } diff --git a/panda/src/mesadisplay/osMesaGraphicsPipe.h b/panda/src/mesadisplay/osMesaGraphicsPipe.h index 073ff87085..4d8d388f59 100644 --- a/panda/src/mesadisplay/osMesaGraphicsPipe.h +++ b/panda/src/mesadisplay/osMesaGraphicsPipe.h @@ -46,6 +46,7 @@ protected: const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, + GraphicsEngine *engine, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, diff --git a/panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx b/panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx index ba66a94b1a..d547644e26 100644 --- a/panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx +++ b/panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx @@ -22,9 +22,9 @@ TypeHandle OSMesaGraphicsStateGuardian::_type_handle; // Description: //////////////////////////////////////////////////////////////////// OSMesaGraphicsStateGuardian:: -OSMesaGraphicsStateGuardian(GraphicsPipe *pipe, +OSMesaGraphicsStateGuardian(GraphicsEngine *engine, GraphicsPipe *pipe, OSMesaGraphicsStateGuardian *share_with) : - MesaGraphicsStateGuardian(pipe) + MesaGraphicsStateGuardian(engine, pipe) { OSMesaContext share_context = NULL; if (share_with != (OSMesaGraphicsStateGuardian *)NULL) { @@ -36,7 +36,6 @@ OSMesaGraphicsStateGuardian(GraphicsPipe *pipe, // OSMesa is never hardware-accelerated. _is_hardware = false; - cerr << "constructed " << this << "\n"; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/mesadisplay/osMesaGraphicsStateGuardian.h b/panda/src/mesadisplay/osMesaGraphicsStateGuardian.h index d0cbb7fb42..ef975f2666 100644 --- a/panda/src/mesadisplay/osMesaGraphicsStateGuardian.h +++ b/panda/src/mesadisplay/osMesaGraphicsStateGuardian.h @@ -25,7 +25,7 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDAMESA OSMesaGraphicsStateGuardian : public MesaGraphicsStateGuardian { public: - OSMesaGraphicsStateGuardian(GraphicsPipe *pipe, + OSMesaGraphicsStateGuardian(GraphicsEngine *engine, GraphicsPipe *pipe, OSMesaGraphicsStateGuardian *share_with); virtual ~OSMesaGraphicsStateGuardian(); diff --git a/panda/src/tinydisplay/tinyGraphicsBuffer.cxx b/panda/src/tinydisplay/tinyGraphicsBuffer.cxx index 136b8cf97b..c94c567733 100644 --- a/panda/src/tinydisplay/tinyGraphicsBuffer.cxx +++ b/panda/src/tinydisplay/tinyGraphicsBuffer.cxx @@ -27,14 +27,14 @@ TypeHandle TinyGraphicsBuffer::_type_handle; // Description: //////////////////////////////////////////////////////////////////// TinyGraphicsBuffer:: -TinyGraphicsBuffer(GraphicsPipe *pipe, +TinyGraphicsBuffer(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsBuffer(pipe, name, fb_prop, win_prop, flags, gsg, host) + GraphicsBuffer(engine, pipe, name, fb_prop, win_prop, flags, gsg, host) { _frame_buffer = NULL; } @@ -134,7 +134,7 @@ open_buffer() { TinyGraphicsStateGuardian *tinygsg; if (_gsg == 0) { // There is no old gsg. Create a new one. - tinygsg = new TinyGraphicsStateGuardian(_pipe, NULL); + tinygsg = new TinyGraphicsStateGuardian(_engine, _pipe, NULL); _gsg = tinygsg; } else { DCAST_INTO_R(tinygsg, _gsg, false); diff --git a/panda/src/tinydisplay/tinyGraphicsBuffer.h b/panda/src/tinydisplay/tinyGraphicsBuffer.h index 2a2349fbf1..6f650555a8 100644 --- a/panda/src/tinydisplay/tinyGraphicsBuffer.h +++ b/panda/src/tinydisplay/tinyGraphicsBuffer.h @@ -25,7 +25,7 @@ //////////////////////////////////////////////////////////////////// class EXPCL_TINYDISPLAY TinyGraphicsBuffer : public GraphicsBuffer { public: - TinyGraphicsBuffer(GraphicsPipe *pipe, + TinyGraphicsBuffer(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, diff --git a/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx b/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx index 2334feec68..23fc323ce7 100644 --- a/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx +++ b/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx @@ -62,9 +62,9 @@ PStatCollector TinyGraphicsStateGuardian::_pixel_count_smooth_multitex3_pcollect // Description: //////////////////////////////////////////////////////////////////// TinyGraphicsStateGuardian:: -TinyGraphicsStateGuardian(GraphicsPipe *pipe, - TinyGraphicsStateGuardian *share_with) : - GraphicsStateGuardian(CS_yup_right, pipe) +TinyGraphicsStateGuardian(GraphicsEngine *engine, GraphicsPipe *pipe, + TinyGraphicsStateGuardian *share_with) : + GraphicsStateGuardian(CS_yup_right, engine, pipe) { _current_frame_buffer = NULL; _aux_frame_buffer = NULL; diff --git a/panda/src/tinydisplay/tinyGraphicsStateGuardian.h b/panda/src/tinydisplay/tinyGraphicsStateGuardian.h index 216dbc33b2..f7035e4a0f 100644 --- a/panda/src/tinydisplay/tinyGraphicsStateGuardian.h +++ b/panda/src/tinydisplay/tinyGraphicsStateGuardian.h @@ -42,7 +42,7 @@ class TinyTextureContext; //////////////////////////////////////////////////////////////////// class EXPCL_TINYDISPLAY TinyGraphicsStateGuardian : public GraphicsStateGuardian { public: - TinyGraphicsStateGuardian(GraphicsPipe *pipe, + TinyGraphicsStateGuardian(GraphicsEngine *engine, GraphicsPipe *pipe, TinyGraphicsStateGuardian *share_with); virtual ~TinyGraphicsStateGuardian(); diff --git a/panda/src/tinydisplay/tinyOffscreenGraphicsPipe.cxx b/panda/src/tinydisplay/tinyOffscreenGraphicsPipe.cxx index 2c491e0717..591ccb7e0e 100644 --- a/panda/src/tinydisplay/tinyOffscreenGraphicsPipe.cxx +++ b/panda/src/tinydisplay/tinyOffscreenGraphicsPipe.cxx @@ -79,6 +79,7 @@ make_output(const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, + GraphicsEngine *engine, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, @@ -90,7 +91,7 @@ make_output(const string &name, ((flags&BF_require_window)!=0)) { return NULL; } - return new TinyGraphicsBuffer(this, name, fb_prop, win_prop, flags, gsg, host); + return new TinyGraphicsBuffer(engine, this, name, fb_prop, win_prop, flags, gsg, host); } // Nothing else left to try. diff --git a/panda/src/tinydisplay/tinyOffscreenGraphicsPipe.h b/panda/src/tinydisplay/tinyOffscreenGraphicsPipe.h index c3f8057294..0c08c250f0 100644 --- a/panda/src/tinydisplay/tinyOffscreenGraphicsPipe.h +++ b/panda/src/tinydisplay/tinyOffscreenGraphicsPipe.h @@ -41,6 +41,7 @@ protected: const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, + GraphicsEngine *engine, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, diff --git a/panda/src/tinydisplay/tinyWinGraphicsPipe.cxx b/panda/src/tinydisplay/tinyWinGraphicsPipe.cxx index 890512daf2..43cc8b7c80 100755 --- a/panda/src/tinydisplay/tinyWinGraphicsPipe.cxx +++ b/panda/src/tinydisplay/tinyWinGraphicsPipe.cxx @@ -80,6 +80,7 @@ make_output(const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, + GraphicsEngine *engine, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, @@ -113,7 +114,7 @@ make_output(const string &name, return NULL; } } - return new TinyWinGraphicsWindow(this, name, fb_prop, win_prop, + return new TinyWinGraphicsWindow(engine, this, name, fb_prop, win_prop, flags, gsg, host); } @@ -123,7 +124,8 @@ make_output(const string &name, ((flags&BF_require_window)!=0)) { return NULL; } - return new TinyGraphicsBuffer(this, name, fb_prop, win_prop, flags, gsg, host); + return new TinyGraphicsBuffer(engine, this, name, fb_prop, win_prop, + flags, gsg, host); } // Nothing else left to try. diff --git a/panda/src/tinydisplay/tinyWinGraphicsPipe.h b/panda/src/tinydisplay/tinyWinGraphicsPipe.h index 606d7a810d..8e8d2bbfd4 100755 --- a/panda/src/tinydisplay/tinyWinGraphicsPipe.h +++ b/panda/src/tinydisplay/tinyWinGraphicsPipe.h @@ -41,6 +41,7 @@ protected: const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, + GraphicsEngine *engine, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, diff --git a/panda/src/tinydisplay/tinyWinGraphicsWindow.cxx b/panda/src/tinydisplay/tinyWinGraphicsWindow.cxx index c5ccc5f35b..a755ccf7b8 100755 --- a/panda/src/tinydisplay/tinyWinGraphicsWindow.cxx +++ b/panda/src/tinydisplay/tinyWinGraphicsWindow.cxx @@ -33,14 +33,14 @@ TypeHandle TinyWinGraphicsWindow::_type_handle; // Description: //////////////////////////////////////////////////////////////////// TinyWinGraphicsWindow:: -TinyWinGraphicsWindow(GraphicsPipe *pipe, +TinyWinGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - WinGraphicsWindow(pipe, name, fb_prop, win_prop, flags, gsg, host) + WinGraphicsWindow(engine, pipe, name, fb_prop, win_prop, flags, gsg, host) { _frame_buffer = NULL; _hdc = (HDC)0; @@ -209,7 +209,7 @@ open_window() { TinyGraphicsStateGuardian *tinygsg; if (_gsg == 0) { // There is no old gsg. Create a new one. - tinygsg = new TinyGraphicsStateGuardian(_pipe, NULL); + tinygsg = new TinyGraphicsStateGuardian(_engine, _pipe, NULL); _gsg = tinygsg; } else { DCAST_INTO_R(tinygsg, _gsg, false); diff --git a/panda/src/tinydisplay/tinyWinGraphicsWindow.h b/panda/src/tinydisplay/tinyWinGraphicsWindow.h index 3a36b9f670..af776c5a4c 100755 --- a/panda/src/tinydisplay/tinyWinGraphicsWindow.h +++ b/panda/src/tinydisplay/tinyWinGraphicsWindow.h @@ -29,7 +29,7 @@ //////////////////////////////////////////////////////////////////// class EXPCL_TINYDISPLAY TinyWinGraphicsWindow : public WinGraphicsWindow { public: - TinyWinGraphicsWindow(GraphicsPipe *pipe, + TinyWinGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, diff --git a/panda/src/tinydisplay/tinyXGraphicsPipe.cxx b/panda/src/tinydisplay/tinyXGraphicsPipe.cxx index 05bbb2b8a0..b4d2b510b3 100644 --- a/panda/src/tinydisplay/tinyXGraphicsPipe.cxx +++ b/panda/src/tinydisplay/tinyXGraphicsPipe.cxx @@ -197,6 +197,7 @@ make_output(const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, + GraphicsEngine *engine, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, @@ -221,8 +222,8 @@ make_output(const string &name, ((flags&BF_can_bind_every)!=0)) { return NULL; } - return new TinyXGraphicsWindow(this, name, fb_prop, win_prop, - flags, gsg, host); + return new TinyXGraphicsWindow(engine, this, name, fb_prop, win_prop, + flags, gsg, host); } // Second thing to try: a TinyGraphicsBuffer @@ -234,7 +235,7 @@ make_output(const string &name, ((flags&BF_require_window)!=0)) { return NULL; } - return new TinyGraphicsBuffer(this, name, fb_prop, win_prop, flags, gsg, host); + return new TinyGraphicsBuffer(engine, this, name, fb_prop, win_prop, flags, gsg, host); } // Nothing else left to try. diff --git a/panda/src/tinydisplay/tinyXGraphicsPipe.h b/panda/src/tinydisplay/tinyXGraphicsPipe.h index aeca76e61d..434f385df8 100644 --- a/panda/src/tinydisplay/tinyXGraphicsPipe.h +++ b/panda/src/tinydisplay/tinyXGraphicsPipe.h @@ -85,6 +85,7 @@ protected: const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, + GraphicsEngine *engine, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, diff --git a/panda/src/tinydisplay/tinyXGraphicsWindow.cxx b/panda/src/tinydisplay/tinyXGraphicsWindow.cxx index d8153fc593..1c821d2618 100644 --- a/panda/src/tinydisplay/tinyXGraphicsWindow.cxx +++ b/panda/src/tinydisplay/tinyXGraphicsWindow.cxx @@ -50,14 +50,14 @@ TypeHandle TinyXGraphicsWindow::_type_handle; // Description: //////////////////////////////////////////////////////////////////// TinyXGraphicsWindow:: -TinyXGraphicsWindow(GraphicsPipe *pipe, - const string &name, - const FrameBufferProperties &fb_prop, - const WindowProperties &win_prop, - int flags, - GraphicsStateGuardian *gsg, - GraphicsOutput *host) : - GraphicsWindow(pipe, name, fb_prop, win_prop, flags, gsg, host) +TinyXGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, + const string &name, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, + GraphicsStateGuardian *gsg, + GraphicsOutput *host) : + GraphicsWindow(engine, pipe, name, fb_prop, win_prop, flags, gsg, host) { TinyXGraphicsPipe *tinyx_pipe; DCAST_INTO_V(tinyx_pipe, _pipe); @@ -647,7 +647,7 @@ open_window() { TinyGraphicsStateGuardian *tinygsg; if (_gsg == 0) { // There is no old gsg. Create a new one. - tinygsg = new TinyGraphicsStateGuardian(_pipe, NULL); + tinygsg = new TinyGraphicsStateGuardian(_engine, _pipe, NULL); _gsg = tinygsg; } else { DCAST_INTO_R(tinygsg, _gsg, false); diff --git a/panda/src/tinydisplay/tinyXGraphicsWindow.h b/panda/src/tinydisplay/tinyXGraphicsWindow.h index 60a9674719..b5570407c7 100644 --- a/panda/src/tinydisplay/tinyXGraphicsWindow.h +++ b/panda/src/tinydisplay/tinyXGraphicsWindow.h @@ -30,7 +30,7 @@ //////////////////////////////////////////////////////////////////// class EXPCL_TINYDISPLAY TinyXGraphicsWindow : public GraphicsWindow { public: - TinyXGraphicsWindow(GraphicsPipe *pipe, + TinyXGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, diff --git a/panda/src/wgldisplay/wglGraphicsBuffer.cxx b/panda/src/wgldisplay/wglGraphicsBuffer.cxx index b40a64cdfd..9a28f57386 100644 --- a/panda/src/wgldisplay/wglGraphicsBuffer.cxx +++ b/panda/src/wgldisplay/wglGraphicsBuffer.cxx @@ -29,14 +29,14 @@ TypeHandle wglGraphicsBuffer::_type_handle; // Description: //////////////////////////////////////////////////////////////////// wglGraphicsBuffer:: -wglGraphicsBuffer(GraphicsPipe *pipe, +wglGraphicsBuffer(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsBuffer(pipe, name, fb_prop, win_prop, flags, gsg, host) + GraphicsBuffer(engine, pipe, name, fb_prop, win_prop, flags, gsg, host) { _pbuffer = (HPBUFFERARB)0; _pbuffer_dc = (HDC)0; @@ -288,7 +288,7 @@ open_buffer() { wglGraphicsStateGuardian *wglgsg; if (_gsg == 0) { // There is no old gsg. Create a new one. - wglgsg = new wglGraphicsStateGuardian(_pipe, NULL); + wglgsg = new wglGraphicsStateGuardian(_engine, _pipe, NULL); wglgsg->choose_pixel_format(_fb_properties, true); _gsg = wglgsg; } else { @@ -298,7 +298,7 @@ open_buffer() { if ((!wglgsg->get_fb_properties().subsumes(_fb_properties))|| (!wglgsg->get_fb_properties().is_single_buffered())|| (!wglgsg->pfnum_supports_pbuffer())) { - wglgsg = new wglGraphicsStateGuardian(_pipe, wglgsg); + wglgsg = new wglGraphicsStateGuardian(_engine, _pipe, wglgsg); wglgsg->choose_pixel_format(_fb_properties, true); _gsg = wglgsg; } diff --git a/panda/src/wgldisplay/wglGraphicsBuffer.h b/panda/src/wgldisplay/wglGraphicsBuffer.h index 50221458d2..e1845a8b07 100644 --- a/panda/src/wgldisplay/wglGraphicsBuffer.h +++ b/panda/src/wgldisplay/wglGraphicsBuffer.h @@ -37,7 +37,7 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDAGL wglGraphicsBuffer : public GraphicsBuffer { public: - wglGraphicsBuffer(GraphicsPipe *pipe, + wglGraphicsBuffer(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, diff --git a/panda/src/wgldisplay/wglGraphicsPipe.cxx b/panda/src/wgldisplay/wglGraphicsPipe.cxx index 92b81a1ef3..49df3f9d48 100644 --- a/panda/src/wgldisplay/wglGraphicsPipe.cxx +++ b/panda/src/wgldisplay/wglGraphicsPipe.cxx @@ -107,6 +107,7 @@ make_output(const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, + GraphicsEngine *engine, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, @@ -148,7 +149,7 @@ make_output(const string &name, return NULL; } } - return new wglGraphicsWindow(this, name, fb_prop, win_prop, + return new wglGraphicsWindow(engine, this, name, fb_prop, win_prop, flags, gsg, host); } @@ -182,7 +183,7 @@ make_output(const string &name, (fb_prop.is_basic())) { precertify = true; } - return new GLGraphicsBuffer(this, name, fb_prop, win_prop, + return new GLGraphicsBuffer(engine, this, name, fb_prop, win_prop, flags, gsg, host); } @@ -215,7 +216,7 @@ make_output(const string &name, (wglgsg->get_fb_properties().is_single_buffered())) { precertify = true; } - return new wglGraphicsBuffer(this, name, fb_prop, win_prop, + return new wglGraphicsBuffer(engine, this, name, fb_prop, win_prop, flags, gsg, host); } diff --git a/panda/src/wgldisplay/wglGraphicsPipe.h b/panda/src/wgldisplay/wglGraphicsPipe.h index e3f04aae56..20af81b45f 100644 --- a/panda/src/wgldisplay/wglGraphicsPipe.h +++ b/panda/src/wgldisplay/wglGraphicsPipe.h @@ -39,6 +39,7 @@ protected: const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, + GraphicsEngine *engine, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, diff --git a/panda/src/wgldisplay/wglGraphicsStateGuardian.cxx b/panda/src/wgldisplay/wglGraphicsStateGuardian.cxx index 1967068774..3b0b225607 100755 --- a/panda/src/wgldisplay/wglGraphicsStateGuardian.cxx +++ b/panda/src/wgldisplay/wglGraphicsStateGuardian.cxx @@ -27,9 +27,9 @@ bool wglGraphicsStateGuardian::_twindow_class_registered = false; // Description: //////////////////////////////////////////////////////////////////// wglGraphicsStateGuardian:: -wglGraphicsStateGuardian(GraphicsPipe *pipe, +wglGraphicsStateGuardian(GraphicsEngine *engine, GraphicsPipe *pipe, wglGraphicsStateGuardian *share_with) : - GLGraphicsStateGuardian(pipe), + GLGraphicsStateGuardian(engine, pipe), _share_with(share_with) { _made_context = false; diff --git a/panda/src/wgldisplay/wglGraphicsStateGuardian.h b/panda/src/wgldisplay/wglGraphicsStateGuardian.h index 49fc4dbe0b..e472627866 100755 --- a/panda/src/wgldisplay/wglGraphicsStateGuardian.h +++ b/panda/src/wgldisplay/wglGraphicsStateGuardian.h @@ -30,7 +30,7 @@ //////////////////////////////////////////////////////////////////// class wglGraphicsStateGuardian : public GLGraphicsStateGuardian { public: - wglGraphicsStateGuardian(GraphicsPipe *pipe, + wglGraphicsStateGuardian(GraphicsEngine *engine, GraphicsPipe *pipe, wglGraphicsStateGuardian *share_with); virtual ~wglGraphicsStateGuardian(); diff --git a/panda/src/wgldisplay/wglGraphicsWindow.cxx b/panda/src/wgldisplay/wglGraphicsWindow.cxx index ad24f67638..815d095e63 100644 --- a/panda/src/wgldisplay/wglGraphicsWindow.cxx +++ b/panda/src/wgldisplay/wglGraphicsWindow.cxx @@ -29,14 +29,14 @@ TypeHandle wglGraphicsWindow::_type_handle; // Description: //////////////////////////////////////////////////////////////////// wglGraphicsWindow:: -wglGraphicsWindow(GraphicsPipe *pipe, +wglGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - WinGraphicsWindow(pipe, name, fb_prop, win_prop, flags, gsg, host) + WinGraphicsWindow(engine, pipe, name, fb_prop, win_prop, flags, gsg, host) { _hdc = (HDC)0; } @@ -180,7 +180,7 @@ open_window() { wglGraphicsStateGuardian *wglgsg; if (_gsg == 0) { // There is no old gsg. Create a new one. - wglgsg = new wglGraphicsStateGuardian(_pipe, NULL); + wglgsg = new wglGraphicsStateGuardian(_engine, _pipe, NULL); wglgsg->choose_pixel_format(_fb_properties, false); _gsg = wglgsg; } else { @@ -188,7 +188,7 @@ open_window() { // new one that shares with the old gsg. DCAST_INTO_R(wglgsg, _gsg, false); if (!wglgsg->get_fb_properties().subsumes(_fb_properties)) { - wglgsg = new wglGraphicsStateGuardian(_pipe, wglgsg); + wglgsg = new wglGraphicsStateGuardian(_engine, _pipe, wglgsg); wglgsg->choose_pixel_format(_fb_properties, false); _gsg = wglgsg; } diff --git a/panda/src/wgldisplay/wglGraphicsWindow.h b/panda/src/wgldisplay/wglGraphicsWindow.h index 537f1f62f7..9c0d526ca5 100644 --- a/panda/src/wgldisplay/wglGraphicsWindow.h +++ b/panda/src/wgldisplay/wglGraphicsWindow.h @@ -25,7 +25,7 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDAGL wglGraphicsWindow : public WinGraphicsWindow { public: - wglGraphicsWindow(GraphicsPipe *pipe, + wglGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, diff --git a/panda/src/windisplay/winGraphicsWindow.cxx b/panda/src/windisplay/winGraphicsWindow.cxx index 4f52a78df9..e596fd8221 100644 --- a/panda/src/windisplay/winGraphicsWindow.cxx +++ b/panda/src/windisplay/winGraphicsWindow.cxx @@ -82,14 +82,14 @@ static tRegisterRawInputDevices pRegisterRawInputDevices; // Description: //////////////////////////////////////////////////////////////////// WinGraphicsWindow:: -WinGraphicsWindow(GraphicsPipe *pipe, +WinGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsWindow(pipe, name, fb_prop, win_prop, flags, gsg, host) + GraphicsWindow(engine, pipe, name, fb_prop, win_prop, flags, gsg, host) { initialize_input_devices(); _hWnd = (HWND)0; diff --git a/panda/src/windisplay/winGraphicsWindow.h b/panda/src/windisplay/winGraphicsWindow.h index ace59d2b0a..82da55edcd 100644 --- a/panda/src/windisplay/winGraphicsWindow.h +++ b/panda/src/windisplay/winGraphicsWindow.h @@ -41,7 +41,7 @@ class WinGraphicsPipe; //////////////////////////////////////////////////////////////////// class EXPCL_PANDAWIN WinGraphicsWindow : public GraphicsWindow { public: - WinGraphicsWindow(GraphicsPipe *pipe, + WinGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop,