From 779fceafdd224bd5ae5ddbaf02d2216b2ff7271a Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 20 Nov 2012 12:11:14 +0000 Subject: [PATCH] make_callback_gsg() --- panda/src/cocoadisplay/cocoaGraphicsPipe.h | 1 + panda/src/cocoadisplay/cocoaGraphicsPipe.mm | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/panda/src/cocoadisplay/cocoaGraphicsPipe.h b/panda/src/cocoadisplay/cocoaGraphicsPipe.h index 0b0ef7a8df..f13f09fd23 100644 --- a/panda/src/cocoadisplay/cocoaGraphicsPipe.h +++ b/panda/src/cocoadisplay/cocoaGraphicsPipe.h @@ -62,6 +62,7 @@ protected: GraphicsOutput *host, int retry, bool &precertify); + virtual PT(GraphicsStateGuardian) make_callback_gsg(GraphicsEngine *engine); private: void load_display_information(); diff --git a/panda/src/cocoadisplay/cocoaGraphicsPipe.mm b/panda/src/cocoadisplay/cocoaGraphicsPipe.mm index fb83d75718..d172a436b2 100644 --- a/panda/src/cocoadisplay/cocoaGraphicsPipe.mm +++ b/panda/src/cocoadisplay/cocoaGraphicsPipe.mm @@ -380,3 +380,17 @@ make_output(const string &name, // Nothing else left to try. return NULL; } + +//////////////////////////////////////////////////////////////////// +// Function: CocoaGraphicsPipe::make_callback_gsg +// Access: Protected, Virtual +// Description: This is called when make_output() is used to create a +// CallbackGraphicsWindow. If the GraphicsPipe can +// construct a GSG that's not associated with any +// particular window object, do so now, assuming the +// correct graphics context has been set up externally. +//////////////////////////////////////////////////////////////////// +PT(GraphicsStateGuardian) CocoaGraphicsPipe:: +make_callback_gsg(GraphicsEngine *engine) { + return new CocoaGraphicsStateGuardian(engine, this, NULL); +}