Пример #1
0
/***********************************************************
 * Name: redraw_scene
 *
 * Arguments:
 *       CUBE_STATE_T *state - holds OGLES model info
 *
 * Description:   Draws the model and calls eglSwapBuffers
 *                to render to screen
 *
 * Returns: void
 *
 ***********************************************************/
static void redraw_scene(CUBE_STATE_T *state)
{
   // Start with a clear screen
   glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );

   draw_wavefront(state->model, state->tex);

   eglSwapBuffers(state->display, state->surface);
}
Пример #2
0
/***********************************************************
 * Name: teapot_redraw
 *
 * Arguments:
 *       RASPITEX_STATE_T *state - holds OGLES model info
 *
 * Description:   Draws the model
 *
 * Returns: void
 *
 ***********************************************************/
static int teapot_redraw(RASPITEX_STATE *raspitex_state)
{
    TEAPOT_STATE_T *state = (TEAPOT_STATE_T *) raspitex_state->scene_state;

    // Start with a clear screen
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    /* Bind the OES texture which is used to render the camera preview */
    glBindTexture(GL_TEXTURE_EXTERNAL_OES, raspitex_state->texture);
    draw_wavefront(state->model, raspitex_state->texture);
    return 0;
}