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

Commit

Permalink
Beta Linux support
Browse files Browse the repository at this point in the history
  • Loading branch information
ashea-code committed Feb 27, 2015
1 parent d9b59ba commit f985dad
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 20 deletions.
52 changes: 40 additions & 12 deletions Source/Blu.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
{
Expand All @@ -53,7 +82,6 @@ public Blu(TargetInfo Target)
"UMG",
"Json",
"JsonUtilities"
// ... add other public dependencies that you statically link with here ...
});

}
Expand Down
9 changes: 7 additions & 2 deletions Source/Blu/Private/Blu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions Source/Blu/Private/BluEye.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();

Expand Down
2 changes: 0 additions & 2 deletions Source/Blu/Private/BluInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 4 additions & 1 deletion Source/Blu/Public/BluInstance.h
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
4 changes: 4 additions & 0 deletions Source/Blu/Public/BluManager.h
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
6 changes: 5 additions & 1 deletion Source/Blu/Public/RenderHandler.h
Original file line number Diff line number Diff line change
@@ -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"

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

void OnPaint(CefRefPtr<CefBrowser> 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
Expand Down

0 comments on commit f985dad

Please sign in to comment.