void Graphics::init() { #ifdef __APPLE__ int windowWidth = 1024, windowHeight = 768; #else int windowWidth = 1600, windowHeight = 900; #endif SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); window = SDL_CreateWindow("cs791a", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, windowWidth, windowHeight, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE); if(!window) { std::cerr << "Unable to create SDL Window" << std::endl; exit(1); } gl_context = SDL_GL_CreateContext(window); SDL_GL_SetSwapInterval(1); initGL(); initScenes(); }
//------------------------------------------------------------------------------ bool QTransitionPageTurn::initWithDuration(float t, CCScene* scene, bool backwards) { // XXX: needed before [super init] m_bBack = backwards; if (CCScene::init() && initScenes(scene, &m_pInScene, &m_pOutScene)) { m_fDuration = t; sceneOrder(); return true; } return false; }
//-------------------------------------------------------------- void testApp::setup(){ ofSetLogLevel(OF_LOG_ERROR); //suppress the message OF_LOG_WARNING: ofGLRenderer::draw(): texture is not allocated ofBackground(255,255,255); glEnable(GL_DEPTH_TEST); //required to recognize z-axis positions selection = 1; //to start, but level wont bump to front until an event initScenes(); WW = float(ofGetWidth()); WH = float(ofGetHeight()); #if USETUIO ofAddListener(tuioClient.objectAdded,this,&testApp::tuioAdded); ofAddListener(tuioClient.objectRemoved,this,&testApp::tuioRemoved); ofAddListener(tuioClient.objectUpdated,this,&testApp::tuioUpdated); tuioClient.start(3333); #endif }
void Liquidmanager::Init() { initScenes(); }