Skip to content
Snippets Groups Projects
Commit 4c453ec4 authored by D-AIRY's avatar D-AIRY
Browse files

Observer changed event

parent 3beb593a
No related branches found
No related tags found
No related merge requests found
......@@ -123,6 +123,7 @@ CEngine::CEngine(int argc, char **argv, const char *szName)
INIT_OUTPUT_STREAM(m_pCore);
LibReport(REPORT_MSG_LEVEL_NOTICE, "LIB core initialized\n");
m_pObserverChangedEventChannel = m_pCore->getEventChannel<XEventObserverChanged>(EVENT_OBSERVER_CHANGED_GUID);
Core_0RegisterCVarString("engine_version", SKYXENGINE_VERSION, "Текущая версия движка", FCVAR_READONLY);
......@@ -382,9 +383,14 @@ bool CEngine::runFrame()
if(pRenderContext)
{
SRender_SetCamera(m_pCallback->getCameraForFrame());
ICamera *pCamera = m_pCallback->getCameraForFrame();
SRender_SetCamera(pCamera);
SRender_UpdateView();
XEventObserverChanged ev;
ev.pCamera = pCamera;
m_pObserverChangedEventChannel->broadcastEvent(&ev);
IXRenderPipeline *pRenderPipeline;
m_pCore->getRenderPipeline(&pRenderPipeline);
......
......@@ -55,6 +55,8 @@ protected:
IXUI *m_pXUI = NULL;
IEventChannel<XEventObserverChanged> *m_pObserverChangedEventChannel = NULL;
#ifdef USE_BREAKPAD
google_breakpad::ExceptionHandler *m_pBreakpadHandler = NULL;
#endif
......
......@@ -222,4 +222,14 @@ struct XEventCvarChanged
const void *pCvar;
};
// {5CEC2355-1F1E-4A1D-8E69-5B92850B62D2}
#define EVENT_OBSERVER_CHANGED_GUID DEFINE_XGUID(0x5cec2355, 0x1f1e, 0x4a1d, 0x8e, 0x69, 0x5b, 0x92, 0x85, 0xb, 0x62, 0xd2)
class ICamera;
struct XEventObserverChanged
{
ICamera *pCamera;
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment