diff --git a/.gitignore b/.gitignore index e05a54a93..76bf7b208 100644 --- a/.gitignore +++ b/.gitignore @@ -86,3 +86,4 @@ ecode.dmg /projects/android-project/.project /projects/android-project/app/.project /design/ +/projects/haiku/ecode/ecode.app/* \ No newline at end of file diff --git a/bin/assets/icon/ecode-icon-web.hvif b/bin/assets/icon/ecode-icon-web.hvif new file mode 100644 index 000000000..976fa0c57 Binary files /dev/null and b/bin/assets/icon/ecode-icon-web.hvif differ diff --git a/premake4.lua b/premake4.lua index c77417369..ad6ffd46d 100644 --- a/premake4.lua +++ b/premake4.lua @@ -2011,6 +2011,9 @@ solution "eepp" if not os.is("windows") and not os.is("haiku") then links { "pthread" } end + if os.is("haiku") then + links { "bsd", "network" } + end files { "src/tests/unit_tests/*.cpp", "src/tools/ecode/jsonhelper.cpp", "src/tools/ecode/plugins/git/git.cpp", diff --git a/premake5.lua b/premake5.lua index 7c547fa3f..ef3ef7f7e 100644 --- a/premake5.lua +++ b/premake5.lua @@ -2033,6 +2033,8 @@ workspace "eepp" "src/tools/ecode/plugins/autocomplete/usersnippetstore.cpp" } filter { "system:not windows", "system:not haiku" } links { "pthread" } + filter "system:haiku" + links { "bsd", "network" } filter {} eepp_module_backward_add( false ) build_link_configuration( "eepp-unit_tests", true ) diff --git a/src/eepp/window/backend/SDL2/windowsdl2.cpp b/src/eepp/window/backend/SDL2/windowsdl2.cpp index e14625b69..677e9df32 100644 --- a/src/eepp/window/backend/SDL2/windowsdl2.cpp +++ b/src/eepp/window/backend/SDL2/windowsdl2.cpp @@ -217,19 +217,16 @@ bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) { SDL_GL_SetAttribute( SDL_GL_ACCELERATED_VISUAL, 0 ); } + // Sharing window contexts is independent from supporting an auxiliary context on a worker + // thread. Platforms without threaded GL contexts still need shared object namespaces for + // resources used by multiple native windows. + SDL_GL_SetAttribute( SDL_GL_SHARE_WITH_CURRENT_CONTEXT, + mWindow.ContextConfig.SharedGLContext ? 1 : 0 ); #ifdef SDL2_THREADED_GLCONTEXT - if ( mWindow.ContextConfig.SharedGLContext ) { - SDL_GL_SetAttribute( SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1 ); - + if ( mWindow.ContextConfig.SharedGLContext ) mGLContextThread = SDL_GL_CreateContext( mSDLWindow ); - mGLContext = SDL_GL_CreateContext( mSDLWindow ); - } else { - mGLContext = SDL_GL_CreateContext( mSDLWindow ); - } -#else - mGLContext = SDL_GL_CreateContext( mSDLWindow ); - mWindow.ContextConfig.SharedGLContext = false; #endif + mGLContext = SDL_GL_CreateContext( mSDLWindow ); if ( nullptr == mGLContext #ifdef SDL2_THREADED_GLCONTEXT diff --git a/src/eepp/window/backend/SDL3/windowsdl3.cpp b/src/eepp/window/backend/SDL3/windowsdl3.cpp index ab0d96e2f..f0335779c 100644 --- a/src/eepp/window/backend/SDL3/windowsdl3.cpp +++ b/src/eepp/window/backend/SDL3/windowsdl3.cpp @@ -188,19 +188,16 @@ bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) { } #endif + // Sharing window contexts is independent from supporting an auxiliary context on a worker + // thread. Platforms without threaded GL contexts still need shared object namespaces for + // resources used by multiple native windows. + SDL_GL_SetAttribute( SDL_GL_SHARE_WITH_CURRENT_CONTEXT, + mWindow.ContextConfig.SharedGLContext ? 1 : 0 ); #ifdef SDL3_THREADED_GLCONTEXT - if ( mWindow.ContextConfig.SharedGLContext ) { - SDL_GL_SetAttribute( SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1 ); - + if ( mWindow.ContextConfig.SharedGLContext ) mGLContextThread = SDL_GL_CreateContext( mSDLWindow ); - mGLContext = SDL_GL_CreateContext( mSDLWindow ); - } else { - mGLContext = SDL_GL_CreateContext( mSDLWindow ); - } -#else - mGLContext = SDL_GL_CreateContext( mSDLWindow ); - mWindow.ContextConfig.SharedGLContext = false; #endif + mGLContext = SDL_GL_CreateContext( mSDLWindow ); if ( nullptr == mGLContext #ifdef SDL3_THREADED_GLCONTEXT