#include "../base/SRC_FIRST.hpp" #include "render_context.hpp" namespace graphics { void RenderContext::setMatrix(EMatrix mt, TMatrix const & m) { m_matrices[mt] = m; } RenderContext::TMatrix const & RenderContext::matrix(EMatrix m) const { map::const_iterator it = m_matrices.find(m); return it->second; } void RenderContext::startThreadDrawing(unsigned threadSlot) { ASSERT(m_threadSlot == -1, ()); m_threadSlot = threadSlot; } void RenderContext::endThreadDrawing(unsigned threadSlot) { ASSERT(m_threadSlot != -1, ()); m_threadSlot = -1; } RenderContext::RenderContext() : m_threadSlot(-1) { setMatrix(EModelView, math::Identity()); setMatrix(EProjection, math::Identity()); } RenderContext::~RenderContext() {} void RenderContext::setResourceManager(const shared_ptr &rm) { m_resourceManager = rm; } shared_ptr const & RenderContext::resourceManager() const { return m_resourceManager; } unsigned RenderContext::threadSlot() const { return m_threadSlot; } }