Skip to content
This repository was archived by the owner on May 3, 2019. It is now read-only.

Commit f985dad

Browse files
committed
Beta Linux support
1 parent d9b59ba commit f985dad

File tree

7 files changed

+62
-20
lines changed

7 files changed

+62
-20
lines changed

Source/Blu.Build.cs

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,54 @@ public Blu(TargetInfo Target)
2020

2121
bool isLibrarySupported = false;
2222

23-
if ((Target.Platform == UnrealTargetPlatform.Win64))
23+
if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Linux))
2424
{
2525
isLibrarySupported = true;
2626

27+
28+
/** //// Start Windows platform //// **/
29+
30+
if ((Target.Platform == UnrealTargetPlatform.Win64))
31+
{
32+
PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "cef/Win/lib", "libcef.lib"));
33+
PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "cef/Win/lib", "libcef_dll_wrapper.lib"));
34+
35+
PublicIncludePaths.AddRange(
36+
new string[] {
37+
Path.Combine(ThirdPartyPath, "cef/Win"),
38+
Path.Combine(ModulePath, "Blu/Public")
39+
});
40+
}
41+
42+
/** //// End Windows platform //// **/
43+
44+
45+
/** //// Start Linux 64 platform //// **/
46+
47+
else if ((Target.Platform == UnrealTargetPlatform.Linux))
48+
{
49+
50+
PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "cef/Linux/lib", "libcef.so"));
51+
PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "cef/Linux/lib", "libcef_dll_wrapper.a"));
52+
53+
PublicIncludePaths.AddRange(
54+
new string[] {
55+
Path.Combine(ThirdPartyPath, "cef/Linux"),
56+
Path.Combine(ModulePath, "Blu/Public")
57+
});
58+
59+
}
60+
61+
/** //// End Linux 64 platform //// **/
62+
63+
64+
/** //// General Libs + Includes //// **/
65+
2766
PrivateIncludePaths.AddRange(
2867
new string[] {
2968
Path.Combine(ModulePath, "Private")
30-
// ... add other private include paths required here ...
3169
});
3270

33-
PublicIncludePaths.AddRange(
34-
new string[] {
35-
Path.Combine(ThirdPartyPath, "cef/Win"),
36-
Path.Combine(ModulePath, "Blu/Public")
37-
});
38-
39-
PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "cef/Win/lib", "libcef.lib"));
40-
PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "cef/Win/lib", "libcef_dll_wrapper.lib"));
41-
4271
PublicDependencyModuleNames.AddRange(
4372
new string[]
4473
{
@@ -53,7 +82,6 @@ public Blu(TargetInfo Target)
5382
"UMG",
5483
"Json",
5584
"JsonUtilities"
56-
// ... add other public dependencies that you statically link with here ...
5785
});
5886

5987
}

Source/Blu/Private/Blu.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ class FBlu : public IBlu
1515
BluManager::settings.no_sandbox = true;
1616

1717
BluManager::settings.remote_debugging_port = 7777;
18-
19-
CefString(&BluManager::settings.browser_subprocess_path).FromASCII("blu_ue4_process.exe");
18+
19+
#if PLATFORM_LINUX
20+
CefString(&BluManager::settings.browser_subprocess_path).FromASCII("./blu_ue4_process");
21+
#endif
22+
#if PLATFORM_WINDOWS
23+
CefString(&BluManager::settings.browser_subprocess_path).FromASCII("./blu_ue4_process.exe");
24+
#endif
2025
CefString(&BluManager::settings.cache_path).FromString(GameDirCef);
2126

2227
CefExecuteProcess(BluManager::main_args, NULL, NULL);

Source/Blu/Private/BluEye.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void UBluEye::init()
3535
info.height = Height;
3636

3737
// Set transparant option
38-
info.SetAsWindowless(NULL, bIsTransparent);
38+
info.SetAsWindowless(0, bIsTransparent);
3939

4040
renderer = new RenderHandler(Width, Height, this);
4141
g_handler = new BrowserClient(renderer);
@@ -63,7 +63,7 @@ void UBluEye::ResetTexture()
6363
// init the new Texture2D
6464
Texture = UTexture2D::CreateTransient(Width, Height, PF_B8G8R8A8);
6565
Texture->AddToRoot();
66-
Texture->UpdateResourceW();
66+
Texture->UpdateResource();
6767

6868
ResetMatInstance();
6969

Source/Blu/Private/BluInstance.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ BluInstance::BluInstance()
1313
// CefString(&settings.resources_dir_path).FromASCII("");
1414
// CefString(&settings.locales_dir_path).FromASCII("");
1515

16-
info.SetAsWindowless(nullptr, true);
17-
1816
settings.windowless_rendering_enabled = true;
1917
settings.log_severity = LOGSEVERITY_VERBOSE;
2018

Source/Blu/Public/BluInstance.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
#pragma once
22

3+
#if PLATFORM_WINDOWS
34
#include "AllowWindowsPlatformTypes.h"
5+
#endif
46
#include "include/cef_client.h"
57
#include "include/cef_app.h"
8+
#if PLATFORM_WINDOWS
69
#include "HideWindowsPlatformTypes.h"
10+
#endif
711

812
class BLU_API BluInstance
913
{
1014
private:
1115
CefBrowserSettings browserSettings;
1216
CefSettings settings;
13-
CefWindowInfo info;
1417

1518
public:
1619
BluInstance();

Source/Blu/Public/BluManager.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
#pragma once
22

3+
#if PLATFORM_WINDOWS
34
#include "AllowWindowsPlatformTypes.h"
5+
#endif
46
#include "include/cef_client.h"
57
#include "include/cef_app.h"
8+
#if PLATFORM_WINDOWS
69
#include "HideWindowsPlatformTypes.h"
10+
#endif
711

812
class BLU_API BluManager
913
{

Source/Blu/Public/RenderHandler.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
#pragma once
22

3+
#if PLATFORM_WINDOWS
34
#include "AllowWindowsPlatformTypes.h"
5+
#endif
46
#include "include/cef_client.h"
57
#include "include/cef_app.h"
8+
#if PLATFORM_WINDOWS
69
#include "HideWindowsPlatformTypes.h"
10+
#endif
711

812
#include "../Public/BluEye.h"
913

@@ -23,7 +27,7 @@ class RenderHandler : public CefRenderHandler
2327

2428
void OnPaint(CefRefPtr<CefBrowser> browser, PaintElementType type, const RectList &dirtyRects, const void *buffer, int width, int height) override;
2529

26-
RenderHandler::RenderHandler(int32 width, int32 height, UBluEye* ui);
30+
RenderHandler(int32 width, int32 height, UBluEye* ui);
2731

2832
// CefBase interface
2933
// NOTE: Must be at bottom

0 commit comments

Comments
 (0)