This file contains 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.Runtime.InteropServices; | |
internal static partial class Interop | |
{ | |
[LibraryImport("kernel32.dll")] | |
public static partial void GetSystemInfo(out SystemInfo Info); | |
[LibraryImport("kernel32.dll")] | |
public static partial IntPtr VirtualAllocEx(IntPtr hProcess, IntPtr lpAddress, IntPtr dwSize, AllocationType flAllocationType, MemoryProtection flProtect); |
This file contains 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
public class TorqGame : Tuki.Game | |
{ | |
protected override void ConfigureGraphics(GraphicsDeviceManager graphics) | |
{ | |
graphics.PreferredBackBufferWidth = 1920; | |
graphics.PreferredBackBufferHeight = 1200; | |
graphics.IsFullScreen = false; | |
} | |
protected override void LoadContent() |
This file contains 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
lexer grammar HlslAntlrLexer; | |
@lexer::header {#pragma warning disable 3021} | |
AppendStructuredBuffer : 'AppendStructuredBuffer'; | |
Bool : 'bool'; | |
Bool1 : 'bool1'; | |
Bool2 : 'bool2'; | |
Bool3 : 'bool3'; | |
Bool4 : 'bool4'; |
This file contains 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
<Target Name="BeforeBuild" DependsOnTargets="BuildContent"> | |
<ItemGroup> | |
<!-- Include just-built XNB files as embedded resources in output assembly --> | |
<EmbeddedResource Include="@(ExtraContent)"> | |
<LogicalName>Apollo.Resources.Compiled.$([System.String]::new('%(RecursiveDir)').Replace('\', '.'))%(Filename)%(Extension)</LogicalName> | |
</EmbeddedResource> | |
<!-- Don't copy XNB files to output directory --> | |
<Content Remove="@(ExtraContent->'$(ParentOutputDir)\%(RecursiveDir)%(Filename)%(Extension)')" Condition="$(MonoGamePlatform) != 'Android'" /> | |
<AndroidAsset Remove="@(ExtraContent->'$(ParentOutputDir)\%(RecursiveDir)%(Filename)%(Extension)')" Condition="$(MonoGamePlatform) == 'Android'" /> |
This file contains 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
#ifndef MatrixInversion_Matrix_h | |
#define MatrixInversion_Matrix_h | |
template <int Order> | |
class Matrix | |
{ | |
public: | |
// Static methods | |
static Matrix<Order> identity(); | |
static Matrix<Order> invert(const Matrix<Order>& m); |
This file contains 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
[Test] | |
public void CanExecuteVertexShader() | |
{ | |
// Arrange. | |
var shader = new Shader("Shaders/VS/BasicHLSL.fx", "RenderSceneVS", "vs_4_0"); | |
shader.SetConstantBuffer("$Globals", new BasicHlsl.ConstantBufferGlobals | |
{ | |
WorldViewProjection = | |
Matrix.LookAtRH(Vector3.UnitZ, Vector3.Zero, Vector3.UnitY) * | |
Matrix.PerspectiveFovRH(MathUtil.PiOverFour, 1, 1, 10) |
This file contains 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
public class Asset : Document<Asset> | |
{ | |
public string Title { get; set; } | |
public Attachment File { get; set; } | |
} | |
Attachment file = Attachment.Create("Files/Koala.jpg", "image/jpg"); | |
Asset asset = new Asset | |
{ |
This file contains 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
<sitdap:DynamicImage runat="server"> | |
<Layers> | |
<sitdap:RenderedLayer Width="600" Height="300" SourceFileName="~/Assets/Models/3ds/85-nissan-fairlady.3ds" Zoom="1.4" Yaw="135" /> | |
</Layers> | |
</sitdap:DynamicImage> | |
<sitdap:DynamicImage runat="server"> | |
<Layers> | |
<sitdap:RenderedLayer Width="600" Height="300" BackgroundColour="LightBlue"> | |
<Source> |
This file contains 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
// Normal-Diffuse.shader | |
surface Diffuse; | |
[params] | |
float4 Color : DIFFUSE_COLOR = float4(1, 1, 1, 1); | |
[textures] | |
Texture2D MainTex : DIFFUSE_TEXTURE; |
This file contains 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
scene.Children.Add(new GameObjectBuilder() | |
.WithMeshSource(b => b.Mesh(new Mesh(Content, "Cube"))) | |
.WithMeshRenderer() | |
.WithBoxCollider(b => b.Size(new Vector3(10, 10, 10))) | |
.WithRigidBody() | |
.Position(new Vector3(100, 50, 100)) | |
.Rotation(Vector3.Right, MathHelper.Pi / 8.0f) | |
.ToGameObject()); |