/* Gets a pointer to the Screen buffer associated with the given window. Note that the buffer is actually created in createWindow().  */
static int createWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
/* Gets a pointer to the Screen buffer associated with the given window. Note that the buffer is actually created in createWindow().  */
static int createWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
{
    window_impl_t   *impl = (window_impl_t *)window->driverdata;
    screen_buffer_t buffer;
    if (screen_get_window_property_pv(impl->window, SCREEN_PROPERTY_BUFFERS,
                                      (void **)&buffer) < 0) {
        return -1;
    }
    if (screen_get_buffer_property_pv(buffer, SCREEN_PROPERTY_POINTER,
                                      pixels) < 0) {
        return -1;
    }
    if (screen_get_buffer_property_iv(buffer, SCREEN_PROPERTY_STRIDE,
                                      pitch) < 0) {
        return -1;
    }
    *format = SDL_PIXELFORMAT_RGB888;
    return 0;
}