Beispiel #1
0
void render() {
#if USE_SKIA_OPENGL
    bbutil_clear();
#endif


/************************** BEGIN USER RENDER CODE ***************************/
    // Clear the entire canvas to a solid colour
    SkPaint clearColor;
    clearColor.setARGB(255,0xdd,0xdd,0xdd);
    SkRect fullScreen;
    fullScreen.set(0,0,width,height);
    canvas->drawRect(fullScreen, clearColor);

    // Draw the current demo
    if (demos[currentIndex])
        demos[currentIndex]->onDraw();
/**************************** END USER RENDER CODE ***************************/


    // Draw the contents of the canvas to the screen
#if USE_SKIA_OPENGL
    device->flush();
    bbutil_swap(0);
#else
    bbutil_swap(currentSurface);
    currentSurface = 1 - currentSurface;
    canvas->setBitmapDevice(drawingSurface[currentSurface]);
#endif
}
Beispiel #2
0
void render()
{
    //Typical render pass
	bbutil_clear();

    glEnableClientState(GL_VERTEX_ARRAY);
    glVertexPointer(2, GL_FLOAT, 0, vertices);

    glEnableClientState(GL_COLOR_ARRAY);
    glColorPointer(4, GL_FLOAT, 0, colors);

    glRotatef(angle, 0.0f, 1.0f, 0.0f);

    glDrawArrays(GL_TRIANGLE_STRIP, 0 , 4);

    glDisableClientState(GL_VERTEX_ARRAY);
    glDisableClientState(GL_COLOR_ARRAY);

    //Use utility code to update the screen
    bbutil_swap();
}