Пример #1
0
int main(int argc, char **argv){

    // Start OpenGL context
    initGL(argc, argv);

    /* Do Curl Init */
    curl_global_init(CURL_GLOBAL_DEFAULT);

    // Set background color and clear buffers
    Tangram::initialize("scene.yaml");
    Tangram::setupGL();
    Tangram::resize(getWindowWidth(), getWindowHeight());

    setup();

    // Start clock
    gettimeofday(&tv, NULL);
    timeStart = timePrev = (unsigned long long)(tv.tv_sec) * 1000 + (unsigned long long)(tv.tv_usec) / 1000;

    while (bUpdate) {
        updateGL();

        processNetworkQueue();

        if (getRenderRequest()) {
            setRenderRequest(false);
            newFrame();
        }
    }

    curl_global_cleanup();
    closeGL();
    return 0;
}
Пример #2
0
void onExit() {
    // clear screen
    glClear( GL_COLOR_BUFFER_BIT );

    // close openGL instance
    closeGL();

    // DELETE RESOURCES
    for (std::map<std::string,Texture*>::iterator i = textures.begin(); i != textures.end(); ++i) {
        delete i->second;
        i->second = NULL;
    }
    textures.clear();
    delete vbo;
}
Пример #3
0
Paparazzi::~Paparazzi() {
    curl_global_cleanup();
    closeGL();
}