added DumpCommand for the purpose of command stream logging.

This commit is contained in:
rachytski 2012-04-23 19:31:52 +04:00 committed by Alex Zolotarev
parent 96cf54d23e
commit f8f7344b32
4 changed files with 34 additions and 0 deletions

View file

@ -126,6 +126,11 @@ namespace yg
// OGLCHECK(glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ));
}
void GeometryRenderer::DrawGeometry::dump()
{
LOG(LINFO, ("DrawGeometry, texture=", m_texture->id(), ", indicesCount=", m_indicesCount));
}
void GeometryRenderer::drawGeometry(shared_ptr<BaseTexture> const & texture,
Storage const & storage,
size_t indicesCount,
@ -189,6 +194,11 @@ namespace yg
m_texturePool->Free(m_texture);
}
void GeometryRenderer::FreeTexture::dump()
{
LOG(LINFO, ("FreeTexture, texture=", m_texture->id(), ", pool=", m_texturePool->ResName()));
}
void GeometryRenderer::FreeTexture::cancel()
{
perform();

View file

@ -52,6 +52,7 @@ namespace yg
unsigned m_primitiveType;
void perform();
void dump();
};
struct FreeStorage : public Command
@ -70,6 +71,7 @@ namespace yg
void perform();
void cancel();
void dump();
};
struct UnlockStorage : public Command

View file

@ -28,6 +28,18 @@ namespace yg
void Command::perform()
{}
void Command::dump()
{}
DumpCommand::DumpCommand(shared_ptr<Command> const & cmd)
: m_cmd(cmd)
{}
void DumpCommand::perform()
{
m_cmd->dump();
}
Packet::Packet()
{}

View file

@ -29,10 +29,20 @@ namespace yg
virtual ~Command();
virtual void perform();
virtual void cancel();
virtual void dump();
friend class Renderer;
};
struct DumpCommand : Command
{
shared_ptr<Command> m_cmd;
DumpCommand(shared_ptr<Command> const & cmd);
void perform();
};
template <typename Fn>
struct FunctorCommand : Command
{