Skip to content

Instantly share code, notes, and snippets.

using MoonTools.ECS;
using Pathogen.Game.ECS.Components;
using System.Numerics;
using ECSSystem = MoonTools.ECS.System;
namespace Pathogen.Game.ECS.Systems;
/// <summary>
/// Sets the TransformMatrixComponent component for entities in the world.
/// </summary>
// vertext shader
#pragma pack_matrix( row_major )
cbuffer UniformBlock : register(b0, space1)
{
float4x4 Transform;
};
struct Input
{
using MoonTools.ECS;
using MoonToolsECSTest.Components;
using MoonToolsECSTest.Messages;
namespace MoonToolsECSTest.Systems
{
public sealed class ParticleSystem : MoonTools.ECS.System
{
readonly Dictionary<string, ParticleSystemTemplate> _particleSystemResources;
readonly Dictionary<int, List<string>> _entityClassificationsToParticleSystems;
@PumpkinPaul
PumpkinPaul / MoonToolsECSTest.cs
Last active March 4, 2023 00:20
MoonToolsECSTest
using Microsoft.Xna.Framework;
using MoonTools.ECS;
using MoonTools.Structs;
using MoonToolsECSTest.Components;
using MoonToolsECSTest.Renderers;
using MoonToolsECSTest.Systems;
//Entities are ids and the components are just structs but this gives us a way to classify entities
//(e.g. equivalent to 'type' system)
//NOTE - DON'T think of entities as types - they are still defined by components and behaviour.
=====================================================================================================================
=====================================================================================================================
=====================================================================================================================
=====================================================================================================================
XboxOneNativeLeaderboard.h
#pragma once
#ifndef _$H_GAURD_XBOXONENATIVELEADERBOARD
#define _$H_GAURD_XBOXONENATIVELEADERBOARD
// GENERATED BY BRUTE
// PumpkinGames.Glitchangels.Platforms.XboxOne.Native.XboxOneNative
#include <mscorlib/1nternal/Brute.h>
#include "Glitchangels/PumpkinGames/Glitchangels/Platforms/XboxOne/Native/XboxOneNative.h"
#include "Glitchangels/PumpkinGames/Glitchangels/Platforms/XboxOne/Native/XboxOneNativeStats.h"
#include "Glitchangels/PumpkinGames/Glitchangels/Platforms/XboxOne/Native/XboxOneNativeLeaderboard.h"
#include "mscorlib/System/Array.h"
#include "mscorlib/System/Byte.h"
#ifndef STRUCTURES_FXH
#define STRUCTURES_FXH
struct PSInput
{
float4 position : SV_Position;
float4 color : COLOR0;
float2 texCoord : TEXCOORD0;
};
@PumpkinPaul
PumpkinPaul / Vertex.fxh
Created January 21, 2021 15:10
Vertex Shader
#ifndef VERTEX_FXH
#define VERTEX_FXH
#include "Structures.fxh"
PSInput CommmonVertexShader(
float4 position : POSITION0,
float4 color : COLOR0,
float2 texCoord : TEXCOORD0)
{
@PumpkinPaul
PumpkinPaul / SpriteEffect.fx
Created January 21, 2021 13:51
Simple sprite shader
#include "Macros.fxh"
#include "Structures.fxh"
DECLARE_TEXTURE(UserTexture, 0);
BEGIN_CONSTANTS
MATRIX_CONSTANTS
float4x4 MatrixTransform _vs(c0) _cb(c0);
END_CONSTANTS
//0080: Processing during writes
//Applications that write to save data must do at least one of the following:
//(A) If notified of an exit request while in the middle of writing data, finish writing the data before closing.
//(B) Display some on-screen indication while writing data.
I chose to implement option (A)
//UPDATE 22/10/2018