Commit ae3527b0 authored by Jan Möbius's avatar Jan Möbius

More work on rendermanager

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12278 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 8d121a0c
......@@ -54,8 +54,6 @@ RenderManager& renderManager() {
RenderManager::RenderManager() {
availableRenderers_.clear();
std::cerr << "Render Manager Constructor" << std::endl;
}
bool RenderManager::rendererExists(QString _name) {
......@@ -92,3 +90,39 @@ RendererInfo* RenderManager::getRenderer(QString _name) {
return 0;
}
int RenderManager::countRenderers(ACG::SceneGraph::DrawModes::DrawMode _mode) {
int renderers = 0;
// Skip first one as it is the default renderer
for ( unsigned int i = 1 ; i < availableRenderers_.size() ; ++i)
if ( (availableRenderers_[i].modes & _mode) )
renderers++;
std::cerr << "Found " << renderers << " Renderers" << std::endl;
return renderers;
}
std::vector<int> RenderManager::getRendererIds(ACG::SceneGraph::DrawModes::DrawMode _mode){
std::vector <int> renderers;
// Skip first one as it is the default renderer
for ( unsigned int i = 1 ; i < availableRenderers_.size() ; ++i)
if ( (availableRenderers_[i].modes & _mode) )
renderers.push_back(i);
return renderers;
}
RendererInfo* RenderManager::operator[](unsigned int _id) {
if ( _id >= availableRenderers_.size())
return 0;
else
return &availableRenderers_[_id];
}
......@@ -96,6 +96,20 @@ class RenderManager {
*/
RendererInfo* getRenderer(QString _name);
/** \brief count renderers for a DrawMode (excluding the default renderer)
*
* Checks in the list of renderers how many support the given draw mode combination.
* The combination is checked as one complete block.
*
* @param _mode The mode that should be checked.
*
*/
int countRenderers(ACG::SceneGraph::DrawModes::DrawMode _mode);
std::vector<int> getRendererIds(ACG::SceneGraph::DrawModes::DrawMode _mode);
RendererInfo* operator[](unsigned int _id);
private:
std::vector<RendererInfo> availableRenderers_;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment