Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
4254f18
Make a bunch of variables thread_local
publixsubfan May 28, 2021
4bd9748
Move glvis_command multiplexing to IdleFunc
publixsubfan May 28, 2021
95e97f8
Add an SdlWindow::MainThread class to handle SDL operations on a sing…
publixsubfan May 21, 2021
1c324e4
Get things to display
publixsubfan May 21, 2021
7f15708
Consolidate SDL main thread commands from worker threads
publixsubfan May 21, 2021
b135df2
Fixing window exits and resizes; miscellaneous cleanup
publixsubfan May 24, 2021
d42bf14
Make SdlWindow::Handle a move-only type, hold it directly as a value
publixsubfan May 28, 2021
b762139
Initial commit of a thread-based server mode
publixsubfan Jun 1, 2021
ed10443
Re-enable -mac command for server mode, use Session object for non-se…
publixsubfan Jun 1, 2021
8dfef72
Fixes for X11, split syswm code into new file to avoid macro conflicts
publixsubfan Jun 3, 2021
12a24f7
Fixing build issue on gcc 4.9.3
publixsubfan Jun 3, 2021
d6c75f3
Fix save file opening; remove global input_streams variable
publixsubfan Jun 5, 2021
4c5cdb7
Show prompt for terminating server thread
publixsubfan May 25, 2021
238bfc5
Use vector<unique_ptr<T>> to manage input stream ownership
publixsubfan Jun 7, 2021
b3df197
Remove last of the POSIX dependencies
publixsubfan Jun 7, 2021
e43155c
Fix case where platform is nullptr
publixsubfan Jun 7, 2021
8e9a8d4
Only prompt for exit in server mode
publixsubfan Jun 7, 2021
1c7eebc
Final build fixups for Windows builds
publixsubfan Jun 7, 2021
edc7424
Add HiDPI support for Windows
publixsubfan Jun 7, 2021
fc3ad6d
Add #ifdef guards for our custom M_PI
publixsubfan Jun 7, 2021
2fb40e9
Fix build on gcc 4.9.3 + clean up warnings
publixsubfan Jun 7, 2021
2c286e7
Fix js build by enabling single-threaded mode
publixsubfan Jun 7, 2021
5888635
Split SDL main thread class into its own file
publixsubfan Jun 7, 2021
a2bbbb1
Fix build on gcc 4.9.3 again
publixsubfan Jun 7, 2021
ef58810
Prune some headers
publixsubfan Jun 7, 2021
dcca4a5
Make some more variables thread_local
publixsubfan Jun 10, 2021
26fb8b7
Fix for non-parallel solution streams
publixsubfan Jun 16, 2021
5ba0dbc
Guard potential data race on platform variable with condition_variable
publixsubfan Jun 16, 2021
3752cc2
Fix thread leaks
publixsubfan Jun 16, 2021
19f2911
Cleanup memory management
publixsubfan Jun 16, 2021
928813c
Fix data race in palette init
publixsubfan Jun 16, 2021
abc46ab
Make glvis quit handling more robust
publixsubfan Jun 16, 2021
e236583
Make captions thread_local
publixsubfan Jun 16, 2021
dfb14c1
Better fix for Cocoa resize issue
publixsubfan Jun 21, 2021
d10bc97
Workaround for SDL 2.0.12
publixsubfan Jun 24, 2021
dacf67c
Restore old behavior of server process, use glvis icon in dock with h…
publixsubfan Jun 29, 2021
9f3fb8b
Delete quitDialog function
publixsubfan Jun 29, 2021
4dac77d
Fix makefile
publixsubfan Jun 29, 2021
37bdedb
Call [NSOpenGLContext update] after window geometry changes from thre…
publixsubfan Jul 7, 2021
e380892
Ensure context is updated when updateLayer is called as well (expose …
publixsubfan Jul 7, 2021
8b27bd8
Fix qutting glvis server with Ctrl-C
publixsubfan Jul 7, 2021
57fbf46
Fix version check for workaround
publixsubfan Jul 7, 2021
2b84347
Update CHANGELOG
publixsubfan Jul 7, 2021
2e0e0a7
Only print SDL version in debug mode
publixsubfan Jul 7, 2021
92f7f4c
Wrap makefile to 80 cols
publixsubfan Jul 7, 2021
f002d95
minor js build fix
Jul 7, 2021
b8e0861
Better workaround for M_PI on windows
publixsubfan Jul 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@

Version 4.0.1 (development)
===========================
- 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.

- Refactored glvis.cpp to fix a bug in GLVis script handling.

- Enabled support for WebGL 2, when available. This enables, among other
Expand Down
39 changes: 30 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ set(_glvis_libraries)

list(APPEND _glvis_compile_defs "GLVIS_MULTISAMPLE=${GLVIS_MULTISAMPLE}")
list(APPEND _glvis_compile_defs "GLVIS_MS_LINEWIDTH=${GLVIS_MS_LINEWIDTH}")
if (NOT WIN32)
list(APPEND _glvis_compile_defs "GLVIS_USE_LOGO")
else()
list(APPEND _glvis_compile_defs "_USE_MATH_DEFINES")
endif()

if (CMAKE_BUILD_TYPE MATCHES "Debug|debug|DEBUG")
list(APPEND _glvis_compile_defs "GLVIS_DEBUG")
Expand All @@ -111,7 +116,9 @@ if (NOT EMSCRIPTEN)
find_package(SDL2 QUIET HINTS ${SDL2_DIR})
# The SDL2 target 'SDL2::SDL2' is not always defined, so instead we use
# directly 'SDL2_INCLUDE_DIRS' and 'SDL2_LIBRARIES'.
if (SDL2_INCLUDE_DIRS AND SDL2_LIBRARIES)
if (TARGET SDL2::SDL2)
list(APPEND _glvis_libraries SDL2::SDL2)
elseif (SDL2_INCLUDE_DIRS AND SDL2_LIBRARIES)
# SDL2_INCLUDE_DIRS is defined with 'SDL2' at the end of the path we need to
# strip that.
set(new_list_)
Expand All @@ -120,6 +127,8 @@ if (NOT EMSCRIPTEN)
list(APPEND new_list_ "${new_path_}")
endforeach()
set(SDL2_INCLUDE_DIRS ${new_list_})
list(APPEND _glvis_include_dirs "${SDL2_INCLUDE_DIRS}")
list(APPEND _glvis_libraries "${SDL2_LIBRARIES}")
else()
# find_package() did not work; try more direct approach.
set(SDL2_DIR ${SDL2_DIR_SAVE})
Expand All @@ -134,9 +143,9 @@ if (NOT EMSCRIPTEN)
if (NOT (SDL2_INCLUDE_DIRS AND SDL2_LIBRARIES))
message(FATAL_ERROR "SDL2 library not found. Please set SDL2_DIR.")
endif()
list(APPEND _glvis_include_dirs "${SDL2_INCLUDE_DIRS}")
list(APPEND _glvis_libraries "${SDL2_LIBRARIES}")
endif()
list(APPEND _glvis_include_dirs "${SDL2_INCLUDE_DIRS}")
list(APPEND _glvis_libraries "${SDL2_LIBRARIES}")
message(STATUS "SDL2 found: ${SDL2_LIBRARIES}")
message(STATUS "SDL2_INCLUDE_DIRS = ${SDL2_INCLUDE_DIRS}")

Expand Down Expand Up @@ -204,12 +213,14 @@ if (NOT EMSCRIPTEN)
endif (FONTCONFIG_LIBRARY)

# Find threading library
set(CMAKE_THREAD_PREFER_PTHREAD ON)
find_package(Threads REQUIRED)
if (NOT CMAKE_USE_PTHREADS_INIT)
message(FATAL_ERROR "The required pthreads library was not found.")
else()
list(APPEND _glvis_libraries "${CMAKE_THREAD_LIBS_INIT}")
list(APPEND _glvis_libraries "${CMAKE_THREAD_LIBS_INIT}")
if (CMAKE_USE_PTHREADS_INIT)
message(STATUS "System threading library: pthreads")
elseif (CMAKE_USE_WIN32_THREADS_INIT)
message(STATUS "System threading library: Win32 threads")
elseif (Threads_FOUND)
message(STATUS "System threading library: other")
endif()

else(NOT EMSCRIPTEN)
Expand All @@ -223,6 +234,8 @@ else(NOT EMSCRIPTEN)
# OpenGL, SDL2, and GLEW are provided by the Emscripten runtime
# Enable SDL2
list(APPEND _emscripten_opts "-s USE_SDL=2")
list(APPEND _emscripten_opts
"-s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=0")

# Set WebGL options
list(APPEND _emscripten_opts
Expand Down Expand Up @@ -274,7 +287,15 @@ if(NOT EMSCRIPTEN)
add_executable(glvis-exe glvis.cpp)
set_target_properties(glvis-exe PROPERTIES OUTPUT_NAME glvis)

target_link_libraries(glvis-exe PRIVATE glvis glvis_logo)
target_link_libraries(glvis-exe PRIVATE glvis)

if (WIN32)
set_target_properties(glvis-exe PROPERTIES WIN32_EXECUTABLE TRUE)
target_sources(glvis-exe PRIVATE "share/windows.manifest")
target_link_libraries(glvis-exe PRIVATE SDL2::SDL2main)
else()
target_link_libraries(glvis-exe PRIVATE glvis_logo)
endif (WIN32)

# Install the executable
install(TARGETS glvis-exe RUNTIME DESTINATION bin)
Expand Down
Loading