| 145 | INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInstance, LPSTR strCmdLine, INT nCmdShow ) |
| 146 | #else |
| 147 | int main( int argc, const char *argv[] ) |
| 148 | #endif |
| 149 | { |
| 150 | using namespace Ogre; |
| 151 | |
| 152 | #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE |
| 153 | const String pluginsFolder = macResourcesPath(); |
| 154 | const String writeAccessFolder = macLogPath(); |
| 155 | #else |
| 156 | const String pluginsFolder = "./"; |
| 157 | const String writeAccessFolder = pluginsFolder; |
| 158 | #endif |
| 159 | |
| 160 | #ifndef OGRE_STATIC_LIB |
| 161 | # if OGRE_DEBUG_MODE && \ |
| 162 | !( ( OGRE_PLATFORM == OGRE_PLATFORM_APPLE ) || ( OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS ) ) |
| 163 | const char *pluginsFile = "plugins_d.cfg"; |
| 164 | # else |
| 165 | const char *pluginsFile = "plugins.cfg"; |
| 166 | # endif |
| 167 | #else |
| 168 | const char *pluginsFile = 0; // TODO |
| 169 | #endif |
| 170 | |
| 171 | const Ogre::AbiCookie abiCookie = Ogre::generateAbiCookie(); |
| 172 | Root *root = OGRE_NEW Root( &abiCookie, pluginsFolder + pluginsFile, // |
| 173 | writeAccessFolder + "ogre.cfg", // |
| 174 | writeAccessFolder + "Ogre.log" ); |
| 175 | |
| 176 | if( !root->showConfigDialog() ) |
| 177 | return -1; |
| 178 | |
| 179 | // Initialize Root |
| 180 | root->getRenderSystem()->setConfigOption( "sRGB Gamma Conversion", "Yes" ); |
| 181 | Window *window = root->initialise( true, "Tutorial 00: Basic" ); |
| 182 | |
| 183 | registerHlms(); |
| 184 | |
| 185 | // Create SceneManager |
| 186 | const size_t numThreads = 1u; |
| 187 | SceneManager *sceneManager = root->createSceneManager( ST_GENERIC, numThreads, "ExampleSMInstance" ); |
| 188 | |
| 189 | // Create & setup camera |
| 190 | Camera *camera = sceneManager->createCamera( "Main Camera" ); |
| 191 | |
| 192 | // Position it at 500 in Z direction |
| 193 | camera->setPosition( Vector3( 0, 5, 15 ) ); |
| 194 | // Look back along -Z |
| 195 | camera->lookAt( Vector3( 0, 0, 0 ) ); |
| 196 | camera->setNearClipDistance( 0.2f ); |
| 197 | camera->setFarClipDistance( 1000.0f ); |
| 198 | camera->setAutoAspectRatio( true ); |
| 199 | |
| 200 | // Setup a basic compositor with a blue clear colour |
| 201 | CompositorManager2 *compositorManager = root->getCompositorManager2(); |
| 202 | const String workspaceName( "Demo Workspace" ); |
| 203 | const ColourValue backgroundColour( 0.2f, 0.4f, 0.6f ); |
| 204 | compositorManager->createBasicWorkspaceDef( workspaceName, backgroundColour, IdString() ); |
nothing calls this directly
no test coverage detected