//---- TrafficLight definitions TrafficLight::TrafficLight(Ogre::SceneManager *sceneMgr, Ogre::Vector3 pos, Ogre::Quaternion rot, int id) : SceneObject(sceneMgr, pos, rot, id, "TrafficLight.mesh") { preloadTextures(); trafficLightEntity = ((Ogre::Entity*) mainNode->getAttachedObject(0)); // Initial state is green (though could be configurable?) tlStatus = TL_RED; changeState(); //TODO Replace with more realistic times (25 - 3 - 32)? waitTimes[TL_GREEN] = 5; waitTimes[TL_YELLOW] = 3; waitTimes[TL_RED] = 12; }
WorldUIView::WorldUIView(UIRect _rect, Client *_client) { rect = _rect; client = _client; setName("world_view"); minZoom = .4; maxZoom = 6; sbDefaultSize = 70; setZoom(1.0); xOffset = 0; yOffset = 0; dragging = false; preloadTextures(); enableKeyEventCallbacks(); }
bool Graphics::init() { if (!preloadTextures()) return false; scene.addCamera(nullptr, math::Vector3f(0.0f, 10.0f, 30.0f), math::Vector3f(0.0f, 0.0f, 0.0f)); waterPlane = scene.addInfinitePlane( device->grabTexture(basePath + "gfx/water.jpg"), Color(80, 255, 240), 3.125f); { auto & material = waterPlane->getMaterial(); material.depthFunction = Material::Always; material.zWriteEnabled = true; material.textureLayers[0].bilinearFilter = true; material.materialType = Material::Solid; } setWaterLevel(1.0f / 64.0f); groundPlane = scene.addInfinitePlane( device->grabTexture(basePath + "sys/gfx/terraindirt.bmp"), Color(255, 255, 255), 2.0f); { auto & material = groundPlane->getMaterial(); material.depthFunction = Material::Disabled; material.zWriteEnabled = false; material.textureLayers[0].bilinearFilter = true; material.materialType = Material::ColorDetailMap; } groundPlane->drawAsSkybox(true); return true; }
void FakeEngine::initializeGL() { preloadTextures(); glEnable(GL_TEXTURE_2D); miniGame->Initialize(); }