Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix compile and doc
  • Loading branch information
dkwingsmt committed Sep 22, 2023
commit 63a70e86533d1c695b8098e4aaa50fe2a4107519
6 changes: 4 additions & 2 deletions examples/glfw/FlutterEmbedderGLFW.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,16 @@ static void GLFWKeyCallback(GLFWwindow* window,
}

void GLFWwindowSizeCallback(GLFWwindow* window, int width, int height) {
// TODO(dkwingsmt): The GLFW embedder doesn't support multi-view for now. Use
// the real view ID when it does.
int64_t view_id = kImplicitViewId;
FlutterWindowMetricsEvent event = {};
memset(&event, 0, sizeof(FlutterWindowMetricsEvent));
event.struct_size = sizeof(event);
event.width = width * g_pixelRatio;
event.height = height * g_pixelRatio;
event.pixel_ratio = g_pixelRatio;
// TODO(dkwingsmt)
event.view_id = kImplicitViewId;
event.view_id = view_id;
FlutterEngineSendWindowMetricsEvent(
reinterpret_cast<FlutterEngine>(glfwGetWindowUserPointer(window)),
&event);
Expand Down
6 changes: 4 additions & 2 deletions examples/glfw_drm/FlutterEmbedderGLFW.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,16 @@ static void GLFWKeyCallback(GLFWwindow* window,
}

void GLFWwindowSizeCallback(GLFWwindow* window, int width, int height) {
// TODO(dkwingsmt): The GLFW embedder doesn't support multi-view for now. Use
// the real view ID when it does.
int64_t view_id = kImplicitViewId;
FlutterWindowMetricsEvent event = {};
memset(&event, 0, sizeof(FlutterWindowMetricsEvent));
event.struct_size = sizeof(event);
event.width = width * g_pixelRatio;
event.height = height * g_pixelRatio;
event.pixel_ratio = g_pixelRatio;
// TODO(dkwingsmt)
event.view_id = kImplicitViewId;
event.view_id = view_id;
FlutterEngineSendWindowMetricsEvent(
reinterpret_cast<FlutterEngine>(glfwGetWindowUserPointer(window)),
&event);
Expand Down
6 changes: 4 additions & 2 deletions examples/vulkan_glfw/src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,16 @@ void GLFWKeyCallback(GLFWwindow* window,
void GLFWframebufferSizeCallback(GLFWwindow* window, int width, int height) {
g_state.resize_pending = true;

// TODO(dkwingsmt): GLFW doesn't support multi-view for now. Use the real
// view ID when it does.
int64_t view_id = kImplicitViewId;
FlutterWindowMetricsEvent event = {};
memset(&event, 0, sizeof(FlutterWindowMetricsEvent));
event.struct_size = sizeof(event);
event.width = width;
event.height = height;
event.pixel_ratio = g_pixelRatio;
// TODO(dkwingsmt)
event.view_id = kImplicitViewId;
event.view_id = view_id;
FlutterEngineSendWindowMetricsEvent(g_state.engine, &event);
}

Expand Down
Loading