mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
pass GraphicsEngine to constructors
This commit is contained in:
parent
7af1350e4e
commit
62096c99a4
@ -26,14 +26,14 @@ TypeHandle osxGraphicsBuffer::_type_handle;
|
|||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
osxGraphicsBuffer::
|
osxGraphicsBuffer::
|
||||||
osxGraphicsBuffer(GraphicsPipe *pipe,
|
osxGraphicsBuffer(GraphicsEngine *engine, GraphicsPipe *pipe,
|
||||||
const string &name,
|
const string &name,
|
||||||
const FrameBufferProperties &fb_prop,
|
const FrameBufferProperties &fb_prop,
|
||||||
const WindowProperties &win_prop,
|
const WindowProperties &win_prop,
|
||||||
int flags,
|
int flags,
|
||||||
GraphicsStateGuardian *gsg,
|
GraphicsStateGuardian *gsg,
|
||||||
GraphicsOutput *host) :
|
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;
|
osxGraphicsPipe *osx_pipe;
|
||||||
DCAST_INTO_V(osx_pipe, _pipe);
|
DCAST_INTO_V(osx_pipe, _pipe);
|
||||||
@ -142,7 +142,7 @@ bool osxGraphicsBuffer::
|
|||||||
open_buffer() {
|
open_buffer() {
|
||||||
|
|
||||||
if (_gsg == 0) {
|
if (_gsg == 0) {
|
||||||
_gsg = new osxGraphicsStateGuardian(_pipe, NULL);
|
_gsg = new osxGraphicsStateGuardian(_engine, _pipe, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
class EXPCL_PANDAGL osxGraphicsBuffer : public GraphicsBuffer {
|
class EXPCL_PANDAGL osxGraphicsBuffer : public GraphicsBuffer {
|
||||||
public:
|
public:
|
||||||
osxGraphicsBuffer(GraphicsPipe *pipe,
|
osxGraphicsBuffer(GraphicsEngine *engine, GraphicsPipe *pipe,
|
||||||
const string &name,
|
const string &name,
|
||||||
const FrameBufferProperties &fb_prop,
|
const FrameBufferProperties &fb_prop,
|
||||||
const WindowProperties &win_prop,
|
const WindowProperties &win_prop,
|
||||||
|
@ -207,6 +207,7 @@ make_output(const string &name,
|
|||||||
const FrameBufferProperties &fb_prop,
|
const FrameBufferProperties &fb_prop,
|
||||||
const WindowProperties &win_prop,
|
const WindowProperties &win_prop,
|
||||||
int flags,
|
int flags,
|
||||||
|
GraphicsEngine *engine,
|
||||||
GraphicsStateGuardian *gsg,
|
GraphicsStateGuardian *gsg,
|
||||||
GraphicsOutput *host,
|
GraphicsOutput *host,
|
||||||
int retry,
|
int retry,
|
||||||
@ -232,7 +233,7 @@ make_output(const string &name,
|
|||||||
((flags&BF_can_bind_every)!=0)) {
|
((flags&BF_can_bind_every)!=0)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return new osxGraphicsWindow(this, name, fb_prop, win_prop,
|
return new osxGraphicsWindow(engine, this, name, fb_prop, win_prop,
|
||||||
flags, gsg, host);
|
flags, gsg, host);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ protected:
|
|||||||
const FrameBufferProperties &fb_prop,
|
const FrameBufferProperties &fb_prop,
|
||||||
const WindowProperties &win_prop,
|
const WindowProperties &win_prop,
|
||||||
int flags,
|
int flags,
|
||||||
|
GraphicsEngine *engine,
|
||||||
GraphicsStateGuardian *gsg,
|
GraphicsStateGuardian *gsg,
|
||||||
GraphicsOutput *host,
|
GraphicsOutput *host,
|
||||||
int retry,
|
int retry,
|
||||||
|
@ -61,9 +61,9 @@ void *osxGraphicsStateGuardian::get_extension_func(const char *prefix, const cha
|
|||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
osxGraphicsStateGuardian::
|
osxGraphicsStateGuardian::
|
||||||
osxGraphicsStateGuardian(GraphicsPipe *pipe,
|
osxGraphicsStateGuardian(GraphicsEngine *engine, GraphicsPipe *pipe,
|
||||||
osxGraphicsStateGuardian *share_with) :
|
osxGraphicsStateGuardian *share_with) :
|
||||||
GLGraphicsStateGuardian(pipe),
|
GLGraphicsStateGuardian(engine, pipe),
|
||||||
_share_with(share_with),
|
_share_with(share_with),
|
||||||
_aglPixFmt(NULL),
|
_aglPixFmt(NULL),
|
||||||
_aglcontext(NULL)
|
_aglcontext(NULL)
|
||||||
|
@ -33,7 +33,7 @@ class osxGraphicsWindow;
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
class osxGraphicsStateGuardian : public GLGraphicsStateGuardian {
|
class osxGraphicsStateGuardian : public GLGraphicsStateGuardian {
|
||||||
public:
|
public:
|
||||||
osxGraphicsStateGuardian(GraphicsPipe *pipe,
|
osxGraphicsStateGuardian(GraphicsEngine *engine, GraphicsPipe *pipe,
|
||||||
osxGraphicsStateGuardian *share_with);
|
osxGraphicsStateGuardian *share_with);
|
||||||
virtual ~osxGraphicsStateGuardian();
|
virtual ~osxGraphicsStateGuardian();
|
||||||
virtual void reset();
|
virtual void reset();
|
||||||
|
@ -33,7 +33,7 @@ OSStatus aglReportError (const std::string &);
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
class osxGraphicsWindow : public GraphicsWindow {
|
class osxGraphicsWindow : public GraphicsWindow {
|
||||||
public:
|
public:
|
||||||
osxGraphicsWindow(GraphicsPipe *pipe,
|
osxGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe,
|
||||||
const string &name,
|
const string &name,
|
||||||
const FrameBufferProperties &fb_prop,
|
const FrameBufferProperties &fb_prop,
|
||||||
const WindowProperties &win_prop,
|
const WindowProperties &win_prop,
|
||||||
|
@ -600,14 +600,14 @@ static int id_seed = 100;
|
|||||||
// Access: Public
|
// Access: Public
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
osxGraphicsWindow::osxGraphicsWindow(GraphicsPipe *pipe,
|
osxGraphicsWindow::osxGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe,
|
||||||
const string &name,
|
const string &name,
|
||||||
const FrameBufferProperties &fb_prop,
|
const FrameBufferProperties &fb_prop,
|
||||||
const WindowProperties &win_prop,
|
const WindowProperties &win_prop,
|
||||||
int flags,
|
int flags,
|
||||||
GraphicsStateGuardian *gsg,
|
GraphicsStateGuardian *gsg,
|
||||||
GraphicsOutput *host) :
|
GraphicsOutput *host) :
|
||||||
GraphicsWindow(pipe, name, fb_prop, win_prop, flags, gsg, host),
|
GraphicsWindow(engine, pipe, name, fb_prop, win_prop, flags, gsg, host),
|
||||||
_osx_window(NULL),
|
_osx_window(NULL),
|
||||||
_is_fullscreen(false),
|
_is_fullscreen(false),
|
||||||
_pending_icon(NULL),
|
_pending_icon(NULL),
|
||||||
@ -1020,7 +1020,7 @@ bool osxGraphicsWindow::open_window()
|
|||||||
|
|
||||||
if (_gsg == 0)
|
if (_gsg == 0)
|
||||||
{
|
{
|
||||||
_gsg = new osxGraphicsStateGuardian(_pipe, NULL);
|
_gsg = new osxGraphicsStateGuardian(_engine, _pipe, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
//OSXGloablMutex().lock();
|
//OSXGloablMutex().lock();
|
||||||
|
@ -200,6 +200,7 @@ make_output(const string &name,
|
|||||||
const FrameBufferProperties &fb_prop,
|
const FrameBufferProperties &fb_prop,
|
||||||
const WindowProperties &win_prop,
|
const WindowProperties &win_prop,
|
||||||
int flags,
|
int flags,
|
||||||
|
GraphicsEngine *engine,
|
||||||
GraphicsStateGuardian *gsg,
|
GraphicsStateGuardian *gsg,
|
||||||
GraphicsOutput *host,
|
GraphicsOutput *host,
|
||||||
int retry,
|
int retry,
|
||||||
@ -233,7 +234,7 @@ make_output(const string &name,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new TinyOsxGraphicsWindow(this, name, fb_prop, win_prop,
|
return new TinyOsxGraphicsWindow(engine, this, name, fb_prop, win_prop,
|
||||||
flags, gsg, host);
|
flags, gsg, host);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,7 +244,7 @@ make_output(const string &name,
|
|||||||
((flags&BF_require_window)!=0)) {
|
((flags&BF_require_window)!=0)) {
|
||||||
return NULL;
|
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.
|
// Nothing else left to try.
|
||||||
|
@ -50,6 +50,7 @@ protected:
|
|||||||
const FrameBufferProperties &fb_prop,
|
const FrameBufferProperties &fb_prop,
|
||||||
const WindowProperties &win_prop,
|
const WindowProperties &win_prop,
|
||||||
int flags,
|
int flags,
|
||||||
|
GraphicsEngine *engine,
|
||||||
GraphicsStateGuardian *gsg,
|
GraphicsStateGuardian *gsg,
|
||||||
GraphicsOutput *host,
|
GraphicsOutput *host,
|
||||||
int retry,
|
int retry,
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
class TinyOsxGraphicsWindow : public GraphicsWindow {
|
class TinyOsxGraphicsWindow : public GraphicsWindow {
|
||||||
public:
|
public:
|
||||||
TinyOsxGraphicsWindow(GraphicsPipe *pipe,
|
TinyOsxGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe,
|
||||||
const string &name,
|
const string &name,
|
||||||
const FrameBufferProperties &fb_prop,
|
const FrameBufferProperties &fb_prop,
|
||||||
const WindowProperties &win_prop,
|
const WindowProperties &win_prop,
|
||||||
|
@ -480,14 +480,14 @@ static int id_seed = 100;
|
|||||||
// Access: Public
|
// Access: Public
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
TinyOsxGraphicsWindow::TinyOsxGraphicsWindow(GraphicsPipe *pipe,
|
TinyOsxGraphicsWindow::TinyOsxGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe,
|
||||||
const string &name,
|
const string &name,
|
||||||
const FrameBufferProperties &fb_prop,
|
const FrameBufferProperties &fb_prop,
|
||||||
const WindowProperties &win_prop,
|
const WindowProperties &win_prop,
|
||||||
int flags,
|
int flags,
|
||||||
GraphicsStateGuardian *gsg,
|
GraphicsStateGuardian *gsg,
|
||||||
GraphicsOutput *host) :
|
GraphicsOutput *host) :
|
||||||
GraphicsWindow(pipe, name, fb_prop, win_prop, flags, gsg, host),
|
GraphicsWindow(engine, pipe, name, fb_prop, win_prop, flags, gsg, host),
|
||||||
_osx_window(NULL),
|
_osx_window(NULL),
|
||||||
_is_fullscreen(false),
|
_is_fullscreen(false),
|
||||||
_pending_icon(NULL),
|
_pending_icon(NULL),
|
||||||
@ -801,7 +801,7 @@ bool TinyOsxGraphicsWindow::open_window()
|
|||||||
TinyGraphicsStateGuardian *tinygsg;
|
TinyGraphicsStateGuardian *tinygsg;
|
||||||
if (_gsg == 0) {
|
if (_gsg == 0) {
|
||||||
// There is no old gsg. Create a new one.
|
// There is no old gsg. Create a new one.
|
||||||
tinygsg = new TinyGraphicsStateGuardian(_pipe, NULL);
|
tinygsg = new TinyGraphicsStateGuardian(_engine, _pipe, NULL);
|
||||||
_gsg = tinygsg;
|
_gsg = tinygsg;
|
||||||
} else {
|
} else {
|
||||||
DCAST_INTO_R(tinygsg, _gsg, false);
|
DCAST_INTO_R(tinygsg, _gsg, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user