Skip to content

Commit c2f39a7

Browse files
committed
Fix GL proc table resolution.
1 parent 3469602 commit c2f39a7

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/flutter_application.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include "flutter_application.h"
66

7+
#include <EGL/egl.h>
78
#include <sys/types.h>
89
#include <unistd.h>
910

@@ -81,6 +82,15 @@ FlutterApplication::FlutterApplication(
8182
return reinterpret_cast<FlutterApplication*>(userdata)
8283
->render_delegate_.OnApplicationGetOnscreenFBO();
8384
};
85+
config.open_gl.gl_proc_resolver = [](void* userdata,
86+
const char* name) -> void* {
87+
auto address = eglGetProcAddress(name);
88+
if (address != nullptr) {
89+
return reinterpret_cast<void*>(address);
90+
}
91+
FLWAY_ERROR << "Tried unsuccessfully to resolve: " << name << std::endl;
92+
return nullptr;
93+
};
8494

8595
// TODO: Pipe this in through command line args.
8696
#define MY_PROJECT \

src/wayland_display.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "wayland_display.h"
1010

1111
#include <stdlib.h>
12+
#include <unistd.h>
1213

1314
#include <cstring>
1415

@@ -110,7 +111,9 @@ bool WaylandDisplay::Run() {
110111
return false;
111112
}
112113

113-
FLWAY_WIP;
114+
while (valid_) {
115+
wl_display_dispatch(display_);
116+
}
114117

115118
return true;
116119
}
@@ -325,7 +328,7 @@ bool WaylandDisplay::OnApplicationPresent() {
325328
return false;
326329
}
327330

328-
if (eglSwapBuffers(egl_display_, surface_) != EGL_TRUE) {
331+
if (eglSwapBuffers(egl_display_, egl_surface_) != EGL_TRUE) {
329332
LogLastEGLError();
330333
FLWAY_ERROR << "Could not swap the EGL buffer." << std::endl;
331334
return false;

0 commit comments

Comments
 (0)