working for windows

This commit is contained in:
Carlos Aragones
2020-09-16 11:38:05 +02:00
parent a6e63243f4
commit 82595a8d74
10 changed files with 70 additions and 46 deletions

View File

@ -262,10 +262,7 @@ processEvent(SWindowData *window_data, XEvent *event) {
{
window_data->window_width = event->xconfigure.width;
window_data->window_height = event->xconfigure.height;
window_data->dst_offset_x = 0;
window_data->dst_offset_y = 0;
window_data->dst_width = window_data->window_width;
window_data->dst_height = window_data->window_height;
resize_dst(window_data, event->xconfigure.width, event->xconfigure.height);
SWindowData_X11 *window_data_x11 = (SWindowData_X11 *) window_data->specific;
if(window_data_x11->image_scaler != 0x0) {
@ -336,14 +333,6 @@ mfb_update_ex(struct mfb_window *window, void *buffer, unsigned width, unsigned
SWindowData_X11 *window_data_x11 = (SWindowData_X11 *) window_data->specific;
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;