added mfb_update_ex - MacOS X - Cocoa version (I cannot test it!!!)

This commit is contained in:
Carlos Aragones 2020-09-15 13:39:55 +02:00
parent e98644cfbf
commit 94a22bff6a

View File

@ -264,6 +264,20 @@ mfb_update_ex(struct mfb_window *window, void *buffer, unsigned width, unsigned
memcpy(window_data->draw_buffer, buffer, window_data->buffer_stride * window_data->buffer_height); memcpy(window_data->draw_buffer, buffer, window_data->buffer_stride * window_data->buffer_height);
#else #else
if(window_data->buffer_width != width || window_data->buffer_height != height) {
float deltaX = (float) width / (float) window_data->buffer_width;
float deltaY = (float) height / (float) window_data->buffer_height;
window_data->dst_offset_x *= deltaX;
window_data->dst_offset_y *= deltaY;
window_data->dst_width *= deltaX;
window_data->dst_height *= deltaY;
window_data->buffer_width = width;
window_data->buffer_stride = width * 4;
window_data->buffer_height = height;
}
window_data->draw_buffer = buffer; window_data->draw_buffer = buffer;
#endif #endif