From a43b3d8c8896185234e58d7615f5e948496dd976 Mon Sep 17 00:00:00 2001 From: Tzanio Date: Wed, 11 Aug 2021 16:24:06 -0700 Subject: [PATCH 01/20] Set version in CHANGELOG --- CHANGELOG | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 35cf3b97..7da60dc1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,8 +9,8 @@ http://glvis.org -Version 4.0.1 (development) -=========================== +Version 4.1, released on Aug XX, 2021 +===================================== - Use threads in server mode for window creation and session management instead of fork(). This resolves some issues with running GLVis in server mode on macOS. This also allows for closing all open GLVis windows associated From 7e84d9b64b72a5d579bb0a4852bc138c96d0ab0d Mon Sep 17 00:00:00 2001 From: Tzanio Date: Thu, 12 Aug 2021 16:47:23 -0700 Subject: [PATCH 02/20] Reorganized CHANGELOG --- CHANGELOG | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 863ea236..08d3ce2c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,26 +11,25 @@ Version 4.1, released on Aug XX, 2021 ===================================== -- Use threads in server mode for window creation and session management - instead of fork(). This resolves some issues with running GLVis in server - mode on macOS. This also allows for closing all open GLVis windows associated - with the server by using Ctrl-C in the terminal. -- Preliminary support for building natively on Windows via CMake. +- Added a build target ("make app") to build a native Mac OS application bundle + that can be double-clicked, added to the Dock, etc. -- Refactored glvis.cpp to fix a bug in GLVis script handling. +- Use threads in server mode for window creation and session management instead + of fork(). This resolves issues with the GLVis server mode on macOS. It also + allows for closing all open GLVis server windows by Ctrl-C in the terminal. - Enabled support for WebGL 2, when available. This enables, among other features, support for controllable multisampling via framebuffers. -- Various bugfixes and improvements related to the JavaScript version. +- Refactored rendering components, including palette and shader handling. -- Refactoring of rendering components, including palette and shader handling. +- Replaced pthreads and POSIX-specific code with C++11 standard thread library. -- Replace pthreads and POSIX-specific code with C++11 standard thread library. +- Preliminary support for building natively on Windows via CMake. -- Added build target ("make app") to build a native Mac OS application bundle - that can be double-clicked, added to the Dock, etc. +- Various bugfixes and improvements related to the JavaScript version, script + handling and more. Version 4.0, released on Dec 11, 2020 From 0ad5d9acd5e3aec4aaf5cee26418bfe60133f3f6 Mon Sep 17 00:00:00 2001 From: Tzanio Date: Tue, 17 Aug 2021 09:20:23 -0700 Subject: [PATCH 03/20] Updated CHANGELOG --- CHANGELOG | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index bf28bf37..539044b0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,7 +9,7 @@ http://glvis.org -Version 4.1, released on Aug XX, 2021 +Version 4.1, released on Aug 31, 2021 ===================================== - Added a build target ("make app") to build a native Mac OS application bundle @@ -26,15 +26,13 @@ Version 4.1, released on Aug XX, 2021 - Replaced pthreads and POSIX-specific code with C++11 standard thread library. -- Preliminary support for building natively on Windows via CMake. - -- Various bugfixes and improvements related to the JavaScript version, script - handling and more. - - Added a new regression test suite based on generated screenshots of stream - files. See the README in the tests directory for more details. + files. See the README in the tests/ directory for more details. + +- Preliminary support for building natively on Windows via CMake. -- Fixed an issue with black screenshots on certain OpenGL implementations. +- Various bugfixes and improvements related to the JavaScript version, vertex + numbering, script handling and screenshots on some OpenGL implementations. Version 4.0, released on Dec 11, 2020 From e5cbac60e9df11a39dacc321b0f9fd437c03f11c Mon Sep 17 00:00:00 2001 From: Tzanio Date: Tue, 17 Aug 2021 09:58:45 -0700 Subject: [PATCH 04/20] make style --- lib/sdl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sdl.cpp b/lib/sdl.cpp index 6c94458b..a6a1224e 100644 --- a/lib/sdl.cpp +++ b/lib/sdl.cpp @@ -111,7 +111,7 @@ bool SdlWindow::createWindow(const char* title, int x, int y, int w, int h, if (err == GLEW_ERROR_NO_GLX_DISPLAY) { cerr << "GLEW: No GLX display found. If you are using Wayland this can " - "be ignored." << endl; + "be ignored." << endl; err = GLEW_OK; } #endif From 194593e91b8698ec6a015aa686f1ff4b5a2c5438 Mon Sep 17 00:00:00 2001 From: Tzanio Date: Tue, 17 Aug 2021 12:13:35 -0700 Subject: [PATCH 05/20] Copy+paste fixes in CONTRIBUTING.md --- CONTRIBUTING.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e366821b..1c4dca13 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -202,8 +202,6 @@ Before you can start, you need a GitHub account, here are a few suggestions: - Consistent code styling is enforced with `make style` in the top-level directory. This requires [Artistic Style](http://astyle.sourceforge.net) (we specifically use version 2.05.1). See also the file `config/glvis.astylerc`. - - Use `glvis::out` and `glvis::err` instead of `std::cout` and `std::cerr` in - internal library code. (You can use `std` in examples and miniapps.) - When manually resolving conflicts during a merge, make sure to mention the conflicted files in the commit message. @@ -262,7 +260,6 @@ Before a PR can be merged, it should satisfy the following: - [ ] Add new patterns (just for the new files above) and re-run the above test. - [ ] New capability: - [ ] All significant new classes, methods and functions have Doxygen-style documentation in source comments. - - [ ] Consider adding new sample runs in existing examples to highlight the new capability. - [ ] Consider saving cool simulation pictures with the new capability in the Confluence gallery (LLNL only) or submitting them, via pull request, to the gallery section of the `glvis/web` repo. - [ ] If this is a major new feature, consider mentioning it in the short summary inside `README` *(rare)*. - [ ] List major new classes in `doc/CodeDocumentation.dox` *(rare)*. From c4134cc5565f9e86714062c729b4b5a5b6698bfe Mon Sep 17 00:00:00 2001 From: Max Yang Date: Wed, 18 Aug 2021 16:51:33 -0700 Subject: [PATCH 06/20] Remove no-longer-needed mac workaround from INSTALL --- INSTALL | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/INSTALL b/INSTALL index d04d8838..be77136f 100644 --- a/INSTALL +++ b/INSTALL @@ -170,28 +170,6 @@ Some building considerations bash glvis-keygen.sh ["Your Name"] ["Your Email"] -- On some versions of Mac OS X, an error may be encountered with GLVis running - in server mode: - - [NSApplication initialize] may have been in progress in another thread - when fork() was called. - - This appears to be the result of some interaction between the Cocoa windowing - system, SDL, and GLVis's fork-based architecture in server mode. There are - two potential fixes: - - 1) Start GLVis with the '-mac' option. This will write out connection streams - to a stream file and start a new process of GLVis to view this stream. - This avoids the problematic 'fork()' call, at the cost of being unable to - view the visualization in real-time. - - 2) Build GLVis with SDL 2.0.12, the last version which appears to avoid the - error. Steps for manually building SDL2 from source are located under the - 'Dependency building instructions' section below. You may need to add a - '--disable-video-x11' switch to the ./configure command. - Note that while this avoids the hard error, and allows for real-time - visualization, occasional hangs have been reported with this method. - - On Mac OS X, GLVis can be built as a native application bundle using the 'make app' target (with both the makefile and CMake build systems). From 6af96ffdd91bbe6806d014a43bd00d2e8a94854c Mon Sep 17 00:00:00 2001 From: Tzanio Date: Tue, 24 Aug 2021 19:51:26 -0700 Subject: [PATCH 07/20] Small edits --- CHANGELOG | 4 +++- CONTRIBUTING.md | 3 ++- README | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 539044b0..37734cf8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -27,7 +27,9 @@ Version 4.1, released on Aug 31, 2021 - Replaced pthreads and POSIX-specific code with C++11 standard thread library. - Added a new regression test suite based on generated screenshots of stream - files. See the README in the tests/ directory for more details. + files. See the README in the tests/ directory for more details. Note that this + requires a submodule for the baseline images, which are kept in the separate + https://github.com/glvis/data repository. - Preliminary support for building natively on Windows via CMake. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4ede10d0..f68b4dbb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,7 +87,8 @@ The GLVis source code has the following structure: ├── lib │ └── gl │ └── shaders - └── share + ├── share + └── tests ``` ## GitHub Workflow diff --git a/README b/README index 7c6bf875..401f2776 100644 --- a/README +++ b/README @@ -9,7 +9,8 @@ http://glvis.org GLVis is an OpenGL tool for visualization of finite element meshes and -functions. +functions. It runs natively on Mac, Linux, Windows, Jupyter, or a web browser, +see https://glvis.org/live. For building instructions, see the file INSTALL. Copyright information and licensing restrictions can be found in the file COPYRIGHT. From 99857b6634f16cc8987465ba652562f60ebad3b5 Mon Sep 17 00:00:00 2001 From: Tom Stitt Date: Wed, 25 Aug 2021 15:47:29 -0700 Subject: [PATCH 08/20] update changelog with jupyter widget info --- CHANGELOG | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 37734cf8..b24642ac 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -33,6 +33,10 @@ Version 4.1, released on Aug 31, 2021 - Preliminary support for building natively on Windows via CMake. +- Preliminary support for interactive inline GLVis plots in Python Jupyter + Notebooks with https://github.com/glvis/pyglvis and C++ Jupyter Notebooks with + https://github.com/glvis/xeus-glvis + - Various bugfixes and improvements related to the JavaScript version, vertex numbering, script handling and screenshots on some OpenGL implementations. From 2a35c6cc6e05ff4bf5e107ba03c6c985cc5d5c45 Mon Sep 17 00:00:00 2001 From: Tzanio Date: Thu, 26 Aug 2021 06:35:34 -0700 Subject: [PATCH 09/20] Edits in CHANGELOG --- CHANGELOG | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b24642ac..050217b1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,16 +9,20 @@ http://glvis.org -Version 4.1, released on Aug 31, 2021 +Version 4.1, released on Aug 27, 2021 ===================================== -- Added a build target ("make app") to build a native Mac OS application bundle - that can be double-clicked, added to the Dock, etc. - - Use threads in server mode for window creation and session management instead of fork(). This resolves issues with the GLVis server mode on macOS. It also allows for closing all open GLVis server windows by Ctrl-C in the terminal. +- Preliminary support for interactive inline GLVis plots in Python Jupyter + Notebooks with https://github.com/glvis/pyglvis and C++ Jupyter Notebooks with + https://github.com/glvis/xeus-glvis + +- Added a build target ("make app") to build a native Mac OS application bundle + that can be double-clicked, added to the Dock, etc. + - Enabled support for WebGL 2, when available. This enables, among other features, support for controllable multisampling via framebuffers. @@ -33,10 +37,6 @@ Version 4.1, released on Aug 31, 2021 - Preliminary support for building natively on Windows via CMake. -- Preliminary support for interactive inline GLVis plots in Python Jupyter - Notebooks with https://github.com/glvis/pyglvis and C++ Jupyter Notebooks with - https://github.com/glvis/xeus-glvis - - Various bugfixes and improvements related to the JavaScript version, vertex numbering, script handling and screenshots on some OpenGL implementations. From 04d731ec7bab6d6544808cb628d09be1700dbf4e Mon Sep 17 00:00:00 2001 From: Tzanio Date: Fri, 27 Aug 2021 14:26:47 -0700 Subject: [PATCH 10/20] Mentioned web screenshot support in CHANGELOG --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 050217b1..5eaf9be6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -23,6 +23,8 @@ Version 4.1, released on Aug 27, 2021 - Added a build target ("make app") to build a native Mac OS application bundle that can be double-clicked, added to the Dock, etc. +- Added screenshots support (key 'S') in the JavaScript/web version. + - Enabled support for WebGL 2, when available. This enables, among other features, support for controllable multisampling via framebuffers. From 40843fae5fc049904152cb607c1534445cce52e5 Mon Sep 17 00:00:00 2001 From: Tzanio Date: Fri, 27 Aug 2021 15:29:07 -0700 Subject: [PATCH 11/20] Final version of the CHANGELOG before the glvis-4.1 release --- CHANGELOG | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5eaf9be6..8cee53cf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -20,8 +20,10 @@ Version 4.1, released on Aug 27, 2021 Notebooks with https://github.com/glvis/pyglvis and C++ Jupyter Notebooks with https://github.com/glvis/xeus-glvis -- Added a build target ("make app") to build a native Mac OS application bundle - that can be double-clicked, added to the Dock, etc. +- Added support native building on Windows with CMake. + +- Added support for native Mac application bundle with "make app". The resulting + app can be double-clicked, added to the Dock, etc. - Added screenshots support (key 'S') in the JavaScript/web version. @@ -37,10 +39,8 @@ Version 4.1, released on Aug 27, 2021 requires a submodule for the baseline images, which are kept in the separate https://github.com/glvis/data repository. -- Preliminary support for building natively on Windows via CMake. - - Various bugfixes and improvements related to the JavaScript version, vertex - numbering, script handling and screenshots on some OpenGL implementations. + numbering, script handling, screenshots, HiDPI support, and more. Version 4.0, released on Dec 11, 2020 From 6f96a315de015e2a840f551fc1f066685c9d24a0 Mon Sep 17 00:00:00 2001 From: Tzanio Date: Fri, 27 Aug 2021 15:35:38 -0700 Subject: [PATCH 12/20] Updated README --- README | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README b/README index 401f2776..2267b500 100644 --- a/README +++ b/README @@ -9,8 +9,9 @@ http://glvis.org GLVis is an OpenGL tool for visualization of finite element meshes and -functions. It runs natively on Mac, Linux, Windows, Jupyter, or a web browser, -see https://glvis.org/live. +functions. It is a multiplatform OpenGL application that can be built on +Linux/Unix systems, including Mac OS X, and under Windows. It can also be used +in a Jupyter notebook, or in a web browser, see https://glvis.org/live. For building instructions, see the file INSTALL. Copyright information and licensing restrictions can be found in the file COPYRIGHT. From 5cc91d738e7c0ac0977d4d03c01d12e243eafe26 Mon Sep 17 00:00:00 2001 From: Tzanio Date: Fri, 27 Aug 2021 16:05:55 -0700 Subject: [PATCH 13/20] Minor edits --- lib/aux_vis.cpp | 2 +- lib/geom_utils.hpp | 1 + lib/openglvis.cpp | 1 - lib/palettes.cpp | 8 ++------ lib/stream_reader.cpp | 1 - lib/stream_reader.hpp | 1 - lib/vsdata.cpp | 27 +++++++++++++-------------- lib/vsdata.hpp | 2 +- tests/glvis_driver.py | 11 +++++++++++ 9 files changed, 29 insertions(+), 25 deletions(-) diff --git a/lib/aux_vis.cpp b/lib/aux_vis.cpp index b2fb24e6..b0b62680 100644 --- a/lib/aux_vis.cpp +++ b/lib/aux_vis.cpp @@ -931,7 +931,7 @@ int SaveAsPNG(const char *fname, int w, int h, bool is_hidpi, bool with_alpha) } png_uint_32 ppi = is_hidpi ? 144 : 72; // pixels/inch - png_uint_32 ppm = ppi/0.0254 + 0.5; // pixels/meter + png_uint_32 ppm = ppi/0.0254 + 0.5; // pixels/meter png_set_pHYs(png_ptr, info_ptr, ppm, ppm, PNG_RESOLUTION_METER); png_init_io(png_ptr, fp); diff --git a/lib/geom_utils.hpp b/lib/geom_utils.hpp index 74fe9b5c..1ed95c5e 100644 --- a/lib/geom_utils.hpp +++ b/lib/geom_utils.hpp @@ -144,4 +144,5 @@ inline int ProjectVector(double v[], const double n[]) LinearCombination(InnerProd(n, n), v, -InnerProd(v, n), n, v); return Normalize(v); } + #endif // GLVIS_GEOM_UTILS_HPP diff --git a/lib/openglvis.cpp b/lib/openglvis.cpp index 069a94d8..c3b1ab21 100644 --- a/lib/openglvis.cpp +++ b/lib/openglvis.cpp @@ -466,4 +466,3 @@ glm::mat4 VisualizationScene::GetModelViewMtx() modelView.translate(-(x[0]+x[1])/2, -(y[0]+y[1])/2, -(z[0]+z[1])/2); return modelView.mtx; } - diff --git a/lib/palettes.cpp b/lib/palettes.cpp index 313b655a..2e11e7fb 100644 --- a/lib/palettes.cpp +++ b/lib/palettes.cpp @@ -7541,9 +7541,7 @@ int PaletteState::ChoosePalette() } -/* * - * Generates a discrete texture from the given palette. - */ +// Generates a discrete texture from the given palette. void PaletteState::ToTextureDiscrete(double * palette, size_t plt_size, GLuint tex) { @@ -7616,9 +7614,7 @@ void PaletteState::ToTextureDiscrete(double * palette, size_t plt_size, glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); } -/* * - * Generates a smooth texture from the given palette. - */ +// Generates a smooth texture from the given palette. void PaletteState::ToTextureSmooth(double * palette, size_t plt_size, GLuint tex) { diff --git a/lib/stream_reader.cpp b/lib/stream_reader.cpp index 4c32e176..9029ec7d 100644 --- a/lib/stream_reader.cpp +++ b/lib/stream_reader.cpp @@ -409,4 +409,3 @@ bool StreamState::SetNewMeshAndSolution(StreamState new_state, return false; } } - diff --git a/lib/stream_reader.hpp b/lib/stream_reader.hpp index 179e4c75..7aa42fb7 100644 --- a/lib/stream_reader.hpp +++ b/lib/stream_reader.hpp @@ -52,5 +52,4 @@ struct StreamState std::unique_ptr ProjectVectorFEGridFunction(std::unique_ptr gf); - #endif // GLVIS_STREAM_READER_HPP diff --git a/lib/vsdata.cpp b/lib/vsdata.cpp index 9b318b4c..d2650d9a 100644 --- a/lib/vsdata.cpp +++ b/lib/vsdata.cpp @@ -33,9 +33,8 @@ void VisualizationSceneScalarData::FixValueRange() if (float(am) < 100*numeric_limits::min()) { am = 1e-3; } if ((maxv-minv) < 1e-5*am) { - // Shading quality may be bad since OpenGL uses single precision. - // We should probably pre-scale the solution before feeding it - // to OpenGL + // Shading quality may be bad since OpenGL uses single precision. We + // should probably pre-scale the solution before feeding it to OpenGL int old_prec = cout.precision(12); cout << "[minv,maxv] = " << "[" << minv << "," << maxv << "] (maxv-minv = " << maxv-minv << ")\n --> "; @@ -755,7 +754,7 @@ void KeyAPressed() void KeyCommaPressed() { locscene->matAlphaCenter -= 0.25; - //vsdata -> EventUpdateColors(); + // vsdata -> EventUpdateColors(); locscene->GenerateAlphaTexture(); SendExposeEvent(); #ifdef GLVIS_DEBUG @@ -766,7 +765,7 @@ void KeyCommaPressed() void KeyLessPressed() { locscene->matAlphaCenter += 0.25; - //vsdata -> EventUpdateColors(); + // vsdata -> EventUpdateColors(); locscene->GenerateAlphaTexture(); SendExposeEvent(); #ifdef GLVIS_DEBUG @@ -1250,7 +1249,7 @@ void VisualizationSceneScalarData::PrepareAxes() gl3::GlBuilder bld = axes_buf.createBuilder(); if (drawaxes == 3) { - //glLineStipple(1, 255); + // glLineStipple(1, 255); bld.glBegin(GL_LINES); bld.glColor3f(1., 0., 0.); bld.glVertex3d(x[0], y[0], z[0]); @@ -1261,8 +1260,8 @@ void VisualizationSceneScalarData::PrepareAxes() bld.glVertex3d(x[0], y[0], z[0]); bld.glEnd(); bld.glColor4fv(blk.data()); - //bld.setUseColor(false); - //bld.glEnable(GL_LINE_STIPPLE); + // bld.setUseColor(false); + // bld.glEnable(GL_LINE_STIPPLE); bld.glBegin(GL_LINE_STRIP); bld.glColor3f(0.75, 0.75, 0.75); bld.glVertex3d(x[1], y[0], z[0]); @@ -1272,7 +1271,7 @@ void VisualizationSceneScalarData::PrepareAxes() } else { - //bld.setUseColor(false); + // bld.setUseColor(false); bld.glBegin(GL_LINE_LOOP); bld.glVertex3d(x[0], y[0], z[0]); bld.glVertex3d(x[1], y[0], z[0]); @@ -1289,15 +1288,15 @@ void VisualizationSceneScalarData::PrepareAxes() if (drawaxes == 3) { - //bld.setUseColor(true); - //bld.glDisable(GL_LINE_STIPPLE); + // bld.setUseColor(true); + // bld.glDisable(GL_LINE_STIPPLE); bld.glBegin(GL_LINES); bld.glVertex3d(x[0], y[0], z[1]); bld.glColor3f(0., 0., 1.); bld.glVertex3d(x[0], y[0], z[0]); bld.glEnd(); - //bld.setUseColor(false); - //bld.glEnable(GL_LINE_STIPPLE); + // bld.setUseColor(false); + // bld.glEnable(GL_LINE_STIPPLE); bld.glColor3f(0.75, 0.75, 0.75); bld.glBegin(GL_LINES); } @@ -1316,7 +1315,7 @@ void VisualizationSceneScalarData::PrepareAxes() bld.glEnd(); if (drawaxes == 3) { - //bld.glDisable(GL_LINE_STIPPLE); + // bld.glDisable(GL_LINE_STIPPLE); } // Write the coordinates of the lower left and upper right corner. diff --git a/lib/vsdata.hpp b/lib/vsdata.hpp index 975de0bb..5df07c94 100644 --- a/lib/vsdata.hpp +++ b/lib/vsdata.hpp @@ -165,7 +165,7 @@ class VisualizationSceneScalarData : public VisualizationScene // Perform autoscaling depending on the value of 'autoscale': // 0 - do nothing - // 1 - call call FindNewBoxAndValueRange + // 1 - call FindNewBoxAndValueRange // 2 - call FindNewValueRange // 3 - call FindMeshBox void DoAutoscale(bool prepare); diff --git a/tests/glvis_driver.py b/tests/glvis_driver.py index bab8a844..20fe1285 100644 --- a/tests/glvis_driver.py +++ b/tests/glvis_driver.py @@ -1,3 +1,14 @@ +# Copyright (c) 2010-2021, Lawrence Livermore National Security, LLC. Produced +# at the Lawrence Livermore National Laboratory. All Rights reserved. See files +# LICENSE and NOTICE for details. LLNL-CODE-443271. +# +# This file is part of the GLVis visualization tool and library. For more +# information and source code availability see https://glvis.org. +# +# GLVis is free software; you can redistribute it and/or modify it under the +# terms of the BSD-3 license. We welcome feedback and contributions, see file +# CONTRIBUTING.md for details. + import argparse import sys import os From 20ac9003425827a705f17386694274efefa823fc Mon Sep 17 00:00:00 2001 From: Tom Stitt Date: Fri, 27 Aug 2021 16:06:11 -0700 Subject: [PATCH 14/20] remove TODOs, update notes on em build opts --- lib/aux_js.cpp | 1 - makefile | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/aux_js.cpp b/lib/aux_js.cpp index c1a5a59f..cdc90048 100644 --- a/lib/aux_js.cpp +++ b/lib/aux_js.cpp @@ -311,7 +311,6 @@ void setupResizeEventCallback(const std::string & id) std::cout << "got resize event" << std::endl; return true; }); - // TODO: macro to wrap this if (err != EMSCRIPTEN_RESULT_SUCCESS) { std::cerr << "error (emscripten_set_resize_callback): " << err << std::endl; diff --git a/makefile b/makefile index 7a131eeb..9c7445fe 100644 --- a/makefile +++ b/makefile @@ -93,8 +93,12 @@ GLVIS_LDFLAGS ?= EMCC ?= emcc -std=c++11 FONT_FILE ?= OpenSans.ttf EMCC_OPTS ?= -s USE_SDL=2 -s USE_FREETYPE=1 -s USE_LIBPNG=1 -# TODO: we don't want to have DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=0 -# longterm but until the SDL layer supports non-default canvas ids we need this +# NOTE: we don't want to have DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=0 +# longterm but until the SDL layer supports non-default canvas ids we need this, +# which will probably be a while. +# NOTE: we don't want to have --minify 0 longterm but we need to patch +# `_JSEvents_requestFullscreen' to be a noop for the live page and that is +# not easy to do in a minified build. EMCC_LIBS ?= -s USE_SDL=2 --bind -s ALLOW_MEMORY_GROWTH=1 -s SINGLE_FILE=1 \ --no-heap-copy -s ENVIRONMENT=web -s MODULARIZE=1 -s EXPORT_NAME=glvis \ -s GL_ASSERTIONS=1 -s GL_DEBUG=1 -s USE_FREETYPE=1 -s MAX_WEBGL_VERSION=2 \ From 56afc6cf1db842f7fc7e5900dc3fe9f8d2202f16 Mon Sep 17 00:00:00 2001 From: Max Yang Date: Fri, 27 Aug 2021 16:18:31 -0700 Subject: [PATCH 15/20] Try adding a deprecation message for SDL <2.0.14 on macOS --- lib/sdl_main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/sdl_main.cpp b/lib/sdl_main.cpp index 2de28ae2..b282ee47 100644 --- a/lib/sdl_main.cpp +++ b/lib/sdl_main.cpp @@ -60,6 +60,19 @@ SdlMainThread::SdlMainThread() PRINT_DEBUG("Using SDL " << (int)sdl_ver.major << "." << (int)sdl_ver.minor << "." << (int)sdl_ver.patch << std::endl); +#ifdef SDL_VIDEO_DRIVER_COCOA + if (SDL_VERSIONNUM(sdl_ver.major, sdl_ver.minor, sdl_ver.patch) + < SDL_VERSIONNUM(2, 0, 14)) + { + std::cerr << "Warning: your current version of SDL (" + << sdl_ver.major << "." << sdl_ver.minor << "." << sdl_ver.patch + << ") may be unsupported in a future version of GLVis on macOS." + << std::endl; + std::cerr << "If possible, upgrade to SDL version 2.0.14 or newer." + << std::endl; + } +#endif + if (!SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_EVENTS)) { if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS) != 0) From 0f77e842f199e6780d8fe90387e579d1408d026f Mon Sep 17 00:00:00 2001 From: Veselin Dobrev Date: Fri, 27 Aug 2021 16:49:02 -0700 Subject: [PATCH 16/20] Tweak the SDL warning message on Mac. --- lib/sdl_main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sdl_main.cpp b/lib/sdl_main.cpp index b282ee47..d6904129 100644 --- a/lib/sdl_main.cpp +++ b/lib/sdl_main.cpp @@ -65,7 +65,8 @@ SdlMainThread::SdlMainThread() < SDL_VERSIONNUM(2, 0, 14)) { std::cerr << "Warning: your current version of SDL (" - << sdl_ver.major << "." << sdl_ver.minor << "." << sdl_ver.patch + << (int)sdl_ver.major << "." << (int)sdl_ver.minor << "." + << (int)sdl_ver.patch << ") may be unsupported in a future version of GLVis on macOS." << std::endl; std::cerr << "If possible, upgrade to SDL version 2.0.14 or newer." From ad1bd58e93f81724c9fa4a01e3b09b27743100e8 Mon Sep 17 00:00:00 2001 From: Veselin Dobrev Date: Tue, 31 Aug 2021 12:47:48 -0700 Subject: [PATCH 17/20] Replace: #if GLVIS_DEBUG --> #ifdef GLVIS_DEBUG --- lib/aux_vis.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/aux_vis.cpp b/lib/aux_vis.cpp index b0b62680..8a55f8ef 100644 --- a/lib/aux_vis.cpp +++ b/lib/aux_vis.cpp @@ -996,14 +996,14 @@ int Screenshot(const char *fname, bool convert) wnd->getGLDrawSize(w, h); if (wnd->isSwapPending()) { -#if GLVIS_DEBUG +#ifdef GLVIS_DEBUG cerr << "Screenshot: reading image data from back buffer..." << endl; #endif glReadBuffer(GL_BACK); } else { -#if GLVIS_DEBUG +#ifdef GLVIS_DEBUG cerr << "Screenshot: reading image data from front buffer..." << endl; #endif MFEM_WARNING("Screenshot: Reading from the front buffer is unreliable. " From a42bd128080425d3884a3b2cb0557dcbfb279fbd Mon Sep 17 00:00:00 2001 From: Max Yang Date: Tue, 31 Aug 2021 14:07:32 -0700 Subject: [PATCH 18/20] Perform an expose on window resize events, in case the expose event is issued before --- lib/sdl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sdl.cpp b/lib/sdl.cpp index 37231852..70b1dfa7 100644 --- a/lib/sdl.cpp +++ b/lib/sdl.cpp @@ -193,6 +193,7 @@ void SdlWindow::windowEvent(SDL_WindowEvent& ew) switch (ew.event) { case SDL_WINDOWEVENT_EXPOSED: + case SDL_WINDOWEVENT_RESIZED: update_before_expose = true; if (onExpose) { @@ -203,7 +204,6 @@ void SdlWindow::windowEvent(SDL_WindowEvent& ew) running = false; break; case SDL_WINDOWEVENT_MOVED: - case SDL_WINDOWEVENT_RESIZED: update_before_expose = true; break; default: From 6eb912185840655fe2f4b0018ea90896365121aa Mon Sep 17 00:00:00 2001 From: Max Yang Date: Tue, 31 Aug 2021 14:25:31 -0700 Subject: [PATCH 19/20] Small fixup in CHANGELOG --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 8cee53cf..a7c576a3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -20,7 +20,7 @@ Version 4.1, released on Aug 27, 2021 Notebooks with https://github.com/glvis/pyglvis and C++ Jupyter Notebooks with https://github.com/glvis/xeus-glvis -- Added support native building on Windows with CMake. +- Added support for native builds on Windows with CMake. - Added support for native Mac application bundle with "make app". The resulting app can be double-clicked, added to the Dock, etc. From 3ac630114e8711a228bacb063b8fed0449b85744 Mon Sep 17 00:00:00 2001 From: Tzanio Date: Tue, 31 Aug 2021 14:36:33 -0700 Subject: [PATCH 20/20] GLVis v4.1 date is August 31, 2021 --- CHANGELOG | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a7c576a3..c4fa3634 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,7 +9,7 @@ http://glvis.org -Version 4.1, released on Aug 27, 2021 +Version 4.1, released on Aug 31, 2021 ===================================== - Use threads in server mode for window creation and session management instead @@ -18,14 +18,14 @@ Version 4.1, released on Aug 27, 2021 - Preliminary support for interactive inline GLVis plots in Python Jupyter Notebooks with https://github.com/glvis/pyglvis and C++ Jupyter Notebooks with - https://github.com/glvis/xeus-glvis + https://github.com/glvis/xeus-glvis. - Added support for native builds on Windows with CMake. - Added support for native Mac application bundle with "make app". The resulting app can be double-clicked, added to the Dock, etc. -- Added screenshots support (key 'S') in the JavaScript/web version. +- Added screenshots support to the JavaScript/web version (key 'S'). - Enabled support for WebGL 2, when available. This enables, among other features, support for controllable multisampling via framebuffers. @@ -36,8 +36,8 @@ Version 4.1, released on Aug 27, 2021 - Added a new regression test suite based on generated screenshots of stream files. See the README in the tests/ directory for more details. Note that this - requires a submodule for the baseline images, which are kept in the separate - https://github.com/glvis/data repository. + requires a git submodule for the baseline images, which are located in the + separate https://github.com/glvis/data repository. - Various bugfixes and improvements related to the JavaScript version, vertex numbering, script handling, screenshots, HiDPI support, and more.