mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
b88ca1b4a6
Yes this seems confusing as on mac+linux Long is either 32 or 64bits depending on the architecture, but this is how the X11 protocol is defined. Thus 5 is the correct value for the nelts here. Not 5 or 10 depending on the architecture. More info on the confusion https://bugs.freedesktop.org/show_bug.cgi?id=16802
41 lines
1.2 KiB
JavaScript
41 lines
1.2 KiB
JavaScript
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
function makeURL(toolchain, config) {
|
|
return 'index.html?tc=' + toolchain + '&config=' + config;
|
|
}
|
|
|
|
function createWindow(url) {
|
|
console.log('loading ' + url);
|
|
chrome.app.window.create(url, {
|
|
width: 1024,
|
|
height: 800,
|
|
frame: 'none'
|
|
});
|
|
}
|
|
|
|
function onLaunched(launchData) {
|
|
// Send and XHR to get the URL to load from a configuration file.
|
|
// Normally you won't need to do this; just call:
|
|
//
|
|
// chrome.app.window.create('<your url>', {...});
|
|
//
|
|
// In the SDK we want to be able to load different URLs (for different
|
|
// toolchain/config combinations) from the commandline, so we to read
|
|
// this information from the file "run_package_config".
|
|
var xhr = new XMLHttpRequest();
|
|
xhr.open('GET', 'run_package_config', true);
|
|
xhr.onload = function() {
|
|
var toolchain_config = this.responseText.split(' ');
|
|
createWindow(makeURL.apply(null, toolchain_config));
|
|
};
|
|
xhr.onerror = function() {
|
|
// Can't find the config file, just load the default.
|
|
createWindow('index.html');
|
|
};
|
|
xhr.send();
|
|
}
|
|
|
|
chrome.app.runtime.onLaunched.addListener(onLaunched);
|