本文整理汇总了C++中ogre::LogManager::logMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ LogManager::logMessage方法的具体用法?C++ LogManager::logMessage怎么用?C++ LogManager::logMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::LogManager
的用法示例。
在下文中一共展示了LogManager::logMessage方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadImpl
void SoundFX::loadImpl() {
Ogre::LogManager* pLogManager = Ogre::LogManager::getSingletonPtr();
// Ruta al archivo.
Ogre::FileInfoListPtr info;
info = Ogre::ResourceGroupManager::getSingleton().findResourceFileInfo(mGroup, mName);
for (Ogre::FileInfoList::iterator i = info->begin(); i != info->end(); ++i) {
_path = i->archive->getName() + "/" + i->filename;
}
// Archivo no encontrado...
if (_path == "") {
pLogManager->logMessage("SoundFX::loadImpl() Imposible encontrar el recurso.");
throw (Ogre::Exception(Ogre::Exception::ERR_FILE_NOT_FOUND,
"Imposible encontrar el recurso", "SoundFX::loadImpl()"));
}
// Cargar el efecto de sonido.
if ((_pSound = Mix_LoadWAV(_path.c_str())) == NULL) {
pLogManager->logMessage("SoundFX::loadImpl() Imposible cargar el efecto.");
throw (Ogre::Exception(Ogre::Exception::ERR_INTERNAL_ERROR,
"Imposible cargar el efecto", "SoundFX::loadImpl()"));
}
// Cálculo del tamaño del recurso de sonido.
std::ifstream stream;
char byteBuffer;
stream.open(_path.c_str(), std::ios_base::binary);
while (stream >> byteBuffer) {
++_size;
}
stream.close();
}
示例2: Execute
//---------------------------------------------------------------------
int MilkshapePlugin::Execute (msModel* pModel)
{
// Do nothing if no model selected
if (!pModel)
return -1;
Ogre::LogManager logMgr;
logMgr.createLog("msOgreExporter.log", true);
logMgr.logMessage("OGRE Milkshape Exporter Log");
logMgr.logMessage("---------------------------");
Ogre::ResourceGroupManager resGrpMgr;
//
// check, if we have something to export
//
if (msModel_GetMeshCount (pModel) == 0)
{
::MessageBox (NULL, "The model is empty! Nothing exported!", "OGRE Export", MB_OK | MB_ICONWARNING);
return 0;
}
if (!showOptions()) return 0;
if (exportMesh)
{
doExportMesh(pModel);
}
return 0;
}
示例3: fadeOut
// Fachada de MixFadeOutMusic()
void Track::fadeOut (int ms) {
Ogre::LogManager* pLogManager = Ogre::LogManager::getSingletonPtr();
if (Mix_FadeOutMusic(ms) == -1) {
pLogManager->logMessage("Track::fadeIn() Error al aplicar efecto de sonido.");
throw (Ogre::Exception(Ogre::Exception::ERR_INTERNAL_ERROR,
"Imposible aplicar suavizado de sonido", "Track::fadeIn()"));
}
}
示例4: play
int SoundFX::play(int loop) {
int channel;
Ogre::LogManager* pLogManager = Ogre::LogManager::getSingletonPtr();
// Si el primer parámetro es un -1, maneja nuevos canales para efectos simultáneos
if ((channel = Mix_PlayChannel(1, _pSound, loop)) == -1) {
pLogManager->logMessage("SoundFX::play() Imposible reproducir el efecto de sonido.");
throw (Ogre::Exception(Ogre::Exception::ERR_INTERNAL_ERROR,
"Imposible reproducir el efecto de sonido", "SoundFX::play()"));
}
return channel;
}
示例5: loadImpl
// Carga del recurso.
void Track::loadImpl() {
Ogre::LogManager* pLogManager = Ogre::LogManager::getSingletonPtr();
// Ruta al archivo.
Ogre::FileInfoListPtr info;
info = Ogre::ResourceGroupManager::getSingleton().findResourceFileInfo(mGroup, mName);
for (Ogre::FileInfoList::const_iterator i = info->begin(); i != info->end(); ++i) {
_path = i->archive->getName() + "/" + i->filename;
}
// Archivo no encontrado...
if (_path == "") {
pLogManager->logMessage("Track::loadImpl() Imposible cargar el recurso de sonido.");
throw (Ogre::Exception(Ogre::Exception::ERR_FILE_NOT_FOUND,
"Archivo no encontrado", "Track::loadImpl()"));
}
cout << "\n\nPath: " << _path << "\n\n" << endl;
// Cargar el recurso de sonido.
if ((_pTrack = Mix_LoadMUS(_path.c_str())) == NULL) {
pLogManager->logMessage("Track::loadI() Imposible cargar el recurso de sonido.");
throw (Ogre::Exception(Ogre::Exception::ERR_FILE_NOT_FOUND,
"Archivo no encontrado", "Track::loadI()"));
}
// Cálculo del tamaño del recurso de sonido.
std::ifstream stream;
char byteBuffer;
stream.open(_path.c_str(), std::ios_base::binary);
while (stream >> byteBuffer) {
_size++;
}
stream.close();
}
示例6: play
void Track::play(int loop) {
Ogre::LogManager* pLogManager = Ogre::LogManager::getSingletonPtr();
// Estaba pausada?
if(Mix_PausedMusic()) {
Mix_ResumeMusic(); // Reanudación.
}
// Si no, se reproduce desde el principio.
else {
if (Mix_PlayMusic(_pTrack, loop) == -1) {
pLogManager->logMessage("Track::play() Error al reproducir el recurso de sonido.");
throw (Ogre::Exception(Ogre::Exception::ERR_FILE_NOT_FOUND,
"Imposible reproducir el recurso de sonido", "Track::play()"));
}
}
}
示例7: createActions
//.........这里部分代码省略.........
mNodeEditor->addNode(mMaterialNode);
}
}
//****************************************************************************/
void EditorDockWidget::doTechniqueHToolbarAction(void)
{
// Add a technique node
Magus::QtNodeTechnique* techniqueNode = new Magus::QtNodeTechnique(NODE_TITLE_TECHNIQUE);
mNodeEditor->addNode(techniqueNode);
}
//****************************************************************************/
void EditorDockWidget::doPassHToolbarAction(void)
{
// Add a pass node
Magus::QtNodePass* passNode = new Magus::QtNodePass(NODE_TITLE_PASS);
mNodeEditor->addNode(passNode);
}
//****************************************************************************/
void EditorDockWidget::doTextureHToolbarAction(void)
{
// Add a texture unit node
Magus::QtNodeTextureUnit* textureUnitNode = new Magus::QtNodeTextureUnit(NODE_TITLE_TEXTURE_UNIT);
mNodeEditor->addNode(textureUnitNode);
}
//****************************************************************************/
void EditorDockWidget::doCogHToolbarAction(void)
{
if (!mMaterialNode)
return;
if (mMaterialNode->getMaterialName().isEmpty())
return;
// ---------------------------------------- Create a material ----------------------------------------
Ogre::LogManager* logManager = Ogre::LogManager::getSingletonPtr();
Ogre::MaterialManager* materialManager = Ogre::MaterialManager::getSingletonPtr();
Ogre::String materialName = mMaterialNode->getMaterialName().toStdString(); // Convert to std format
logManager->logMessage("SME: create Ogre material: " + materialName);
Ogre::MaterialPtr material = materialManager->create(materialName, "General");
// Remark: Sceneblending is done for each pass individually, although it is defined on material level
// ---------------------------------------- Add the technique ----------------------------------------
Magus::QtNode* node = mMaterialNode->getNodeConnectedToPort(PORT_TECHNIQUE_OUT);
if (!node)
{
logManager->logMessage("SME: No technique node available");
return;
}
Magus::QtNodeTechnique* techniqueNode = static_cast<Magus::QtNodeTechnique*>(node);
material->removeAllTechniques();
Ogre::Technique* technique = material->createTechnique();
technique->removeAllPasses();
logManager->logMessage("SME: Technique created" + Ogre::StringConverter::toString(material->getNumTechniques()));
// ---------------------------------------- Add the passes ----------------------------------------
Magus::QtNodePass* passNode;
Magus::QtNodeTextureUnit* textureUnitNode;
Ogre::Pass* pass;
Ogre::TextureUnitState* textureUnit;
for (unsigned int i = 1; i < 5; ++i)
{
node = techniqueNode->getNodeConnectedToPort(PORT_PASS_OUT, i); // node with the same name
if (node)
{
passNode = static_cast<Magus::QtNodePass*>(node);
pass = technique->createPass();
pass->removeAllTextureUnitStates();
logManager->logMessage("SME: Pass on port nr. " + Ogre::StringConverter::toString(i) + " created");
propagatePassNodeData(passNode, pass);
// ---------------------------------------- Add the texture units ----------------------------------------
for (unsigned int j = 1; j < 9; ++j)
{
node = passNode->getNodeConnectedToPort(PORT_TEXTURE_OUT, j);
if (node)
{
logManager->logMessage("SME: Texture unit on port nr. " +
Ogre::StringConverter::toString(j) +
" of Pass port nr. " +
Ogre::StringConverter::toString(i) +
" created");
textureUnitNode = static_cast<Magus::QtNodeTextureUnit*>(node);
textureUnit = pass->createTextureUnitState();
propagateTextureUnitNodeData(textureUnitNode, textureUnit);
}
}
}
}
// Assign the material to the ogrehead
material->compile();
material->load();
mParent->getOgreManager()->getOgreWidget(1)->mEntity->setMaterial(material);
}
示例8: lightdir
bool
GraphicsController::onInit(Ogre::SceneManager* scnMgr, Ogre::Viewport* viewport, Ogre::Camera* camera,
Ogre::int32 windowWidth, Ogre::int32 windowHeight)
{
_cam = camera;
_scnMgr = scnMgr;
_vp = viewport;
//_dynLightsManager = packet->workspaceCtrl->getZWorkspace()->getWorldController()->getDynamicLightManager();
//generate random textures
for(size_t i = 0; i < NUM_OF_BANDS * 4; i++)
{
_SHC_R[i] = 0.0f;
_SHC_G[i] = 0.0f;
_SHC_B[i] = 0.0f;
}
Ogre::LogManager* lm = Ogre::LogManager::getSingletonPtr();
lm->logMessage(Ogre::LML_TRIVIAL, "In GraphicsController::onInit()");
lm->logMessage(Ogre::LML_NORMAL, "Adding compositor bloom");
//First build the lights.
_lightDir.normalise();
Vector3 lightdir(0.0, -0.5, 0.1);
lightdir.normalise();
lightdir *= -1;
_scnMgr->setAmbientLight(Ogre::ColourValue(0.5f, 0.5f, 0.5f));
light = _scnMgr->createLight("terrainLight");
light->setType(Light::LT_DIRECTIONAL);
light->setCastShadows(true);
light->setShadowFarClipDistance(256);
Ogre::ColourValue fadeColour(1.0, 1.0, 1.0);
_scnMgr->setFog(Ogre::FOG_NONE);
_initBackgroundHdr();
_vp->setBackgroundColour(fadeColour);
Ogre::CompositorManager& compMgr = Ogre::CompositorManager::getSingleton();
_hdrLogic = new HDRLogic();
compMgr.registerCompositorLogic("HDR", _hdrLogic);
_ogreHdr = CompositorManager::getSingleton().addCompositor(_vp, "HDR", 0);
Ogre::CompositorManager::getSingleton().setCompositorEnabled(_vp, "HDR", true);
/*
//setup the HDR options.
auto sharedParams = Ogre::GpuProgramManager::getSingleton().getSharedParameters("HdrSharedParams");
ZGame::Graphics::GraphicsOptions gfxOptions;
sharedParams->setNamedConstant("MIDDLE_GREY", gfxOptions.hdr_middle_grey);
sharedParams->setNamedConstant("BRIGHT_LIMITER", gfxOptions.hdr_bright_limiter);
sharedParams->setNamedConstant("FUDGE", gfxOptions.hdr_fudge_factor);
*/
_deferredGfx->initialize(_cam, windowWidth, windowHeight);
//addTextureDebugOverlay(_deferredGfx->getLightBufferTex()->getName(), 1);
//Ogre::OverlayManager::getSingleton().getByName("PRJZ/DebugOverlay")->show();
//addTextureDebugOverlay(_deferredGfx->getGBuffer1Tex()->getName(), 0);
//addTextureDebugOverlay(_rtLum4->getName(), 0);
//addTextureDebugOverlay(_deferredGfx->getNormalDepthTex()->getName(), 0);
//Overlay* debugOverlay = OverlayManager::getSingleton().getByName("PRJZ/DebugOverlay");
//debugOverlay->show();
//addTextureDebugOverlay(_deferredGfx->getLightBufferTex()->getName(), 0);
//addTextureDebugOverlay(_ssaoBlurY->getName(), 0);
//addTextureDebugOverlay(_ssaoTarget->getName(), 0);
//addTextureDebugOverlay(_hfaoTarget->getName(), 0);
//addTextureDebugOverlay(_hfaoBlurY->getName(), 0);
//addTextureDebugOverlay(_wendlandFilter->getName(), 0);
//addTextureDebugOverlay(_ssaoTarget->getName(), 0);
//addTextureDebugOverlay(_bitwiseLookupTex->getName(), 0);
//addTextureDebugOverlay(_hfaoBlurY, 0);
//setup the texture data textures.
//setup lighting direction quad
/*
_directionLightQuad = new Ogre::Rectangle2D(true);
_directionLightQuad->setCorners(-1, 1, 1, -1);
_directionLightQuad->setBoundingBox(Ogre::AxisAlignedBox::BOX_INFINITE);
//was 0xf0
_directionLightQuad->setVisibilityFlags(0xf0); //FUCK: for mask see DynamicLightManager. We need to define these globally.
_directionLightQuad->setCastShadows(false);
_directionLightQuad->setRenderQueueGroup(Ogre::RENDER_QUEUE_6);
_directionLightQuad->setVisible(true);
_directionLightQuad->setMaterial("PRJZ/DirectionLightBuffer");
_scnMgr->getRootSceneNode()->attachObject(_directionLightQuad);
*/
return true;
}