bool WaitingForYou::initGeometry() { // axis { // static float scale = 100; // _axis_vertices[0].position = Vec3::ZERO * scale; _axis_vertices[0].color_ARGB = Euclid::Color::Red.getARGB(); _axis_vertices[1].position = Vec3::UNIT_X * scale; _axis_vertices[1].color_ARGB = Euclid::Color::Red.getARGB(); // _axis_vertices[2].position = Vec3::ZERO * scale; _axis_vertices[2].color_ARGB = Euclid::Color::Green.getARGB(); _axis_vertices[3].position = Vec3::UNIT_Y * scale; _axis_vertices[3].color_ARGB = Euclid::Color::Green.getARGB(); // _axis_vertices[4].position = Vec3::ZERO * scale; _axis_vertices[4].color_ARGB = Euclid::Color::Blue.getARGB(); _axis_vertices[5].position = Vec3::UNIT_Z * scale; _axis_vertices[5].color_ARGB = Euclid::Color::Blue.getARGB(); } // Any resources or settings that need to be restored after losing the // DirectD device should probably be grouped together into one function so // they can be re-created or reset in one call. restoreDevice(); return true; }
HRESULT RestoreCmd( void ) { HRESULT err = ERROR_SUCCESS; int count = RegistryGetXenNetCount(); if (count == 0) { Warning("No XenVif devices found\n"); goto done; } if (count < 0) { err = count; goto fail; } for (int i =0; i < count; i++) { err = restoreDevice(i); if ( err != 0 ) { Warning("Failed to restore device %d settings, due to it not being correctly installed"); } } done: RegistryAllowGuestAgentCopy(); return err; fail: Fail(err); return err; }
bool WaitingForYou::initGeometry() { // _material = _modules->getRenderEngine()->getMaterialManager()->createMaterial(Euclid::eMaterialType_Vertex); if (_material) { _material->setVertexDeclaration(Euclid::eVertexDeclarationType_Position); } // restoreDevice(); // Euclid::sPosition vertices[3]; // vertices[0].position = Vec3(-1.0f, 0.0f, 0.0f); // vertices[1].position = Vec3(0.0f, 1.0f, 0.0f); // vertices[2].position = Vec3(1.0f, 0.0f, 0.0f); // _vb = _modules->getRenderEngine()->getBufferManager()->createVertexBuffer(3 * sizeof(Euclid::sPosition), Euclid::eUsage_WriteOnly, Euclid::ePool_Default); // void* data = _vb->lock(0, 0, Euclid::eLock_Null); // memcpy(data, vertices, 3 * sizeof(Euclid::sPosition)); // _vb->unLock(); // return true; }