move examples into package (include them in published crate)
This commit is contained in:
		
							parent
							
								
									5514f60c28
								
							
						
					
					
						commit
						c92493fad1
					
				
					 22 changed files with 26 additions and 165 deletions
				
			
		
							
								
								
									
										20
									
								
								crates/servicepoint_binding_cs/examples/lang_cs/Program.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								crates/servicepoint_binding_cs/examples/lang_cs/Program.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,20 @@
 | 
			
		|||
using ServicePoint;
 | 
			
		||||
using CompressionCode = ServicePoint.BindGen.CompressionCode;
 | 
			
		||||
 | 
			
		||||
using var connection = Connection.Open("127.0.0.1:2342");
 | 
			
		||||
 | 
			
		||||
connection.Send(Command.Clear().IntoPacket());
 | 
			
		||||
connection.Send(Command.Brightness(128).IntoPacket());
 | 
			
		||||
 | 
			
		||||
using var pixels = PixelGrid.New(Constants.PixelWidth, Constants.PixelHeight);
 | 
			
		||||
 | 
			
		||||
for (var offset = 0; offset < int.MaxValue; offset++)
 | 
			
		||||
{
 | 
			
		||||
    pixels.Fill(false);
 | 
			
		||||
 | 
			
		||||
    for (var y = 0; y < pixels.Height; y++)
 | 
			
		||||
        pixels[(y + offset) % Constants.PixelWidth, y] = true;
 | 
			
		||||
 | 
			
		||||
    connection.Send(Command.BitmapLinearWin(0, 0, pixels.Clone(), CompressionCode.Lzma).IntoPacket());
 | 
			
		||||
    Thread.Sleep(14);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,15 @@
 | 
			
		|||
<Project Sdk="Microsoft.NET.Sdk">
 | 
			
		||||
 | 
			
		||||
    <PropertyGroup>
 | 
			
		||||
        <OutputType>Exe</OutputType>
 | 
			
		||||
        <TargetFramework>net8.0</TargetFramework>
 | 
			
		||||
        <RootNamespace>lang_cs</RootNamespace>
 | 
			
		||||
        <ImplicitUsings>enable</ImplicitUsings>
 | 
			
		||||
        <Nullable>enable</Nullable>
 | 
			
		||||
    </PropertyGroup>
 | 
			
		||||
 | 
			
		||||
    <ItemGroup>
 | 
			
		||||
        <ProjectReference Include="../../crates/servicepoint_binding_cs/ServicePoint/ServicePoint.csproj"/>
 | 
			
		||||
    </ItemGroup>
 | 
			
		||||
 | 
			
		||||
</Project>
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue