Skip to content

Instantly share code, notes, and snippets.

View TheSpydog's full-sized avatar

Caleb Cornett TheSpydog

View GitHub Profile
@TheSpydog
TheSpydog / fna-wasm-instructions.md
Last active February 19, 2024 01:41
How to build your FNA game for WebAssembly

How to build your FNA game for WebAssembly

WARNING: This process is EXTREMELY experimental and not officially supported yet!

Thanks to the ongoing work on .NET WebAssembly support, it is now possible to build FNA games for the web!

If you decide to give this a try, be sure to tell us about it in the FNA Discord! I'm happy to help if you run into problems or have any further questions that are not answered here.

The Basics

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace ShaderTest
{
class ShaderTestGame : Game
{
GraphicsDeviceManager graphics;
RenderTarget2D renderTarget;
/* SpriteBatch Stress Test
* Written by Ethan "flibitijibibo" Lee
* http://www.flibitijibibo.com/
*
* Released under public domain.
* No warranty implied; use at your own risk.
*/
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
/* Mostly ripped off from MonoGame's unit tests. */
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
class GetSetBufferTest : Game
{
VertexPositionTexture[] savedData = new VertexPositionTexture[]
{
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace VertexSamplerTest
{
public class Program
{
public static void Main(string[] args)
{
@TheSpydog
TheSpydog / sdl2_metal_clearscreen.m
Last active June 6, 2023 12:31
SDL_Metal Clear Screen Example
/* Requires >= SDL 2.0.11 (not yet released)
* Also requires a patch that has not yet been merged:
* https://bugzilla.libsdl.org/show_bug.cgi?id=4796
*/
#include <SDL.h>
#import <Metal/Metal.h>
#import <QuartzCore/CAMetalLayer.h>
int main(int argc, char **argv) {
@TheSpydog
TheSpydog / buildlog.txt
Created July 27, 2019 19:54
tvOS build log
Building solution tvIncrementalBuildTest (Debug|iPhone)
Build started 7/27/2019 3:53:03 PM.
__________________________________________________
Project "/Users/calebcornett/Projects/tvIncrementalBuildTest/tvIncrementalBuildTest/tvIncrementalBuildTest.csproj" (Build target(s)):
Target _BeforeCoreCompileInterfaceDefinitions:
Skipping target "_BeforeCoreCompileInterfaceDefinitions" because all output files are up-to-date with respect to the input files.
Target _CoreCompileInterfaceDefinitions:
Skipping target "_CoreCompileInterfaceDefinitions" because all output files are up-to-date with respect to the input files.
changeset: 1194:ee0b613094d8
tag: tip
user: Caleb Cornett <caleb.cornett@outlook.com>
date: Sat Apr 06 21:34:25 2019 -0400
summary: Add PROFILE_GLSLES CMake option
diff -r 4decf307c228 -r ee0b613094d8 CMakeLists.txt
--- a/CMakeLists.txt Wed Mar 06 15:09:49 2019 -0500
+++ b/CMakeLists.txt Sat Apr 06 21:34:25 2019 -0400
@@ -5,6 +5,7 @@
@TheSpydog
TheSpydog / lookuptest.cs
Last active January 6, 2020 09:09
C# Lookup Perf Test
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Diagnostics;
namespace LookupTest
{
class MainClass
{
class MyTestClass
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it