pass GraphicsEngine to constructors

This commit is contained in:
David Rose 2009-02-25 23:08:10 +00:00
parent 7af1350e4e
commit 62096c99a4
12 changed files with 34 additions and 30 deletions

View File

@ -26,14 +26,14 @@ TypeHandle osxGraphicsBuffer::_type_handle;
// Description:
////////////////////////////////////////////////////////////////////
osxGraphicsBuffer::
osxGraphicsBuffer(GraphicsPipe *pipe,
osxGraphicsBuffer(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)
{
osxGraphicsPipe *osx_pipe;
DCAST_INTO_V(osx_pipe, _pipe);
@ -142,7 +142,7 @@ bool osxGraphicsBuffer::
open_buffer() {
if (_gsg == 0) {
_gsg = new osxGraphicsStateGuardian(_pipe, NULL);
_gsg = new osxGraphicsStateGuardian(_engine, _pipe, NULL);
}
return false;

View File

@ -30,7 +30,7 @@
////////////////////////////////////////////////////////////////////
class EXPCL_PANDAGL osxGraphicsBuffer : public GraphicsBuffer {
public:
osxGraphicsBuffer(GraphicsPipe *pipe,
osxGraphicsBuffer(GraphicsEngine *engine, GraphicsPipe *pipe,
const string &name,
const FrameBufferProperties &fb_prop,
const WindowProperties &win_prop,

View File

@ -207,6 +207,7 @@ make_output(const string &name,
const FrameBufferProperties &fb_prop,
const WindowProperties &win_prop,
int flags,
GraphicsEngine *engine,
GraphicsStateGuardian *gsg,
GraphicsOutput *host,
int retry,
@ -232,7 +233,7 @@ make_output(const string &name,
((flags&BF_can_bind_every)!=0)) {
return NULL;
}
return new osxGraphicsWindow(this, name, fb_prop, win_prop,
return new osxGraphicsWindow(engine, this, name, fb_prop, win_prop,
flags, gsg, host);
}

View File

@ -45,6 +45,7 @@ protected:
const FrameBufferProperties &fb_prop,
const WindowProperties &win_prop,
int flags,
GraphicsEngine *engine,
GraphicsStateGuardian *gsg,
GraphicsOutput *host,
int retry,

View File

@ -61,9 +61,9 @@ void *osxGraphicsStateGuardian::get_extension_func(const char *prefix, const cha
// Description:
////////////////////////////////////////////////////////////////////
osxGraphicsStateGuardian::
osxGraphicsStateGuardian(GraphicsPipe *pipe,
osxGraphicsStateGuardian(GraphicsEngine *engine, GraphicsPipe *pipe,
osxGraphicsStateGuardian *share_with) :
GLGraphicsStateGuardian(pipe),
GLGraphicsStateGuardian(engine, pipe),
_share_with(share_with),
_aglPixFmt(NULL),
_aglcontext(NULL)

View File

@ -33,7 +33,7 @@ class osxGraphicsWindow;
////////////////////////////////////////////////////////////////////
class osxGraphicsStateGuardian : public GLGraphicsStateGuardian {
public:
osxGraphicsStateGuardian(GraphicsPipe *pipe,
osxGraphicsStateGuardian(GraphicsEngine *engine, GraphicsPipe *pipe,
osxGraphicsStateGuardian *share_with);
virtual ~osxGraphicsStateGuardian();
virtual void reset();

View File

@ -33,7 +33,7 @@ OSStatus aglReportError (const std::string &);
////////////////////////////////////////////////////////////////////
class osxGraphicsWindow : public GraphicsWindow {
public:
osxGraphicsWindow(GraphicsPipe *pipe,
osxGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe,
const string &name,
const FrameBufferProperties &fb_prop,
const WindowProperties &win_prop,

View File

@ -600,14 +600,14 @@ static int id_seed = 100;
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
osxGraphicsWindow::osxGraphicsWindow(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),
osxGraphicsWindow::osxGraphicsWindow(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),
_osx_window(NULL),
_is_fullscreen(false),
_pending_icon(NULL),
@ -1020,7 +1020,7 @@ bool osxGraphicsWindow::open_window()
if (_gsg == 0)
{
_gsg = new osxGraphicsStateGuardian(_pipe, NULL);
_gsg = new osxGraphicsStateGuardian(_engine, _pipe, NULL);
}
//OSXGloablMutex().lock();

View File

@ -200,6 +200,7 @@ make_output(const string &name,
const FrameBufferProperties &fb_prop,
const WindowProperties &win_prop,
int flags,
GraphicsEngine *engine,
GraphicsStateGuardian *gsg,
GraphicsOutput *host,
int retry,
@ -233,7 +234,7 @@ make_output(const string &name,
return NULL;
}
}
return new TinyOsxGraphicsWindow(this, name, fb_prop, win_prop,
return new TinyOsxGraphicsWindow(engine, this, name, fb_prop, win_prop,
flags, gsg, host);
}
@ -243,7 +244,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.

View File

@ -50,6 +50,7 @@ protected:
const FrameBufferProperties &fb_prop,
const WindowProperties &win_prop,
int flags,
GraphicsEngine *engine,
GraphicsStateGuardian *gsg,
GraphicsOutput *host,
int retry,

View File

@ -32,7 +32,7 @@
////////////////////////////////////////////////////////////////////
class TinyOsxGraphicsWindow : public GraphicsWindow {
public:
TinyOsxGraphicsWindow(GraphicsPipe *pipe,
TinyOsxGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe,
const string &name,
const FrameBufferProperties &fb_prop,
const WindowProperties &win_prop,

View File

@ -480,14 +480,14 @@ static int id_seed = 100;
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
TinyOsxGraphicsWindow::TinyOsxGraphicsWindow(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),
TinyOsxGraphicsWindow::TinyOsxGraphicsWindow(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),
_osx_window(NULL),
_is_fullscreen(false),
_pending_icon(NULL),
@ -801,7 +801,7 @@ bool TinyOsxGraphicsWindow::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);