From e418da1d3bcc9cfac1209b9e276e962915220155 Mon Sep 17 00:00:00 2001 From: Tanishq Dubey Date: Wed, 12 Jun 2024 09:23:41 -0400 Subject: [PATCH] simple renames, remove a bunch of emscripten code --- Makefile | 2 +- Makefile.emscripten | 92 ----------- build_win32.bat | 8 - emscripten_browser_file.h | 97 ----------- example_sdl2_opengl3.vcxproj | 187 ---------------------- example_sdl2_opengl3.vcxproj.filters | 67 -------- lib/emscripten/emscripten_mainloop_stub.h | 37 ----- lib/emscripten/shell_minimal.html | 65 -------- lib/emscripten_browser_file.h | 97 ----------- main.cpp | 19 +-- 10 files changed, 2 insertions(+), 669 deletions(-) delete mode 100644 Makefile.emscripten delete mode 100644 build_win32.bat delete mode 100644 emscripten_browser_file.h delete mode 100644 example_sdl2_opengl3.vcxproj delete mode 100644 example_sdl2_opengl3.vcxproj.filters delete mode 100644 lib/emscripten/emscripten_mainloop_stub.h delete mode 100644 lib/emscripten/shell_minimal.html delete mode 100644 lib/emscripten_browser_file.h diff --git a/Makefile b/Makefile index cb89d31..1e354e0 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ #CXX = g++ #CXX = clang++ -EXE = ppdnode +EXE = tview IMGUI_DIR = lib SOURCES = main.cpp SOURCES += $(wildcard $(IMGUI_DIR)/*.cpp) diff --git a/Makefile.emscripten b/Makefile.emscripten deleted file mode 100644 index 29c51c7..0000000 --- a/Makefile.emscripten +++ /dev/null @@ -1,92 +0,0 @@ -# -# Makefile to use with SDL+emscripten -# See https://emscripten.org/docs/getting_started/downloads.html -# for installation instructions. -# -# This Makefile assumes you have loaded emscripten's environment. -# (On Windows, you may need to execute emsdk_env.bat or encmdprompt.bat ahead) -# -# Running `make -f Makefile.emscripten` will produce three files: -# - web/index.html -# - web/index.js -# - web/index.wasm -# -# All three are needed to run the demo. - -CC = emcc -CXX = em++ -WEB_DIR = web -EXE = $(WEB_DIR)/index.html -IMGUI_DIR = lib -SOURCES = main.cpp -SOURCES += $(wildcard $(IMGUI_DIR)/*.cpp) -SOURCES += $(wildcard $(IMGUI_DIR)/backends/*.cpp) -OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) -UNAME_S := $(shell uname -s) -CPPFLAGS = -std=c++20 -DIMGUI_DEFINE_MATH_OPERATORS -LDFLAGS = -EMS = - -##--------------------------------------------------------------------- -## EMSCRIPTEN OPTIONS -##--------------------------------------------------------------------- - -# ("EMS" options gets added to both CPPFLAGS and LDFLAGS, whereas some options are for linker only) -EMS += -s USE_SDL=2 -flto -O2 -EMS += -s DISABLE_EXCEPTION_CATCHING=1 -LDFLAGS += -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s NO_EXIT_RUNTIME=0 -s ASSERTIONS=1 -sEXPORTED_FUNCTIONS=[_main,_malloc,_free] -sEXPORTED_RUNTIME_METHODS=[ccall] - -# Uncomment next line to fix possible rendering bugs with Emscripten version older then 1.39.0 (https://github.com/ocornut/imgui/issues/2877) -#EMS += -s BINARYEN_TRAP_MODE=clamp -#EMS += -s SAFE_HEAP=1 ## Adds overhead - -# Emscripten allows preloading a file or folder to be accessible at runtime. -# The Makefile for this example project suggests embedding the misc/fonts/ folder into our application, it will then be accessible as "/fonts" -# See documentation for more details: https://emscripten.org/docs/porting/files/packaging_files.html -# (Default value is 0. Set to 1 to enable file-system and include the misc/fonts/ folder as part of the build.) -USE_FILE_SYSTEM ?= 0 -ifeq ($(USE_FILE_SYSTEM), 0) -LDFLAGS += -s NO_FILESYSTEM=1 -CPPFLAGS += -DIMGUI_DISABLE_FILE_FUNCTIONS -endif -ifeq ($(USE_FILE_SYSTEM), 1) -LDFLAGS += --no-heap-copy --preload-file ../../misc/fonts@/fonts -endif - -##--------------------------------------------------------------------- -## FINAL BUILD FLAGS -##--------------------------------------------------------------------- - -CPPFLAGS += -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends -#CPPFLAGS += -g -CPPFLAGS += -Os $(EMS) -LDFLAGS += --shell-file lib/emscripten/shell_minimal.html -LDFLAGS += $(EMS) - -##--------------------------------------------------------------------- -## BUILD RULES -##--------------------------------------------------------------------- - -%.o:%.cpp - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< - -%.o:$(IMGUI_DIR)/%.cpp - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< - -%.o:$(IMGUI_DIR)/backends/%.cpp - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< - -all: $(EXE) - @echo Build complete for $(EXE) - -$(WEB_DIR): - mkdir $@ - -serve: all - python3 -m http.server -d $(WEB_DIR) - -$(EXE): clean $(OBJS) $(WEB_DIR) - $(CXX) -o $@ $(OBJS) $(LDFLAGS) - -clean: - rm -rf $(OBJS) $(WEB_DIR) diff --git a/build_win32.bat b/build_win32.bat deleted file mode 100644 index 7b2fac9..0000000 --- a/build_win32.bat +++ /dev/null @@ -1,8 +0,0 @@ -@REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. -@set OUT_DIR=Debug -@set OUT_EXE=example_sdl2_opengl3 -@set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include -@set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp -@set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib shell32.lib -mkdir %OUT_DIR% -cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console diff --git a/emscripten_browser_file.h b/emscripten_browser_file.h deleted file mode 100644 index df58a4f..0000000 --- a/emscripten_browser_file.h +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef EMSCRIPTEN_UPLOAD_FILE_H_INCLUDED -#define EMSCRIPTEN_UPLOAD_FILE_H_INCLUDED - -#include -#include - -#define _EM_JS_INLINE(ret, c_name, js_name, params, code) \ - extern "C" { \ - ret c_name params EM_IMPORT(js_name); \ - EMSCRIPTEN_KEEPALIVE \ - __attribute__((section("em_js"), aligned(1))) inline char __em_js__##js_name[] = \ - #params "<::>" code; \ - } - -#define EM_JS_INLINE(ret, name, params, ...) _EM_JS_INLINE(ret, name, name, params, #__VA_ARGS__) - -namespace emscripten_browser_file { - -/////////////////////////////////// Interface ////////////////////////////////// - -using upload_handler = void(*)(std::string const&, std::string const&, std::string_view buffer, void*); - -inline void upload(std::string const &accept_types, upload_handler callback, void *callback_data = nullptr); -inline void download(std::string const &filename, std::string const &mime_type, std::string_view buffer); - -///////////////////////////////// Implementation /////////////////////////////// - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wmissing-variable-declarations" -EM_JS_INLINE(void, upload, (char const *accept_types, upload_handler callback, void *callback_data), { - /// Prompt the browser to open the file selector dialogue, and pass the file to the given handler - /// Accept-types are in the format ".png,.jpeg,.jpg" as per https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept - /// Upload handler callback signature is: - /// void my_handler(std::string const &filename, std::string const &mime_type, std::string_view buffer, void *callback_data = nullptr); - globalThis["open_file"] = function(e) { - const file_reader = new FileReader(); - file_reader.onload = (event) => { - const uint8Arr = new Uint8Array(event.target.result); - const data_ptr = Module["_malloc"](uint8Arr.length); - const data_on_heap = new Uint8Array(Module["HEAPU8"].buffer, data_ptr, uint8Arr.length); - data_on_heap.set(uint8Arr); - Module["ccall"]('upload_file_return', 'number', ['string', 'string', 'number', 'number', 'number', 'number'], [event.target.filename, event.target.mime_type, data_on_heap.byteOffset, uint8Arr.length, callback, callback_data]); - Module["_free"](data_ptr); - }; - file_reader.filename = e.target.files[0].name; - file_reader.mime_type = e.target.files[0].type; - file_reader.readAsArrayBuffer(e.target.files[0]); - }; - - var file_selector = document.createElement('input'); - file_selector.setAttribute('type', 'file'); - file_selector.setAttribute('onchange', 'globalThis["open_file"](event)'); - file_selector.setAttribute('accept', UTF8ToString(accept_types)); - file_selector.click(); -}); -#pragma GCC diagnostic pop - -inline void upload(std::string const &accept_types, upload_handler callback, void *callback_data) { - /// C++ wrapper for javascript upload call - upload(accept_types.c_str(), callback, callback_data); -} - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wmissing-variable-declarations" -EM_JS_INLINE(void, download, (char const *filename, char const *mime_type, void const *buffer, size_t buffer_size), { - /// Offer a buffer in memory as a file to download, specifying download filename and mime type - var a = document.createElement('a'); - a.download = UTF8ToString(filename); - a.href = URL.createObjectURL(new Blob([new Uint8Array(Module["HEAPU8"].buffer, buffer, buffer_size)], {type: UTF8ToString(mime_type)})); - a.click(); -}); -#pragma GCC diagnostic pop - -inline void download(std::string const &filename, std::string const &mime_type, std::string_view buffer) { - /// C++ wrapper for javascript download call, accepting a string_view - download(filename.c_str(), mime_type.c_str(), buffer.data(), buffer.size()); -} - -namespace { - -extern "C" { - -EMSCRIPTEN_KEEPALIVE inline int upload_file_return(char const *filename, char const *mime_type, char *buffer, size_t buffer_size, upload_handler callback, void *callback_data); - -EMSCRIPTEN_KEEPALIVE inline int upload_file_return(char const *filename, char const *mime_type, char *buffer, size_t buffer_size, upload_handler callback, void *callback_data) { - /// Load a file - this function is called from javascript when the file upload is activated - callback(filename, mime_type, {buffer, buffer_size}, callback_data); - return 1; -} - -} - -} - -} - -#endif // EMSCRIPTEN_UPLOAD_FILE_H_INCLUDED diff --git a/example_sdl2_opengl3.vcxproj b/example_sdl2_opengl3.vcxproj deleted file mode 100644 index 096f9a8..0000000 --- a/example_sdl2_opengl3.vcxproj +++ /dev/null @@ -1,187 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {BBAEB705-1669-40F3-8567-04CF6A991F4C} - example_sdl2_opengl3 - 8.1 - - - - Application - true - MultiByte - v140 - - - Application - true - MultiByte - v140 - - - Application - false - true - MultiByte - v140 - - - Application - false - true - MultiByte - v140 - - - - - - - - - - - - - - - - - - - $(ProjectDir)$(Configuration)\ - $(ProjectDir)$(Configuration)\ - $(IncludePath) - - - $(ProjectDir)$(Configuration)\ - $(ProjectDir)$(Configuration)\ - $(IncludePath) - - - $(ProjectDir)$(Configuration)\ - $(ProjectDir)$(Configuration)\ - $(IncludePath) - - - $(ProjectDir)$(Configuration)\ - $(ProjectDir)$(Configuration)\ - $(IncludePath) - - - - Level4 - Disabled - ..\..;..\..\backends;%SDL2_DIR%\include;$(VcpkgCurrentInstalledDir)include\SDL2;%(AdditionalIncludeDirectories) - /utf-8 %(AdditionalOptions) - - - true - %SDL2_DIR%\lib\x86;%(AdditionalLibraryDirectories) - opengl32.lib;SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - Console - msvcrt.lib - - - - - Level4 - Disabled - ..\..;..\..\backends;%SDL2_DIR%\include;$(VcpkgCurrentInstalledDir)include\SDL2;%(AdditionalIncludeDirectories) - /utf-8 %(AdditionalOptions) - - - true - %SDL2_DIR%\lib\x64;%(AdditionalLibraryDirectories) - opengl32.lib;SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - Console - msvcrt.lib - - - - - Level4 - MaxSpeed - true - true - ..\..;..\..\backends;%SDL2_DIR%\include;$(VcpkgCurrentInstalledDir)include\SDL2;%(AdditionalIncludeDirectories) - false - /utf-8 %(AdditionalOptions) - - - true - true - true - %SDL2_DIR%\lib\x86;%(AdditionalLibraryDirectories) - opengl32.lib;SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - Console - - - - - - - Level4 - MaxSpeed - true - true - ..\..;..\..\backends;%SDL2_DIR%\include;$(VcpkgCurrentInstalledDir)include\SDL2;%(AdditionalIncludeDirectories) - false - /utf-8 %(AdditionalOptions) - - - true - true - true - %SDL2_DIR%\lib\x64;%(AdditionalLibraryDirectories) - opengl32.lib;SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - Console - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/example_sdl2_opengl3.vcxproj.filters b/example_sdl2_opengl3.vcxproj.filters deleted file mode 100644 index b5ea53d..0000000 --- a/example_sdl2_opengl3.vcxproj.filters +++ /dev/null @@ -1,67 +0,0 @@ - - - - - {20b90ce4-7fcb-4731-b9a0-075f875de82d} - - - {f18ab499-84e1-499f-8eff-9754361e0e52} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - imgui - - - imgui - - - imgui - - - sources - - - sources - - - sources - - - imgui - - - imgui - - - - - imgui - - - imgui - - - imgui - - - sources - - - sources - - - sources - - - - - - imgui - - - imgui - - - \ No newline at end of file diff --git a/lib/emscripten/emscripten_mainloop_stub.h b/lib/emscripten/emscripten_mainloop_stub.h deleted file mode 100644 index 05cf60f..0000000 --- a/lib/emscripten/emscripten_mainloop_stub.h +++ /dev/null @@ -1,37 +0,0 @@ -// What does this file solves? -// - Since Dear ImGui 1.00 we took pride that most of our examples applications had their entire -// main-loop inside the main() function. That's because: -// - It makes the examples easier to read, keeping the code sequential. -// - It permit the use of local variables, making it easier to try things and perform quick -// changes when someone needs to quickly test something (vs having to structure the example -// in order to pass data around). This is very important because people use those examples -// to craft easy-to-past repro when they want to discuss features or report issues. -// - It conveys at a glance that this is a no-BS framework, it won't take your main loop away from you. -// - It is generally nice and elegant. -// - However, comes Emscripten... it is a wonderful and magical tech but it requires a "main loop" function. -// - Only some of our examples would run on Emscripten. Typically the ones rendering with GL or WGPU ones. -// - I tried to refactor those examples but felt it was problematic that other examples didn't follow the -// same layout. Why would the SDL+GL example be structured one way and the SGL+DX11 be structured differently? -// Especially as we are trying hard to convey that using a Dear ImGui backend in an *existing application* -// should requires only a few dozens lines of code, and this should be consistent and symmetrical for all backends. -// - So the next logical step was to refactor all examples to follow that layout of using a "main loop" function. -// This worked, but it made us lose all the nice things we had... - -// Since only about 3 examples really need to run with Emscripten, here's our solution: -// - Use some weird macros and capturing lambda to turn a loop in main() into a function. -// - Hide all that crap in this file so it doesn't make our examples unusually ugly. -// As a stance and principle of Dear ImGui development we don't use C++ headers and we don't -// want to suggest to the newcomer that we would ever use C++ headers as this would affect -// the initial judgment of many of our target audience. -// - Technique is based on this idea: https://github.com/ocornut/imgui/pull/2492/ -#ifdef __EMSCRIPTEN__ -#include -#include -static std::function MainLoopForEmscriptenP; -static void MainLoopForEmscripten() { MainLoopForEmscriptenP(); } -#define EMSCRIPTEN_MAINLOOP_BEGIN MainLoopForEmscriptenP = [&]() -#define EMSCRIPTEN_MAINLOOP_END ; emscripten_set_main_loop(MainLoopForEmscripten, 0, true) -#else -#define EMSCRIPTEN_MAINLOOP_BEGIN -#define EMSCRIPTEN_MAINLOOP_END -#endif diff --git a/lib/emscripten/shell_minimal.html b/lib/emscripten/shell_minimal.html deleted file mode 100644 index f327823..0000000 --- a/lib/emscripten/shell_minimal.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - Image Flow Editor - - - - - - {{{ SCRIPT }}} - - diff --git a/lib/emscripten_browser_file.h b/lib/emscripten_browser_file.h deleted file mode 100644 index df58a4f..0000000 --- a/lib/emscripten_browser_file.h +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef EMSCRIPTEN_UPLOAD_FILE_H_INCLUDED -#define EMSCRIPTEN_UPLOAD_FILE_H_INCLUDED - -#include -#include - -#define _EM_JS_INLINE(ret, c_name, js_name, params, code) \ - extern "C" { \ - ret c_name params EM_IMPORT(js_name); \ - EMSCRIPTEN_KEEPALIVE \ - __attribute__((section("em_js"), aligned(1))) inline char __em_js__##js_name[] = \ - #params "<::>" code; \ - } - -#define EM_JS_INLINE(ret, name, params, ...) _EM_JS_INLINE(ret, name, name, params, #__VA_ARGS__) - -namespace emscripten_browser_file { - -/////////////////////////////////// Interface ////////////////////////////////// - -using upload_handler = void(*)(std::string const&, std::string const&, std::string_view buffer, void*); - -inline void upload(std::string const &accept_types, upload_handler callback, void *callback_data = nullptr); -inline void download(std::string const &filename, std::string const &mime_type, std::string_view buffer); - -///////////////////////////////// Implementation /////////////////////////////// - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wmissing-variable-declarations" -EM_JS_INLINE(void, upload, (char const *accept_types, upload_handler callback, void *callback_data), { - /// Prompt the browser to open the file selector dialogue, and pass the file to the given handler - /// Accept-types are in the format ".png,.jpeg,.jpg" as per https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept - /// Upload handler callback signature is: - /// void my_handler(std::string const &filename, std::string const &mime_type, std::string_view buffer, void *callback_data = nullptr); - globalThis["open_file"] = function(e) { - const file_reader = new FileReader(); - file_reader.onload = (event) => { - const uint8Arr = new Uint8Array(event.target.result); - const data_ptr = Module["_malloc"](uint8Arr.length); - const data_on_heap = new Uint8Array(Module["HEAPU8"].buffer, data_ptr, uint8Arr.length); - data_on_heap.set(uint8Arr); - Module["ccall"]('upload_file_return', 'number', ['string', 'string', 'number', 'number', 'number', 'number'], [event.target.filename, event.target.mime_type, data_on_heap.byteOffset, uint8Arr.length, callback, callback_data]); - Module["_free"](data_ptr); - }; - file_reader.filename = e.target.files[0].name; - file_reader.mime_type = e.target.files[0].type; - file_reader.readAsArrayBuffer(e.target.files[0]); - }; - - var file_selector = document.createElement('input'); - file_selector.setAttribute('type', 'file'); - file_selector.setAttribute('onchange', 'globalThis["open_file"](event)'); - file_selector.setAttribute('accept', UTF8ToString(accept_types)); - file_selector.click(); -}); -#pragma GCC diagnostic pop - -inline void upload(std::string const &accept_types, upload_handler callback, void *callback_data) { - /// C++ wrapper for javascript upload call - upload(accept_types.c_str(), callback, callback_data); -} - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wmissing-variable-declarations" -EM_JS_INLINE(void, download, (char const *filename, char const *mime_type, void const *buffer, size_t buffer_size), { - /// Offer a buffer in memory as a file to download, specifying download filename and mime type - var a = document.createElement('a'); - a.download = UTF8ToString(filename); - a.href = URL.createObjectURL(new Blob([new Uint8Array(Module["HEAPU8"].buffer, buffer, buffer_size)], {type: UTF8ToString(mime_type)})); - a.click(); -}); -#pragma GCC diagnostic pop - -inline void download(std::string const &filename, std::string const &mime_type, std::string_view buffer) { - /// C++ wrapper for javascript download call, accepting a string_view - download(filename.c_str(), mime_type.c_str(), buffer.data(), buffer.size()); -} - -namespace { - -extern "C" { - -EMSCRIPTEN_KEEPALIVE inline int upload_file_return(char const *filename, char const *mime_type, char *buffer, size_t buffer_size, upload_handler callback, void *callback_data); - -EMSCRIPTEN_KEEPALIVE inline int upload_file_return(char const *filename, char const *mime_type, char *buffer, size_t buffer_size, upload_handler callback, void *callback_data) { - /// Load a file - this function is called from javascript when the file upload is activated - callback(filename, mime_type, {buffer, buffer_size}, callback_data); - return 1; -} - -} - -} - -} - -#endif // EMSCRIPTEN_UPLOAD_FILE_H_INCLUDED diff --git a/main.cpp b/main.cpp index 1a38415..eca7f56 100644 --- a/main.cpp +++ b/main.cpp @@ -10,7 +10,6 @@ // - Introduction, links and more at the top of imgui.cpp #include -#define IMGUI_DEFINE_MATH_OPERATORS #include "lib/backends/imgui_impl_opengl3.h" #include "lib/backends/imgui_impl_sdl2.h" @@ -37,11 +36,6 @@ #endif #endif -// This example can also compile and run with Emscripten! See -// 'Makefile.emscripten' for details. -#ifdef __EMSCRIPTEN__ -#include "lib/emscripten/emscripten_mainloop_stub.h" -#endif #include "lib/ImNodeFlow.h" @@ -95,7 +89,7 @@ int main(int, char **) { (SDL_WindowFlags)(SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI); SDL_Window *window = - SDL_CreateWindow("PPD Node", SDL_WINDOWPOS_CENTERED, + SDL_CreateWindow("tview", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280, 720, window_flags); if (window == nullptr) { printf("Error: SDL_CreateWindow(): %s\n", SDL_GetError()); @@ -141,15 +135,7 @@ int main(int, char **) { // Main loop bool done = false; -#ifdef __EMSCRIPTEN__ - // For an Emscripten build we are disabling file-system access, so let's not - // attempt to do a fopen() of the imgui.ini file. You may manually call - // LoadIniSettingsFromMemory() to load settings from your own storage. - io.IniFilename = nullptr; - EMSCRIPTEN_MAINLOOP_BEGIN -#else while (!done) -#endif { // Poll and handle events (inputs, window resize, etc.) // You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to @@ -255,9 +241,6 @@ int main(int, char **) { SDL_GL_SwapWindow(window); } -#ifdef __EMSCRIPTEN__ - EMSCRIPTEN_MAINLOOP_END; -#endif // Cleanup ImGui_ImplOpenGL3_Shutdown();