//--------------------------------------------------------------------------------------------------------------------------------------------------- // <copyright file="GpuVariableInterface.cs" company="DarkWynter Studios"> // Copyright (C)2007 DarkWynter Studios. All rights reserved. // </copyright> //--------------------------------------------------------------------------------------------------------------------------------------------------- // {Contact : darkwynter.com for licensing information //--------------------------------------------------------------------------------------------------------------------------------------------------- namespace DarkWynter.Stream.PhysicsGpu { #region Using Statements using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Storage; using System.Xml; #endregion /// <summary> /// Enforces usage mechanics for a GpuVariable. /// </summary> public interface GpuVariableInterface { /// <summary> /// Texture used by Gpu to read values in. /// Swapped with write texture each pass. /// </summary> Texture2D _read { get; set; } /// <summary> /// Texture used by Gpu to write values out. /// Swapped with read texture each pass. /// </summary> Texture2D _write { get; set; } /// <summary> /// Gpu handle that sets either the read texture each pass after it is swapped with the write texture. /// </summary> EffectParameter _gpuPointer { get; set; } /// <summary> /// A render target for the write texture. /// </summary> RenderTarget2D _writeRenderTarget { get; set; } /// <summary> /// A render target for the read texture. /// </summary> RenderTarget2D _readRenderTarget { get; set; } /// <summary> /// Add a single property to the GpuVariable, before setting texture data. /// </summary> /// <param name="property">A value to add to the texture.</param> void AddProperty(float property); /// <summary> /// Add a single property to the GpuVariable, before setting texture data. /// </summary> /// <param name="property">A value to add to the texture.</param> void AddProperty(Vector2 property); /// <summary> /// Add a single property to the GpuVariable, before setting texture data. /// </summary> /// <param name="property">A value to add to the texture.</param> void AddProperty(Vector3 property); /// <summary> /// Add a single property to the GpuVariable, before setting texture data. /// </summary> /// <param name="property">A value to add to the texture.</param> void AddProperty(Vector4 property); /// <summary> /// Set the texture with all added properties. /// Scales values based on minValue and maxValue, to between 0-1. /// </summary> void SetTexData(); /// <summary> /// Swap the read and write textures. /// Must be done each pass for previously rendered data to be availible to shaders during next pass. /// </summary> void SwapBuffers(); /// <summary> /// Usefull function for debugging. /// Writes texture out to an image file. /// </summary> void WriteToFile(); } }