@@ -154,6 +154,9 @@ void BrowserWindow::terminate() {
154
154
emscripten_set_resize_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this , EM_TRUE, nullptr );
155
155
emscripten_set_focus_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this , EM_TRUE, nullptr );
156
156
emscripten_set_blur_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this , EM_TRUE, nullptr );
157
+ emscripten_set_touchend_callback (" #canvas" , this , EM_TRUE, nullptr );
158
+ emscripten_set_touchstart_callback (" #canvas" , this , EM_TRUE, nullptr );
159
+ emscripten_set_touchmove_callback (" #canvas" , this , EM_TRUE, nullptr );
157
160
EMSCRIPTEN_WEBGL_CONTEXT_HANDLE ctx = emscripten_webgl_get_current_context ();
158
161
emscripten_webgl_destroy_context (ctx);
159
162
@@ -170,10 +173,8 @@ void BrowserWindow::internalInitGL() {
170
173
171
174
EmscriptenWebGLContextAttributes attr;
172
175
emscripten_webgl_init_context_attributes (&attr);
173
- attr.explicitSwapControl = 1 ;
174
- attr.renderViaOffscreenBackBuffer = 1 ;
175
176
attr.majorVersion = 2 ;
176
- attr.alpha = attr.depth = attr.stencil = attr.antialias = attr.preserveDrawingBuffer = attr.failIfMajorPerformanceCaveat = 0 ;
177
+ attr.renderViaOffscreenBackBuffer = attr. explicitSwapControl = attr. alpha = attr.depth = attr.stencil = attr.antialias = attr.preserveDrawingBuffer = attr.failIfMajorPerformanceCaveat = 0 ;
177
178
EMSCRIPTEN_WEBGL_CONTEXT_HANDLE ctx = emscripten_webgl_create_context (" #canvas" , &attr);
178
179
emscripten_webgl_make_context_current (ctx);
179
180
@@ -492,7 +493,7 @@ void BrowserWindow::handleFocusCallback(int eventType, const EmscriptenFocusEven
492
493
}
493
494
494
495
void BrowserWindow::swapBuffers () {
495
- emscripten_webgl_commit_frame ();
496
+ // emscripten_webgl_commit_frame(); // removed to improve performance (reduce CPU overhead)
496
497
}
497
498
498
499
void BrowserWindow::setVerticalSync (bool enable) {
0 commit comments