mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-31 21:21:06 +01:00 
			
		
		
		
	Merge branch 'master' into docking
# Conflicts: # backends/imgui_impl_dx10.cpp # backends/imgui_impl_dx10.h # backends/imgui_impl_vulkan.h # backends/imgui_impl_win32.cpp # docs/CHANGELOG.txt # examples/README.txt # examples/example_glfw_opengl2/main.cpp # examples/example_glfw_opengl3/main.cpp # examples/example_glfw_vulkan/main.cpp # examples/example_sdl_directx11/main.cpp # examples/example_sdl_opengl2/main.cpp # examples/example_sdl_opengl3/main.cpp # examples/example_sdl_vulkan/main.cpp # examples/example_win32_directx10/main.cpp # examples/example_win32_directx11/main.cpp # examples/example_win32_directx12/main.cpp # examples/example_win32_directx9/main.cpp # imgui.cpp # imgui.h # imgui_demo.cpp # imgui_internal.h
This commit is contained in:
		| @@ -16,9 +16,10 @@ | ||||
| CC = emcc | ||||
| CXX = em++ | ||||
| EXE = example_emscripten.html | ||||
| IMGUI_DIR = ../.. | ||||
| SOURCES = main.cpp | ||||
| SOURCES += ../imgui_impl_sdl.cpp ../imgui_impl_opengl3.cpp | ||||
| SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp ../../imgui_widgets.cpp | ||||
| SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_widgets.cpp | ||||
| SOURCES += $(IMGUI_DIR)/backends/imgui_impl_sdl.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl3.cpp | ||||
| OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) | ||||
| UNAME_S := $(shell uname -s) | ||||
|  | ||||
| @@ -51,7 +52,7 @@ endif | ||||
| ## FINAL BUILD FLAGS | ||||
| ##--------------------------------------------------------------------- | ||||
|  | ||||
| CPPFLAGS += -I../ -I../../ | ||||
| CPPFLAGS = -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends | ||||
| #CPPFLAGS += -g | ||||
| CPPFLAGS += -Wall -Wformat -Os | ||||
| CPPFLAGS += $(EMS) | ||||
| @@ -65,10 +66,10 @@ LDFLAGS += --shell-file shell_minimal.html | ||||
| %.o:%.cpp | ||||
| 	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< | ||||
|  | ||||
| %.o:../%.cpp | ||||
| %.o:$(IMGUI_DIR)/%.cpp | ||||
| 	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< | ||||
|  | ||||
| %.o:../../%.cpp | ||||
| %.o:$(IMGUI_DIR)/backends/%.cpp | ||||
| 	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< | ||||
|  | ||||
| %.o:../libs/gl3w/GL/%.c | ||||
|   | ||||
| @@ -16,5 +16,5 @@ _"Unfortunately several browsers (including Chrome, Safari, and Internet Explore | ||||
|  | ||||
| ## Obsolete features: | ||||
|  | ||||
| - Emscripten 2.0 (August 2020) obsoleted the fastcomp back-end, only llvm is supported. | ||||
| - Emscripten 2.0 (August 2020) obsoleted the fastcomp backend, only llvm is supported. | ||||
| - Emscripten 1.39.0 (October 2019) obsoleted the `BINARYEN_TRAP_MODE=clamp` compilation flag which was required with version older than 1.39.0 to avoid rendering artefacts. See [#2877](https://github.com/ocornut/imgui/issues/2877) for details. If you use an older version, uncomment this line in the Makefile: `#EMS += -s BINARYEN_TRAP_MODE=clamp` | ||||
|   | ||||
| @@ -1,10 +1,11 @@ | ||||
| // dear imgui: standalone example application for Emscripten, using SDL2 + OpenGL3 | ||||
| // Dear ImGui: standalone example application for Emscripten, using SDL2 + OpenGL3 | ||||
| // (Emscripten is a C++-to-javascript compiler, used to publish executables for the web. See https://emscripten.org/) | ||||
| // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. | ||||
| // Read online: https://github.com/ocornut/imgui/tree/master/docs | ||||
|  | ||||
| // This is mostly the same code as the SDL2 + OpenGL3 example, simply with the modifications needed to run on Emscripten. | ||||
| // It is possible to combine both code into a single source file that will compile properly on Desktop and using Emscripten. | ||||
| // See https://github.com/ocornut/imgui/pull/2492 as an example on how to do just that. | ||||
| // | ||||
| // If you are new to dear imgui, see examples/README.txt and documentation at the top of imgui.cpp. | ||||
| // (Emscripten is a C++-to-javascript compiler, used to publish executables for the web. See https://emscripten.org/) | ||||
|  | ||||
| #include "imgui.h" | ||||
| #include "imgui_impl_sdl.h" | ||||
| @@ -73,7 +74,7 @@ int main(int, char**) | ||||
|     ImGui::StyleColorsDark(); | ||||
|     //ImGui::StyleColorsClassic(); | ||||
|  | ||||
|     // Setup Platform/Renderer bindings | ||||
|     // Setup Platform/Renderer backends | ||||
|     ImGui_ImplSDL2_InitForOpenGL(g_Window, g_GLContext); | ||||
|     ImGui_ImplOpenGL3_Init(glsl_version); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user