示例#1
0
/**
 * Resizes screen buffer to fit new screen geometry.
 * Call on screen change events like rotation. 
 *
 * @param width new width of the screen buffer
 * @param height new height of the screen buffer
 * @return ALL_OK if successful, OUT_OF_MEMORY in the case of
 *   not enough memory to reallocate the buffer
 */
MIDPError gxj_resize_screen_buffer(int width, int height) {

    if (gxj_system_screen_buffer.pixelData != NULL) {
        if (gxj_system_screen_buffer.width == width &&
        	gxj_system_screen_buffer.height == height) {

	    gxj_reset_screen_buffer();
            // no need to reallocate buffer, return
            return ALL_OK;

        } else {
    	    // IMPL_NOTE: It is up to caller to check that
    	    //   new screen buffer size is not bigger than 
    	    //   the screen itself, and to clear screen
    	    //   content on resizing

            // free screen buffer
            gxj_free_screen_buffer();
        }
    }
    // allocate resized screen buffer
    return gxj_init_screen_buffer(width, height);
}
示例#2
0
/** Frees native reources allocated for frame buffer */
void finalizeFrameBuffer() {
    gxj_free_screen_buffer();
}