Scene * newScene(GLboolean vsync) { Scene * scene = (Scene *) malloc(sizeof(Scene)); scene->context = (ContextSize *) malloc(sizeof(ContextSize)); scene->context->w = CONTEXT_WIDTH_INITIAL; scene->context->h = CONTEXT_HEIGHT_INITIAL; setupOpenGLContext(scene->context); checkOpenGLVersion(); setupOpenGLState(scene->context, vsync); scene->camera = newCamera(scene->context->w, scene->context->h); scene->world = getWorld("world.txt"); scene->water = getWater(); setupWater(scene->water->drawSP, scene->world); setupWorldUniforms(scene->world->sp, scene->water); return scene; }
int Map::getObstacles() const { return (getWater() + getPeak()); }