| 1341 | } |
| 1342 | |
| 1343 | void OnContextEvent(void* context, RenderContextEvent event_type) |
| 1344 | { |
| 1345 | RenderContext* render_context = (RenderContext*)context; |
| 1346 | if (event_type == dmRender::CONTEXT_LOST) |
| 1347 | { |
| 1348 | SetRenderPause(render_context, 1u); |
| 1349 | dmGraphics::InvalidateGraphicsHandles(render_context->m_GraphicsContext); |
| 1350 | } |
| 1351 | if (render_context->m_CallbackInfo != 0x0) |
| 1352 | { |
| 1353 | dmScript::LuaCallbackInfo* cbk = render_context->m_CallbackInfo; |
| 1354 | if (!dmScript::IsCallbackValid(cbk)) |
| 1355 | { |
| 1356 | return; |
| 1357 | } |
| 1358 | lua_State* L = dmScript::GetCallbackLuaContext(cbk); |
| 1359 | DM_LUA_STACK_CHECK(L, 0); |
| 1360 | |
| 1361 | if (!dmScript::SetupCallback(cbk)) |
| 1362 | { |
| 1363 | return; |
| 1364 | } |
| 1365 | lua_pushinteger(L, event_type); |
| 1366 | int ret = dmScript::PCall(L, 2, 0); |
| 1367 | (void)ret; |
| 1368 | dmScript::TeardownCallback(cbk); |
| 1369 | } |
| 1370 | } |
| 1371 | |
| 1372 | void SetRenderPause(HRenderContext context, uint8_t is_paused) |
| 1373 | { |
nothing calls this directly
no test coverage detected