Rename example_emscripten/ to example_emscripten_opengl3/ (#3632)

docking
ocornut 4 years ago
parent ae3e2406ec
commit d20f2bc90a

@ -393,12 +393,12 @@ jobs:
emsdk-master/emsdk install latest
emsdk-master/emsdk activate latest
- name: Build example_emscripten
- name: Build example_emscripten_opengl3
run: |
pushd emsdk-master
source ./emsdk_env.sh
popd
make -C examples/example_emscripten
make -C examples/example_emscripten_opengl3
Discord-CI:
runs-on: ubuntu-18.04

2
.gitignore vendored

@ -34,7 +34,7 @@ xcuserdata
examples/*.o.tmp
examples/*.out.js
examples/*.out.wasm
examples/example_emscripten/example_emscripten.*
examples/example_emscripten_opengl3/example_emscripten_opengl3.*
## JetBrains IDE artifacts
.idea

@ -75,7 +75,7 @@ List of high-level Frameworks Backends (combining Platform + Renderer):
imgui_impl_marmalade.cpp
Emscripten is also supported.
The [example_emscripten](https://github.com/ocornut/imgui/tree/master/examples/example_emscripten) app uses imgui_impl_sdl.cpp + imgui_impl_opengl3.cpp, but other combos are possible.
The [example_emscripten_opengl3](https://github.com/ocornut/imgui/tree/master/examples/example_emscripten_opengl3) app uses imgui_impl_sdl.cpp + imgui_impl_opengl3.cpp, but other combos are possible.
### Backends for third-party frameworks, graphics API or other languages

@ -93,6 +93,7 @@ Other Changes:
- Backends: OSX: Fix keypad-enter key not working on MacOS. (#3554) [@rokups, @lfnoise]
- Examples: Apple+Metal: Consolidated/simplified to get closer to other examples. (#3543) [@warrenm]
- Examples: Apple+Metal: Forward events down so OS key combination like Cmd+Q can work. (#3554) [@rokups]
- Examples: Emscripten: Renamed example_emscripten/ to example_emscripten_opengl3/. (#3632)
- CI: Fix testing for Windows DLL builds. (#3603, #3601) [@iboB]
- Docs: Split examples/README.txt into docs/BACKENDS.md and docs/EXAMPLES.md improved them.
- Docs: Consistently renamed all occurences of "binding" and "back-end" to "backend" in comments and docs.

@ -92,7 +92,7 @@ OSX + OpenGL2 example. <BR>
(NB: imgui_impl_osx.mm is currently not as feature complete as other platforms backends.
You may prefer to use the GLFW Or SDL backends, which will also support Windows and Linux.)
[example_emscripten/](https://github.com/ocornut/imgui/blob/master/examples/example_emscripten/) <BR>
[example_emscripten_opengl3/](https://github.com/ocornut/imgui/blob/master/examples/example_emscripten_opengl3/) <BR>
Emcripten + SDL2 + OpenGL3+/ES2/ES3 example. <BR>
= main.cpp + imgui_impl_sdl.cpp + imgui_impl_opengl3.cpp <BR>
Note that other examples based on SDL or GLFW + OpenGL could easily be modified to work with Emscripten.

@ -7,15 +7,15 @@
# (On Windows, you may need to execute emsdk_env.bat or encmdprompt.bat ahead)
#
# Running `make` will produce three files:
# - example_emscripten.html
# - example_emscripten.js
# - example_emscripten.wasm
# - example_emscripten_opengl3.html
# - example_emscripten_opengl3.js
# - example_emscripten_opengl3.wasm
#
# All three are needed to run the demo.
CC = emcc
CXX = em++
EXE = example_emscripten.html
EXE = example_emscripten_opengl3.html
IMGUI_DIR = ../..
SOURCES = main.cpp
SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_widgets.cpp

@ -4,14 +4,14 @@
- You need to install Emscripten from https://emscripten.org/docs/getting_started/downloads.html, and have the environment variables set, as described in https://emscripten.org/docs/getting_started/downloads.html#installation-instructions
- You may also refer to our [Continuous Integration setup](https://github.com/ocornut/imgui/tree/master/.github/workflows) for Emscripten setup.
- Depending on your configuration, in Windows you may need to run `emsdk/emsdk_env.bat` in your console to access the Emscripten command-line tools.
- Then build using `make` while in the `example_emscripten/` directory.
- Then build using `make` while in the `example_emscripten_opengl3/` directory.
## How to Run
To run on a local machine:
- Generally you may need a local webserver. Quoting [https://emscripten.org/docs/getting_started](https://emscripten.org/docs/getting_started/Tutorial.html#generating-html):<br>
_"Unfortunately several browsers (including Chrome, Safari, and Internet Explorer) do not support file:// [XHR](https://emscripten.org/docs/site/glossary.html#term-xhr) requests, and cant load extra files needed by the HTML (like a .wasm file, or packaged file data as mentioned lower down). For these browsers youll need to serve the files using a [local webserver](https://emscripten.org/docs/getting_started/FAQ.html#faq-local-webserver) and then open http://localhost:8000/hello.html."_
- Emscripten SDK has a handy `emrun` command: `emrun example_emscripten.html` which will spawn a temporary local webserver. See https://emscripten.org/docs/compiling/Running-html-files-with-emrun.html for details.
- Emscripten SDK has a handy `emrun` command: `emrun example_emscripten_opengl3.html` which will spawn a temporary local webserver. See https://emscripten.org/docs/compiling/Running-html-files-with-emrun.html for details.
- Otherwise you may use Python builtin webserver: `python -m http.server` in Python 3 or `python -m SimpleHTTPServer` in Python 2. After doing that, you can visit http://localhost:8000/.
## Obsolete features:
Loading…
Cancel
Save