Skip to content

Instantly share code, notes, and snippets.

View thatcosmonaut's full-sized avatar

Evan Hemsley thatcosmonaut

View GitHub Profile
@thatcosmonaut
thatcosmonaut / Logger.cs
Last active August 2, 2023 00:58
Samurai Gunn 2 Logger System
using System.IO;
namespace SamuraiGunn2
{
public static class Logger
{
private static StreamWriter streamWriter;
public static void SetLogOutputFile(string filePath)
{
@thatcosmonaut
thatcosmonaut / SettingsHelper.cs
Created July 31, 2023 23:43
Samurai Gunn 2 Settings Loader
using System.IO;
using System.Text.Json;
using System.Text.Json.Serialization;
using MoonWorks;
namespace SamuraiGunn2
{
[JsonSerializable(typeof(VideoSettings))]
internal partial class VideoSettingsContext : JsonSerializerContext
{
@thatcosmonaut
thatcosmonaut / CramAtlasReader.cs
Created June 26, 2023 17:00
System.Text.Json Codegen Serialization Example
using System.IO;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace SamuraiGunn2.Data
{
[JsonSerializable(typeof(CramTextureAtlasData))]
internal partial class CramTextureAtlasDataContext : JsonSerializerContext
{
}
@thatcosmonaut
thatcosmonaut / DPBuffer.cs
Last active June 19, 2023 22:25
DPBuffer
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using dp.type;
namespace SamuraiGunn2
{
public unsafe class DPBuffer : IBuffer, IDisposable
{
private byte* Bytes;
private int Length;
@thatcosmonaut
thatcosmonaut / Position2DTextureVertex.cs
Last active March 17, 2022 06:42
MoonWorks Sprite Batch Sample
public struct Position2DTextureVertex
{
public Vector2 Position;
public Vector2 TexCoord;
public Position2DTextureVertex(Vector2 position, Vector2 texcoord)
{
Position = position;
TexCoord = texcoord;
}
@thatcosmonaut
thatcosmonaut / main.c
Created December 22, 2021 19:14
FNA3D Multi Window Test
#include <SDL.h>
#include <FNA3D.h>
static int32_t windowflags;
static uint8_t run = 1;
int main(int argc, char **argv)
{
SDL_Event evt;
SDL_Thread *red, *blue;
@thatcosmonaut
thatcosmonaut / ImGuiRenderer.cs
Created September 17, 2021 20:43
Anathema Moonworks/ImGui Renderer
// Heavily based on prime31's Nez ImGuiRenderer
// https://github.com/prime31/Nez/blob/master/Nez.ImGui/Core/ImGuiRenderer.cs
#if DEBUG
using System.Runtime.InteropServices;
using Encompass;
using ImGuiNET;
using MoonWorks.Graphics;
using Anathema.Data;
using System.Collections.Generic;
@thatcosmonaut
thatcosmonaut / gms2_gamepad_db_composer.py
Last active October 5, 2021 21:12 — forked from offalynne/gms2_gamepad_db_composer.py
GMS2 Gamepad DB Composer
#!/usr/bin/python
# @offalynne, 2021
# Modified for python 3 by @thatcosmonaut
import re
import os
import sys
import urllib.request
@thatcosmonaut
thatcosmonaut / OrthographicCamera.cs
Created July 6, 2021 02:58
an orthographic camera example for FNA
public struct OrthographicCamera : ICamera
{
public Matrix View { get; }
public Matrix Projection { get; }
public Vector3 Position { get; }
public Vector3 Forward { get; }
public Vector3 Up { get; }
public Vector3 Right { get; }
version: '3'
services:
nginx:
image: staticfloat/nginx-certbot
restart: always
ports:
- 80:80/tcp
- 443:443/tcp
environment: