This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using SharpDX.Windows; | |
using SharpDx3.Direct3D; | |
namespace SharpDx3 | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Here we are creating our device, swapchain, etc. A fairly basic | |
// example of setting up our form for Direct2D drawing. Note the | |
// pixel format - we need to remember this when drawing pixels to | |
// our raw byte array. | |
var swapChainDesc = new SwapChainDescription | |
{ | |
BufferCount = 2, | |
Usage = Usage.RenderTargetOutput, | |
OutputHandle = form.Handle, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using SharpDX; | |
using SharpDX.D3DCompiler; | |
using SharpDX.Direct3D; | |
using SharpDX.Direct3D11; | |
using SharpDX.DXGI; | |
using SharpDX.Windows; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using SharpDX; | |
using SharpDX.D3DCompiler; | |
using SharpDX.Direct3D; | |
using SharpDX.Direct3D11; | |
using SharpDX.DXGI; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$postbuild = "" | |
foreach ($arg in $args) { | |
switch ($arg) { | |
"run" { $postbuild = "run" } | |
"debug" { $postbuild = "debug" } | |
} | |
} | |
if (!(test-path build)) { mkdir build } | |
if (!(test-path build/obj)) { mkdir build/obj } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::shared_ptr<FontAtlas> generateFontAtlas(int fontId, int fontSizeInPixels, int sdfPadding) | |
{ | |
/* ACTION PLAN: | |
create a new list (vector) in which to stage a set of character glyphs, each prepared in isolation | |
for each character: | |
load the character and its metrics from the font engine, using a very large font size (10 times the requested font size) | |
create a new image expanded to include padding for the distance field | |
copy the character bitmap into the centre of the image | |
render the distance field into the image | |
downsize the image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<require from="./linked-data"></require> | |
<table> | |
<tbody> | |
<tr repeat.for="pair of pairs()"> | |
<td>${pair.predicate}</td> | |
<td> | |
<linked-data subject.bind="this" predicate.bind="pair.predicate" value.bind="pair.value"></linked-data> | |
</td> | |
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Rx} from '@cycle/core'; | |
export default function (responses, strings) { | |
var log = responses.log.create('Sample'); | |
var str$ = Rx.Observable | |
.from(strings) | |
.do(str => { | |
log.trace('Just tracing stuff'); | |
log.debug('Here is a debug message'); | |
log.success('The successful thing happened that we wanted to happen'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logger from './logger'; | |
let log = logger('Category'); | |
log.trace('Just tracing stuff'); | |
log.debug('Here is a debug message'); | |
log.success('The successful thing happened that we wanted to happen'); | |
log.info('Information makes the world go around, and here is that string:', str); | |
log('An info message can be logged using short form'); | |
log.warn('You better be careful about this kind of thing'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import {Router5, RouteNode} from 'router5'; | |
import logger from '../logger'; | |
// The set of valid sink functions includes synchronous state-affecting router functions that do not require a callback | |
// and which do not have a significant return value other than the router object itself. | |
const validSinkFuncs = ['add','addNode','canActivate','deregisterComponent','navigate','registerComponent','setOption','start','stop']; | |
function validateAndRemapSinkArgument(arg) { |