Code Monkey home page Code Monkey logo

appcore's Introduction

AppCore

AppCore is a cross-platform app runtime module for Ultralight that provides platform-specific window creation, events, message loops, and GPU context creation / drawing.

You should use AppCore only if you intend to build a standalone HTML-based desktop application (ala Electron).

For lower-level integration, (eg, for rendering within an existing game engine), you should instead use the lower-level Ultralight API (eg, Renderer::Create()) which grants you the ability to render Views offscreen to a pixel buffer using the CPU renderer.

For more information see our Docs.

The following GPU back-ends are used on each platform:

Platform GPU Driver
Windows Direct3D 11
macOS Metal
Linux OpenGL 3.2 (GLFW)

Downloading pre-built binaries

Pre-built binares are uploaded to the following S3 buckets every commit:

Click any of the bucket links to get an XML file listing. Download a package by appending the filename to the bucket URL.

You'll need the following:

Setting up on Windows

  1. Install Visual Studio 2019 (Free Community Edition works fine). Remember to select the C++ packages.
  2. Install Chocolatey (https://chocolatey.org).
  3. Run the following from command line:
choco install cmake ninja

Setting up on macOS

  1. Install Xcode Command Line Tools (or the full Xcode package).
  2. Download the macOS 10.14 Platform SDK from https://github.com/phracker/MacOSX-SDKs/releases and extract it to /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk.
  3. Install Homebrew (https://brew.sh/)
  4. Run the following from the Terminal to setup the needed homebrew packages:
brew install cmake ninja

Setting up on Linux (Debian 9.5+)

To get everything on Linux, just type the following:

sudo apt install cmake ninja-build clang lld-4.0 libx11-dev xorg-dev libglu1-mesa-dev

Building from source

Building on Windows

To build AppCore for Windows / 64-bit:

make release x64

Building Debug on Windows

To build AppCore with debug symbols:

make debug x64

Building on Windows with locally-built dependencies

By default, the build scripts in this repo fetch pre-built dependencies from our servers.

To build AppCore using locally-built dependencies in the /deps folder (really only useful if you need to build against modified modules/deps):

make release x64 local

Building on macOS and Linux

To build for macOS/Linux:

./make

Build products

Build products will be in <build_dir>/out.

If your checkout is up-to-date, a 7zip release archive will also be generated in <build_dir>.

appcore's People

Contributors

adamjs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

appcore's Issues

Wrong description of Ref<App> Create()

Ref Create() comments say that one should "set your Config before creating App".

/// Config before creating App. (@see Platform::set_config)

However, as AppWin::AppWin() constructor overrides with Platform::instance().set_config, it has no effect.

Platform::instance().set_config(config);

For example, if I load https://google.co.kr like below,

auto& platform = ultralight::Platform::instance();

Config config;
config.font_family_standard = "Malgun Gothic";
config.font_family_fixed = "Malgun Gothic";
config.font_family_serif = "Malgun Gothic";
config.font_family_sans_serif = "Malgun Gothic";
config.user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36";

platform.set_config(config);

app_ = App::Create();

The result is like this:
image

The CORRECT way to setup config is,

app_ = App::Create();

auto& platform = ultralight::Platform::instance();

Config config;
config.font_family_standard = "Malgun Gothic";
config.font_family_fixed = "Malgun Gothic";
config.font_family_serif = "Malgun Gothic";
config.font_family_sans_serif = "Malgun Gothic";
config.user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36";

platform.set_config(config);

app_->renderer() = Renderer::Create(); //this overides default config with 'my' config

which leads to Chrome-like correctly rendered scene.
image

[Feature Request] Create Ultralight renderer on existing window

In order to create a VST plugin, the host creates a window and passes the reference to the plugin to render on. I'd like to be able to use Ultralight for this, but it does not seem that it's possible to pass a previously created window like this.

Could this either a) be documented or b) be implemented?

Thanks much!

MIME type of .js file on Windows is text/plain (sometimes?)

[GetFileMimeType] Bin/launcher-ui/js/app.js = text/plain
[GetFileMimeType] Bin/launcher-ui/css/main.css = text/css
[Ultralight] [Console]: [JS] [Error] TypeError: 'text/plain' is not a valid JavaScript MIME type. (@1:11)

I see the default platform filesystem implementation on Windows uses registry to check for MIME type. However...
image

Turns out on some systems it's actually set to text/plain for .js files in the registry! I'd propose adding some hardcoded mapping for the most common web extensions, especially that WebCore will refuse to load a .js file with wrong MIME type, apparently, unlike Firefox and Chromium. I guess either that or make a patch to ignore wrong MIME type for JS files?

FileSystemWin does not implement all FileSystem methods

There is a huge list of boilerplate to fill. Do I really need to implement file deletion and getting free volume space if I only want to display a page? Why is even OpenTemporaryFile separate from OpenFile? Do I need to write my own String16Vector implementation?

How I can set window Icon

Hi,
I have the taskbar icon with a .rc file. No problem for this.
But, How I can use my .rc Icon ID for the Window? I don't find any way to access HWND (for Windows).

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.