Viewport::Viewport() : SceneElement(*shState->screen()), sceneLink(this) { const Graphics &graphics = shState->graphics(); initViewport(0, 0, graphics.width(), graphics.height()); }
void OSystem_Android::initBackend() { ENTER(); _main_thread = pthread_self(); ConfMan.registerDefault("fullscreen", true); ConfMan.registerDefault("aspect_ratio", true); ConfMan.registerDefault("touchpad_mouse_mode", true); ConfMan.setInt("autosave_period", 0); ConfMan.setBool("FM_high_quality", false); ConfMan.setBool("FM_medium_quality", true); if (ConfMan.hasKey("touchpad_mouse_mode")) _touchpad_mode = ConfMan.getBool("touchpad_mouse_mode"); else ConfMan.setBool("touchpad_mouse_mode", true); // must happen before creating TimerManager to avoid race in // creating EventManager setupKeymapper(); // BUG: "transient" ConfMan settings get nuked by the options // screen. Passing the savepath in this way makes it stick // (via ConfMan.registerDefault) _savefileManager = new DefaultSaveFileManager(ConfMan.get("savepath")); _timerManager = new DefaultTimerManager(); gettimeofday(&_startTime, 0); _mixer = new Audio::MixerImpl(this, _audio_sample_rate); _mixer->setReady(true); _timer_thread_exit = false; pthread_create(&_timer_thread, 0, timerThreadFunc, this); _audio_thread_exit = false; pthread_create(&_audio_thread, 0, audioThreadFunc, this); initSurface(); initViewport(); _game_texture = new GLESFakePalette565Texture(); _overlay_texture = new GLES4444Texture(); _mouse_texture_palette = new GLESFakePalette5551Texture(); _mouse_texture = _mouse_texture_palette; initOverlay(); // renice this thread to boost the audio thread if (setpriority(PRIO_PROCESS, 0, 19) < 0) warning("couldn't renice the main thread"); JNI::setReadyForEvents(true); EventsBaseBackend::initBackend(); }
int main(int argc, char **argv) { std::string fileName(argv[1]); primaryOBJ = new model(fileName, verticesPerFace); //setup glut window setupGlut(argc, argv); //setup the projection and view matrices initViewport(); //initialize the cube map textures that will form our skybox initCubeMap(); // initialize the fbo for dynamic cubemapping //initDynamicCubeMap(); // standard light initialization. Relatively unchanged from the Bunny project create_lights(); //standard material initialization. Relatively unchanged from the Bunny project create_material(); teapotShader = set_shaders((char *)"phongEC"); planeShader = set_shaders((char *)"plane"); // This will read in the texture that will be applied to the teapot, if a texture is applied to the teapot at all // initTeapotTexture((char*)"textures/bubble_color.ppm"); initCircleTexture((char*)"textures/circle.tga"); // setting up the main shader for the teapot defaultShader = set_shaders((char*)"phongEC"); // setting up the shader for the skybox / cube map skyboxShader = set_shaders((char*)"skybox"); // set up the skybox geometry cube initSkyboxGeometry(); // Main loop functions glutDisplayFunc(draw_AA); glutKeyboardFunc(keyBindings); glutSpecialFunc(translateCam); glutMainLoop(); return 0; }
// ResidualVM specific method Graphics::PixelBuffer OSystem_Android::setupScreen(int screenW, int screenH, bool fullscreen, bool accel3d, bool isGame) { _opengl = accel3d; initViewport(); _touchControls.init(this, _egl_surface_width, _egl_surface_height); if (_opengl) { // resize game texture initSize(screenW, screenH, 0); if (isGame) _game_texture->setGameTexture(); // format is not used by the gfx_opengl driver, use fake format _game_pbuf.set(Graphics::PixelFormat(), 0); } else { Graphics::PixelFormat format = GLES565Texture::pixelFormat(); initSize(screenW, screenH, &format); // as there is no support for the texture surface's lock/unlock mechanism in gfx_tinygl/... // do not use _game_texture->surface()->pixels directly _game_pbuf.create(_game_texture->getPixelFormat(), _game_texture->width() * _game_texture->height(), DisposeAfterUse::YES); } return _game_pbuf; }
Viewport::Viewport(Rect *rect) : SceneElement(*shState->screen()), sceneLink(this) { initViewport(rect->x, rect->y, rect->width, rect->height); }
Viewport::Viewport(int x, int y, int width, int height) : SceneElement(*shState->screen()), sceneLink(this) { initViewport(x, y, width, height); }
void LayerRenderer::setViewport(int width, int height) { initViewport(width, height); }