#include <OGRE/ExampleApplication.h>
#include <OGRE/Ogre.h>
class EnvMapApplication : public ExampleApplication
{
public:
EnvMapApplication()
{
}
virtual void createScene()
{
mSceneMgr->setAmbientLight(Ogre::ColourValue(1.0, 0.0, 0.0, 0.0));
Ogre::Light * light = mSceneMgr->createLight("MainLight");
this->mWindow->setFullscreen(false, 800, 600);
Ogre::Entity * ent = mSceneMgr->createEntity("head", "/usr/share/OGRE/media/models/ogrehead.mesh");
mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
}
};
int main()
{
EnvMapApplication app;
app.go();
return 0;
}
project(OGRETest)
cmake_minimum_required(VERSION 2.8)
find_package(Boost COMPONENTS thread QUIET)
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})
target_link_libraries(${PROJECT_NAME} libOIS.so libOgreRTShaderSystem.so libOgreMain.so libOgreProperty.so libOgrePaging.so ${OGRE_${PLUGIN}_LIBRARY} ${Boost_LIBRARIES} ${OGRE_LIBRARIES} libGL.so libGLU.so)
![](//images0.cnblogs.com/blog/403684/201401/05114454-616eb338f8ab462a9c7c9d0022964285.png)