| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "imodule.h" |
| 4 |
|
| 5 |
namespace wxutil { class GLWidget; } |
| 6 |
|
| 7 |
namespace ui |
| 8 |
{ |
| 9 |
|
| 10 |
// Application wide manager for wxGLWidgets |
| 11 |
// All GLWidgets need to register themselves to this module |
| 12 |
// since the shared wxGLContext creation will be bound to |
| 13 |
// the first registered widget |
| 14 |
class IWxGLWidgetManager : |
| 15 |
public RegisterableModule |
| 16 |
{ |
| 17 |
public: |
| 18 |
/// Registers a GL widget, storing the shared context if necessary |
| 19 |
virtual void registerGLWidget(wxutil::GLWidget* widget) = 0; |
| 20 |
|
| 21 |
/// Notifies the GL module that a GLWidget has been destroyed |
| 22 |
virtual void unregisterGLWidget(wxutil::GLWidget* widget) = 0; |
| 23 |
}; |
| 24 |
|
| 25 |
} |
| 26 |
|
| 27 |
const char* const MODULE_WXGLWIDGET_MANAGER("wxGLWidgetManager"); |
| 28 |
|
| 29 |
inline ui::IWxGLWidgetManager& GlobalWxGlWidgetManager() |
| 30 |
{ |
| 31 |
static module::InstanceReference<ui::IWxGLWidgetManager> _reference(MODULE_WXGLWIDGET_MANAGER); |
| 32 |
return _reference; |
| 33 |
} |