From f985dad5fd59f15ac0d7fb41fe8792b842628bf6 Mon Sep 17 00:00:00 2001 From: AaronShea Date: Fri, 27 Feb 2015 14:41:17 -0500 Subject: [PATCH] Beta Linux support --- Source/Blu.Build.cs | 52 +++++++++++++++++++++++------- Source/Blu/Private/Blu.cpp | 9 ++++-- Source/Blu/Private/BluEye.cpp | 4 +-- Source/Blu/Private/BluInstance.cpp | 2 -- Source/Blu/Public/BluInstance.h | 5 ++- Source/Blu/Public/BluManager.h | 4 +++ Source/Blu/Public/RenderHandler.h | 6 +++- 7 files changed, 62 insertions(+), 20 deletions(-) diff --git a/Source/Blu.Build.cs b/Source/Blu.Build.cs index db987d0..7d77171 100644 --- a/Source/Blu.Build.cs +++ b/Source/Blu.Build.cs @@ -20,25 +20,54 @@ public Blu(TargetInfo Target) bool isLibrarySupported = false; - if ((Target.Platform == UnrealTargetPlatform.Win64)) + if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Linux)) { isLibrarySupported = true; + + /** //// Start Windows platform //// **/ + + if ((Target.Platform == UnrealTargetPlatform.Win64)) + { + PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "cef/Win/lib", "libcef.lib")); + PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "cef/Win/lib", "libcef_dll_wrapper.lib")); + + PublicIncludePaths.AddRange( + new string[] { + Path.Combine(ThirdPartyPath, "cef/Win"), + Path.Combine(ModulePath, "Blu/Public") + }); + } + + /** //// End Windows platform //// **/ + + + /** //// Start Linux 64 platform //// **/ + + else if ((Target.Platform == UnrealTargetPlatform.Linux)) + { + + PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "cef/Linux/lib", "libcef.so")); + PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "cef/Linux/lib", "libcef_dll_wrapper.a")); + + PublicIncludePaths.AddRange( + new string[] { + Path.Combine(ThirdPartyPath, "cef/Linux"), + Path.Combine(ModulePath, "Blu/Public") + }); + + } + + /** //// End Linux 64 platform //// **/ + + + /** //// General Libs + Includes //// **/ + PrivateIncludePaths.AddRange( new string[] { Path.Combine(ModulePath, "Private") - // ... add other private include paths required here ... }); - PublicIncludePaths.AddRange( - new string[] { - Path.Combine(ThirdPartyPath, "cef/Win"), - Path.Combine(ModulePath, "Blu/Public") - }); - - PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "cef/Win/lib", "libcef.lib")); - PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "cef/Win/lib", "libcef_dll_wrapper.lib")); - PublicDependencyModuleNames.AddRange( new string[] { @@ -53,7 +82,6 @@ public Blu(TargetInfo Target) "UMG", "Json", "JsonUtilities" - // ... add other public dependencies that you statically link with here ... }); } diff --git a/Source/Blu/Private/Blu.cpp b/Source/Blu/Private/Blu.cpp index be1cb3e..bdba563 100644 --- a/Source/Blu/Private/Blu.cpp +++ b/Source/Blu/Private/Blu.cpp @@ -15,8 +15,13 @@ class FBlu : public IBlu BluManager::settings.no_sandbox = true; BluManager::settings.remote_debugging_port = 7777; - - CefString(&BluManager::settings.browser_subprocess_path).FromASCII("blu_ue4_process.exe"); + +#if PLATFORM_LINUX + CefString(&BluManager::settings.browser_subprocess_path).FromASCII("./blu_ue4_process"); +#endif +#if PLATFORM_WINDOWS + CefString(&BluManager::settings.browser_subprocess_path).FromASCII("./blu_ue4_process.exe"); +#endif CefString(&BluManager::settings.cache_path).FromString(GameDirCef); CefExecuteProcess(BluManager::main_args, NULL, NULL); diff --git a/Source/Blu/Private/BluEye.cpp b/Source/Blu/Private/BluEye.cpp index 66eb0c2..30348eb 100644 --- a/Source/Blu/Private/BluEye.cpp +++ b/Source/Blu/Private/BluEye.cpp @@ -35,7 +35,7 @@ void UBluEye::init() info.height = Height; // Set transparant option - info.SetAsWindowless(NULL, bIsTransparent); + info.SetAsWindowless(0, bIsTransparent); renderer = new RenderHandler(Width, Height, this); g_handler = new BrowserClient(renderer); @@ -63,7 +63,7 @@ void UBluEye::ResetTexture() // init the new Texture2D Texture = UTexture2D::CreateTransient(Width, Height, PF_B8G8R8A8); Texture->AddToRoot(); - Texture->UpdateResourceW(); + Texture->UpdateResource(); ResetMatInstance(); diff --git a/Source/Blu/Private/BluInstance.cpp b/Source/Blu/Private/BluInstance.cpp index 411de26..1c4c985 100644 --- a/Source/Blu/Private/BluInstance.cpp +++ b/Source/Blu/Private/BluInstance.cpp @@ -13,8 +13,6 @@ BluInstance::BluInstance() // CefString(&settings.resources_dir_path).FromASCII(""); // CefString(&settings.locales_dir_path).FromASCII(""); - info.SetAsWindowless(nullptr, true); - settings.windowless_rendering_enabled = true; settings.log_severity = LOGSEVERITY_VERBOSE; diff --git a/Source/Blu/Public/BluInstance.h b/Source/Blu/Public/BluInstance.h index c078713..c54aac1 100644 --- a/Source/Blu/Public/BluInstance.h +++ b/Source/Blu/Public/BluInstance.h @@ -1,16 +1,19 @@ #pragma once +#if PLATFORM_WINDOWS #include "AllowWindowsPlatformTypes.h" +#endif #include "include/cef_client.h" #include "include/cef_app.h" +#if PLATFORM_WINDOWS #include "HideWindowsPlatformTypes.h" +#endif class BLU_API BluInstance { private: CefBrowserSettings browserSettings; CefSettings settings; - CefWindowInfo info; public: BluInstance(); diff --git a/Source/Blu/Public/BluManager.h b/Source/Blu/Public/BluManager.h index bbb8ce8..a1e8957 100644 --- a/Source/Blu/Public/BluManager.h +++ b/Source/Blu/Public/BluManager.h @@ -1,9 +1,13 @@ #pragma once +#if PLATFORM_WINDOWS #include "AllowWindowsPlatformTypes.h" +#endif #include "include/cef_client.h" #include "include/cef_app.h" +#if PLATFORM_WINDOWS #include "HideWindowsPlatformTypes.h" +#endif class BLU_API BluManager { diff --git a/Source/Blu/Public/RenderHandler.h b/Source/Blu/Public/RenderHandler.h index 2f28428..a21e8be 100644 --- a/Source/Blu/Public/RenderHandler.h +++ b/Source/Blu/Public/RenderHandler.h @@ -1,9 +1,13 @@ #pragma once +#if PLATFORM_WINDOWS #include "AllowWindowsPlatformTypes.h" +#endif #include "include/cef_client.h" #include "include/cef_app.h" +#if PLATFORM_WINDOWS #include "HideWindowsPlatformTypes.h" +#endif #include "../Public/BluEye.h" @@ -23,7 +27,7 @@ class RenderHandler : public CefRenderHandler void OnPaint(CefRefPtr browser, PaintElementType type, const RectList &dirtyRects, const void *buffer, int width, int height) override; - RenderHandler::RenderHandler(int32 width, int32 height, UBluEye* ui); + RenderHandler(int32 width, int32 height, UBluEye* ui); // CefBase interface // NOTE: Must be at bottom