prepare Linux Wayland & iOS

This commit is contained in:
Carlos Aragones 2020-09-15 15:24:05 +02:00
parent 8d68f620df
commit 9a74e07568
2 changed files with 31 additions and 2 deletions

View File

@ -129,6 +129,17 @@ mfb_update(struct mfb_window *window, void *buffer) {
return STATE_INVALID_WINDOW;
}
SWindowData *window_data = (SWindowData *) window;
mfb_update_ex(window, buffer, window_data->buffer_width, window_data->buffer_height);
}
//-------------------------------------
mfb_update_state
mfb_update_ex(struct mfb_window *window, void *buffer, unsigned width, unsigned height) {
if(window == 0x0) {
return STATE_INVALID_WINDOW;
}
SWindowData *window_data = (SWindowData *) window;
if(window_data->close) {
destroy_window_data(window_data);

View File

@ -14,6 +14,7 @@
#include <string.h>
#include <unistd.h>
#include <linux/limits.h>
#include <linux/input.h>
#include <linux/input-event-codes.h>
@ -703,8 +704,22 @@ wl_callback_listener frame_listener = {
.done = frame_done,
};
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
mfb_update_state
mfb_update(struct mfb_window *window, void *buffer)
mfb_update(struct mfb_window *window, void *buffer) {
if (window == 0x0) {
return STATE_INVALID_WINDOW;
}
SWindowData *window_data = (SWindowData *) window;
return mfb_update_ex(window, buffer, window_data->buffer_width, window_data->buffer_height);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
mfb_update_state
mfb_update_ex(struct mfb_window *window, void *buffer, unsigned width, unsigned height)
{
uint32_t done = 0;
@ -726,6 +741,9 @@ mfb_update(struct mfb_window *window, void *buffer)
if (!window_data_way->display || wl_display_get_error(window_data_way->display) != 0)
return STATE_INTERNAL_ERROR;
if(window_data->buffer_width != width || window_data->buffer_height != height) {
}
// update shm buffer
memcpy(window_data_way->shm_ptr, buffer, window_data->buffer_stride * window_data->buffer_height);