Commit 77ad9c6d authored by Eric Bruneton's avatar Eric Bruneton
Browse files

removed getOffscreenBuffer method in SetTargetTask

extended SetTransformsTask to support module names without prefix

git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/ork/trunk@23 28599a00-4e59-401b-b2d8-d34d4661a6c9
parent f5df23af
......@@ -32,8 +32,6 @@ namespace ork
BufferId getBufferFromName(const char *v);
static_ptr<FrameBuffer> SetTargetTask::FRAME_BUFFER;
static_ptr<FrameBuffer> SetTargetTask::TARGET_BUFFER;
SetTargetTask::SetTargetTask() : AbstractTask("SetTargetTask")
......@@ -102,28 +100,12 @@ ptr<Task> SetTargetTask::getTask(ptr<Object> context)
return new Impl(this, textures);
}
ptr<FrameBuffer> SetTargetTask::getOffscreenBuffer()
{
if (FRAME_BUFFER == NULL) {
FRAME_BUFFER = new FrameBuffer();
ptr<FrameBuffer> fb = SceneManager::getCurrentFrameBuffer();
SceneManager::setCurrentFrameBuffer(FRAME_BUFFER);
FRAME_BUFFER->setReadBuffer(BufferId(0));
FRAME_BUFFER->setDrawBuffer(BufferId(0));
SceneManager::setCurrentFrameBuffer(fb);
}
return FRAME_BUFFER;
}
ptr<FrameBuffer> SetTargetTask::getTargetBuffer()
{
if (TARGET_BUFFER == NULL) {
ptr<FrameBuffer> fb = SceneManager::getCurrentFrameBuffer();
TARGET_BUFFER = new FrameBuffer();
SceneManager::setCurrentFrameBuffer(TARGET_BUFFER);
TARGET_BUFFER->setReadBuffer(BufferId(0));
TARGET_BUFFER->setDrawBuffer(BufferId(0));
SceneManager::setCurrentFrameBuffer(fb);
}
return TARGET_BUFFER;
}
......
......@@ -82,11 +82,6 @@ public:
virtual ptr<Task> getTask(ptr<Object> context);
/**
* Returns a shared offscreen framebuffer.
*/
static ptr<FrameBuffer> getOffscreenBuffer();
protected:
/**
* Creates an uninitialized SetTargetTask.
......@@ -110,11 +105,6 @@ protected:
void swap(ptr<SetTargetTask> t);
private:
/**
* An offscreen framebuffer.
*/
static static_ptr<FrameBuffer> FRAME_BUFFER;
/**
* An offscreen framebuffer for use with SetTargetTask.
*/
......
......@@ -92,14 +92,22 @@ ptr<Task> SetTransformsTask::getTask(ptr<Object> context)
if (m.target.size() > 0 && module == NULL) {
module = m.getTarget(n)->getModule(m.name);
if (module == NULL) {
if (Logger::ERROR_LOGGER != NULL) {
Logger::ERROR_LOGGER->log("SCENEGRAPH", "SetTransforms: cannot find " + m.name + " node");
Logger::ERROR_LOGGER->log("SCENEGRAPH", "SetTransforms: cannot find " + m.target + "." + m.name + " module");
}
throw exception();
}
} else if (m.name.size() > 0 && module == NULL) {
module = n->getOwner()->getResourceManager()->loadResource(m.name).cast<Module>();
if (module == NULL) {
if (Logger::ERROR_LOGGER != NULL) {
Logger::ERROR_LOGGER->log("SCENEGRAPH", "SetTransforms: cannot find " + m.name + " module");
}
throw exception();
}
}
return new Impl(screenNode, n, this);
}
......
......@@ -101,7 +101,6 @@ protected:
*/
void swap(ptr<SetTransformsTask> t);
private:
/**
* The "screen" node to be used for transformation involving the "screen"
......
Supports Markdown
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