From 6b77f40a96ea1d97cfa062e4213ee946bcf71435 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 20 Sep 2025 23:35:34 +0200 Subject: [PATCH] Use gles2 as default UI type under wasm Signed-off-by: falkTX --- Makefile.base.mk | 8 ++------ Makefile.plugins.mk | 4 ++++ dgl/Makefile | 5 +++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Makefile.base.mk b/Makefile.base.mk index 27c232d4..f09cea9b 100644 --- a/Makefile.base.mk +++ b/Makefile.base.mk @@ -668,13 +668,9 @@ endif ifeq ($(USE_GLES2),true) BUILD_CXX_FLAGS += -DDGL_USE_OPENGL3 -DDGL_USE_GLES -DDGL_USE_GLES2 -endif - -ifeq ($(USE_GLES3),true) +else ifeq ($(USE_GLES3),true) BUILD_CXX_FLAGS += -DDGL_USE_OPENGL3 -DDGL_USE_GLES -DDGL_USE_GLES3 -endif - -ifeq ($(USE_OPENGL3),true) +else ifeq ($(USE_OPENGL3),true) BUILD_CXX_FLAGS += -DDGL_USE_OPENGL3 endif diff --git a/Makefile.plugins.mk b/Makefile.plugins.mk index 9b8078f2..ec97d624 100644 --- a/Makefile.plugins.mk +++ b/Makefile.plugins.mk @@ -205,8 +205,12 @@ UI_TYPE = none endif ifeq ($(UI_TYPE),) +ifeq ($(WASM),true) +UI_TYPE = gles2 +else UI_TYPE = opengl endif +endif ifeq ($(UI_TYPE),generic) ifeq ($(HAVE_OPENGL),true) diff --git a/dgl/Makefile b/dgl/Makefile index f19d0555..a3583699 100644 --- a/dgl/Makefile +++ b/dgl/Makefile @@ -171,8 +171,13 @@ all: $(TARGETS) cairo: $(BUILD_DIR)/libdgl-cairo.a gles2: $(BUILD_DIR)/libdgl-gles2.a gles3: $(BUILD_DIR)/libdgl-gles3.a +ifeq ($(WASM),true) +opengl: gles2 +opengl3: gles3 +else opengl: $(BUILD_DIR)/libdgl-opengl.a opengl3: $(BUILD_DIR)/libdgl-opengl3.a +endif stub: $(BUILD_DIR)/libdgl-stub.a vulkan: $(BUILD_DIR)/libdgl-vulkan.a web: $(BUILD_DIR)/libdgl-web.a