Skip to content

Commit c020315

Browse files
committed
Add GLFW-based proc resolving
1 parent 800c6b3 commit c020315

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

library/linux/src/embedder.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@ static void GLFWClearCanvas(GLFWwindow *window) {
199199
glfwMakeContextCurrent(nullptr);
200200
}
201201

202+
// Resolves the address of the specified OpenGL or OpenGL ES
203+
// core or extension function, if it is supported by the current context.
204+
static void* GLFWProcResolver(void *user_data, const char * name) {
205+
return (void*) glfwGetProcAddress(name);
206+
}
207+
202208
// Spins up an instance of the Flutter Engine.
203209
//
204210
// This function launches the Flutter Engine in a background thread, supplying
@@ -222,6 +228,7 @@ static FlutterEngine RunFlutterEngine(
222228
config.open_gl.clear_current = GLFWClearContext;
223229
config.open_gl.present = GLFWPresent;
224230
config.open_gl.fbo_callback = GLFWGetActiveFbo;
231+
config.open_gl.gl_proc_resolver = GLFWProcResolver;
225232
FlutterProjectArgs args = {};
226233
args.struct_size = sizeof(FlutterProjectArgs);
227234
args.assets_path = assets_path.c_str();

0 commit comments

Comments
 (0)