Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Emscripten target for SDL/OpenGL3 example. #2492

Closed
wants to merge 1 commit into from

Conversation

nicolasnoble
Copy link
Contributor

@nicolasnoble nicolasnoble commented Apr 13, 2019

This PR adds Emscripten support for the SDL/OpenGL3 example. The changes are minimal, but require WebGL2/GLES3 to work, which you can't necessarily find everywhere.

You can see the page in action here: http://static.grumpycoder.net/pixel/example_sdl_opengl3.html

I have successfully loaded this on Firefox, Chrome for Android, and some versions of Chrome. Microsoft Edge doesn't properly load this, and I have seen some versions of Chrome crashing with an "Aw snap."

I guess it may be a good idea to ultimately host this on http://www.dearimgui.org/ and point people at it when trying to explain imgui things, like in the fiasco from #2488.

image

@nicolasnoble
Copy link
Contributor Author

We'll do #2494 instead of this one. Keeping this one around for reference on how to do a single piece of code that can be both emscripten-compatible and desktop-compatible.

JohanSmet added a commit to JohanSmet/lsim that referenced this pull request Sep 13, 2019
@ocornut ocornut added the web label Jul 8, 2021
mljack pushed a commit to mljack/obb_editor that referenced this pull request Nov 10, 2022
mljack added a commit to mljack/obb_editor that referenced this pull request Nov 11, 2022
mljack added a commit to mljack/obb_editor that referenced this pull request Dec 4, 2022
     Follow changes in this PR: ocornut/imgui#2492 and use WebGL1 with GL ES2.
2. Use GL ES 3.0 + GLSL 300 ES (WebGL2).
3. Load and render texture.
4. Add imgui-1.88 to third_party.
5. Add file open dialog and enable C++ debugging in chrome devtools.
6. Use cmake to build obb_editor on both Linux native and WebAssembly.
mljack added a commit to mljack/obb_editor that referenced this pull request Dec 5, 2022
     Follow changes in this PR: ocornut/imgui#2492 and use WebGL1 with GL ES2.
2. Use GL ES 3.0 + GLSL 300 ES (WebGL2).
3. Load and render texture.
4. Add imgui-1.88 to third_party.
5. Add file open dialog and enable C++ debugging in chrome devtools.
6. Use cmake to build obb_editor on both Linux native and WebAssembly.
ocornut added a commit that referenced this pull request Feb 2, 2023
…cilitate use with Emscripten. (#2492, #3699)

Aligned all examples.
ocornut added a commit that referenced this pull request Feb 2, 2023
@ocornut
Copy link
Owner

ocornut commented Feb 2, 2023

FYI : I've pushed 96ab68e and ce6e6da making the SDL+GL and GLFW+GL examples also build and run with Emscripten, without the need for a dedicated Emscripten example.

ocornut added a commit that referenced this pull request Feb 3, 2023
… function..." (#2492, #3699)"

This reverts commit 96ab68e.

# Conflicts:
#	docs/CHANGELOG.txt
#	examples/example_glfw_opengl3/main.cpp
#	examples/example_sdl_opengl3/main.cpp
ocornut added a commit that referenced this pull request Feb 3, 2023
ocornut added a commit that referenced this pull request Feb 3, 2023
@ocornut
Copy link
Owner

ocornut commented Feb 3, 2023

Eventually caved in and applied your solution after hiding it being macros and dedicated helper stub:
ea39841

Which allowed me to revert all the examples refactor.. Lost some time but happier about this solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants