Track the (per-thread) active `GHOST_Context`. This is required to restore the active context after creating a new one if the current context is unknown. (Required for creating GPU contexts in the GPU module without depending on the WM module) Pull Request: https://projects.blender.org/blender/blender/pulls/136992
58 lines
1.0 KiB
C++
58 lines
1.0 KiB
C++
/* SPDX-FileCopyrightText: 2013 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup GHOST
|
|
*
|
|
* Definition of GHOST_ContextNone class.
|
|
*/
|
|
|
|
#include "GHOST_ContextNone.hh"
|
|
|
|
GHOST_TSuccess GHOST_ContextNone::swapBuffers()
|
|
{
|
|
return GHOST_kSuccess;
|
|
}
|
|
|
|
GHOST_TSuccess GHOST_ContextNone::activateDrawingContext()
|
|
{
|
|
active_context_ = this;
|
|
return GHOST_kSuccess;
|
|
}
|
|
|
|
GHOST_TSuccess GHOST_ContextNone::releaseDrawingContext()
|
|
{
|
|
active_context_ = nullptr;
|
|
return GHOST_kSuccess;
|
|
}
|
|
|
|
GHOST_TSuccess GHOST_ContextNone::updateDrawingContext()
|
|
{
|
|
return GHOST_kSuccess;
|
|
}
|
|
|
|
GHOST_TSuccess GHOST_ContextNone::initializeDrawingContext()
|
|
{
|
|
active_context_ = this;
|
|
return GHOST_kSuccess;
|
|
}
|
|
|
|
GHOST_TSuccess GHOST_ContextNone::releaseNativeHandles()
|
|
{
|
|
return GHOST_kSuccess;
|
|
}
|
|
|
|
GHOST_TSuccess GHOST_ContextNone::setSwapInterval(int interval)
|
|
{
|
|
m_swapInterval = interval;
|
|
|
|
return GHOST_kSuccess;
|
|
}
|
|
|
|
GHOST_TSuccess GHOST_ContextNone::getSwapInterval(int &intervalOut)
|
|
{
|
|
intervalOut = m_swapInterval;
|
|
return GHOST_kSuccess;
|
|
}
|