void steroids_ship_init (Steroids_Ship *ship) { int i; initializeModels(); for (i = 0; i < STEROIDS_SHIP_EXHAUST_NUM; i++) { exhaust[i].active = 0; } ship->originalShape = &modelShip; ship->heading = 0; ship->cannon = 0; ship->engine = 2; ship->state = STEROIDS_SHIP_STATE_LIVE; // Initialize ship shape object: ship->shape.type = STEROIDS_OBJECT_TYPE_POLYGON; ship->shape.colour = BLACK; steroids_polygon_copy (ship->originalShape, &ship->shape.geometry.polygon); ship->shape.velocity.x = 0; ship->shape.velocity.y = 0; ship->shape.accelleration.x = 0; ship->shape.accelleration.y = 0; // Move to start position: startPos.x = steroids_globals.width / 2; startPos.y = steroids_globals.height / 2; steroids_object_rotate (ship->heading, &ship->shape); steroids_object_translate (startPos, &ship->shape); }
UserFormModel(Wt::WObject *parent = 0) : Wt::WFormModel(parent) { initializeModels(); addField(FirstNameField); addField(LastNameField); addField(CountryField); addField(CityField); addField(BirthField); addField(ChildrenField); addField(RemarksField); setValidator(FirstNameField, createNameValidator(FirstNameField)); setValidator(LastNameField, createNameValidator(LastNameField)); setValidator(CountryField, createCountryValidator()); setValidator(CityField, createCityValidator()); setValidator(BirthField, createBirthValidator()); setValidator(ChildrenField, createChildrenValidator()); // Here you could populate the model with initial data using // setValue() for each field. setValue(BirthField, Wt::WDate()); setValue(CountryField, std::string()); }
/*! Create and Initializes all models. \param[in] void. \return void. */ void Renderer::setUpModels() { // ! Generate the models and cache all createModels(); //! Do the init stuff as per model requirements initializeModels(); }
void InitGL( void )//__BEGIN_INIT__@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ { start = getMilliCount(); #include "tier2_GLOBALS.cpp" //========================================================================== #ifdef WIN32 #include "cpp/setPixelFormat.cpp" #include "include/glext_Init_B.cpp" //alutInit(NULL, 0); //------------------------------------- SetVSyncState(true); //----------------------------------------------------------------------------- rotateModelWithMiddleMouse[0] = Pass_MIDDLE_Mouse[0]; rotateModelWithMiddleMouse[1] = Pass_MIDDLE_Mouse[1]; //----------------------------------------------------------------- zoomModelWithMiddleMouse = Pass_MIDDLE_CONTROL_Mouse; //----------------------------------------------------------------- moveModelWithMiddleMouse[0] = Pass_MIDDLE_SHIFT_Mouse[0]; moveModelWithMiddleMouse[1] = Pass_MIDDLE_SHIFT_Mouse[1]; //----------------------------------------------------------------- //================= #endif //======================= GLuint initializeLocator = 0; initializeModels(); //======================= //============================================================================== #ifdef WIN32 //atexit(KillALData);//_tell_openAL_to_run_KillALData_function_at_shutdown #endif glEnable(GL_DEPTH_TEST); //glDepthFunc(GL_LEQUAL); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); //glAlphaFunc(GL_GREATER, 0.1); glEnable(GL_CULL_FACE); glCullFace(GL_BACK); //==================================================================================================================================== }//__END_INIT__@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//-------------------------------------------------------------- void ofApp::setup(){ initializeAudio(); initializeModels(); instructions.loadFont("RobotoTTF/Roboto-Bold.ttf", 20); header.loadFont("quantico/Quantico-Bold.ttf", 30); headerLG.loadFont("quantico/Quantico-Bold.ttf", 70); preludeFont.loadFont("RobotoTTF/Roboto-Bold.ttf", 20); ofBackground(255,255,255); ofSetVerticalSync(true); camera.setFov(80); camera.setDistance(600); //we need to call this for textures to work on models ofDisableArbTex(); //this makes sure that the back of the model doesn't show through the front ofEnableDepthTest(); //ofxVboParticles([max particle number], [particle size]); stars = new ofxVboParticles(10000, 1000); //set friction (0.0 - 1.0); stars->friction = 0.000; movie.loadMovie("displays/loading.gif"); movie.setLoopState(OF_LOOP_NORMAL); movie.play(); isIntro = true; skipPrelude = true; // only set to true when testing timers[0] = 0; timers[1] = 0; timers[2] = 0; time = ofGetElapsedTimef(); }