This file contains hidden or 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
#include <emscripten/val.h> | |
#include <emscripten.h> | |
#include <stdio.h> | |
void Copy_ToCanvas(uint32_t* ptr, int w, int h) | |
{ | |
EM_ASM_( | |
{ | |
var data = Module.HEAPU8.slice($0, $0 + $1 * $2 * 4); | |
let context = Module['canvas'].getContext('2d'); |
This file contains hidden or 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
#include <stdio.h> | |
#define macro_var(name) name##__LINE__ | |
#define defer(start, end) for ( \ | |
int macro_var(_i_) = (start, 0); \ | |
!macro_var(_i_); \ | |
(macro_var(_i_) += 1), end) \ | |
#define profile defer(profile_begin(), profile_end()) |
This file contains hidden or 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
#include <Windows.h> | |
#include <stdio.h> | |
#include "game.h" // Provides Render_Game() and Update_Game() functions | |
#define internal static; | |
#define global static; | |
global bool gIsRunning = true; | |
global bool gIsRendering = true; |
This file contains hidden or 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.IO; | |
using System.Text.Json; | |
using System.Text.Json.Serialization; | |
namespace Map2json | |
{ | |
internal class Program | |
{ | |
// I changed some of the field names a litte |
This file contains hidden or 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
// Replaces a <include src="filename.html"/> tag with the html in the filename | |
using System; | |
using System.IO; | |
using System.Xml.Linq; | |
using System.Linq; | |
namespace HtmlBuild | |
{ | |
class Program |
This file contains hidden or 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 Monorail.Mathlib; | |
using Monorail.Platform; | |
using System; | |
using System.Globalization; | |
using System.IO; | |
using System.Runtime.InteropServices; | |
namespace Monorail.Graphics | |
{ | |
// You will probably need to remap some math operations Vector, Cross-Product etc... into your existing framework. |
This file contains hidden or 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.Text; | |
namespace Proto.Structure | |
{ | |
struct TimerRecord | |
{ | |
public Stopwatch Stopwatch; |
This file contains hidden or 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; | |
namespace Proto.Structure.Services | |
{ | |
public interface IService { } | |
public static class ServiceRegistry | |
{ | |
private static readonly Dictionary<Type, IService> InstantiatedServices = new Dictionary<Type, IService>(); |
This file contains hidden or 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; | |
namespace Proto.Structure.Services | |
{ | |
// Any message you want to pass should implement IMessage | |
public interface IMessage { } | |
// Any subscriber should implement IMessage Handler |