MCPcopy Create free account
hub / github.com/StereoKit/StereoKit / Main

Method Main

tools/VSTemplates/SKTemplate_UWP/Program.cs:8–41  ·  view source on GitHub ↗
(string[] args)

Source from the content-addressed store, hash-verified

6 class Program
7 {
8 static void Main(string[] args)
9 {
10 // Initialize StereoKit
11 SKSettings settings = new SKSettings
12 {
13 appName = "SKTemplate_UWP_Name",
14 assetsFolder = "Assets",
15 };
16 if (!SK.Initialize(settings))
17 Environment.Exit(1);
18
19
20 // Create assets used by the app
21 Pose cubePose = new Pose(0,0,-0.5f, Quat.Identity);
22 Model cube = Model.FromMesh(
23 Mesh.GenerateRoundedCube(Vec3.One*0.1f, 0.02f),
24 Default.MaterialUI);
25
26 Matrix floorTransform = Matrix.TS(0, -1.5f, 0, new Vec3(30, 0.1f, 30));
27 Material floorMaterial = new Material(Shader.FromFile("floor.hlsl"));
28 floorMaterial.Transparency = Transparency.Blend;
29
30
31 // Core application loop
32 while (SK.Step(() =>
33 {
34 if (SK.System.displayType == Display.Opaque)
35 Default.MeshCube.Draw(floorMaterial, floorTransform);
36
37 UI.Handle("Cube", ref cubePose, cube.Bounds);
38 cube.Draw(cubePose.ToMatrix());
39 }));
40 SK.Shutdown();
41 }
42 }
43}

Callers

nothing calls this directly

Calls 10

FromMeshMethod · 0.80
GenerateRoundedCubeMethod · 0.80
TSMethod · 0.80
HandleMethod · 0.80
ToMatrixMethod · 0.80
InitializeMethod · 0.45
FromFileMethod · 0.45
StepMethod · 0.45
DrawMethod · 0.45
ShutdownMethod · 0.45

Tested by

no test coverage detected