Skip to content

Commit

Permalink
Added DrawFilledRectangle and example in CGS demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Arawn Davies committed Aug 14, 2017
1 parent cb2fd84 commit 804e112
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 44 deletions.
22 changes: 1 addition & 21 deletions Demos/CosmosGraphicSubsystem/CosmosGraphicSubsystemBoot.Cosmos
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,11 @@
<Compile Remove="*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\source\Cosmos.Core.Plugs.Asm\Cosmos.Core.Plugs.Asm.csproj">
<Name>Cosmos.Core.Plugs.Asm</Name>
<Project>{3c186d37-21c3-417c-95f1-19be538af88a}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\..\source\Cosmos.Core.Plugs\Cosmos.Core.Plugs.csproj">
<Name>Cosmos.Core.Plugs</Name>
<Project>{1132e689-18b0-4d87-94e8-934d4802c540}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\..\source\Cosmos.Debug.Kernel.Plugs.Asm\Cosmos.Debug.Kernel.Plugs.Asm.csproj">
<Name>Cosmos.Debug.Kernel.Plugs.Asm</Name>
<Project>{7e450662-b34c-49b0-a826-f45ad3a18891}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\..\source\Cosmos.System.Plugs\Cosmos.System.Plugs.csproj">
<Name>Cosmos.System.Plugs</Name>
<Project>{9431ff1f-ad75-4a1e-b38a-46e0f109411d}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\CosmosGraphicSubsystem\CosmosGraphicSubsystem.csproj">
<Name>CosmosGraphicSubsystem</Name>
<Project>{49f2c01d-d2c5-4564-810b-1ae92236c5c1}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(AppData)\Cosmos User Kit\Build\VSIP\Cosmos.targets" />
</Project>
</Project>
4 changes: 4 additions & 0 deletions Demos/CosmosGraphicSubsystem/Kernel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ protected override void Run()
pen.Color = Color.LimeGreen;
canvas.DrawRectangle(pen, 450, 450, 80, 60);

/* A filled rectange */
pen.Color = Color.Chocolate;
canvas.DrawFilledRectangle(pen, 200, 150, 400, 300);

/*
* It will be really beautiful to do here:
* canvas.DrawString(pen, "Please press any key to end the Demo...");
Expand Down
21 changes: 1 addition & 20 deletions install-VS2017.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,6 @@ cls

set NuGet=Build\Tools\nuget.exe
set VSWhere=Build\Tools\vswhere.exe
set IL2CPU=..\IL2CPU\IL2CPU.sln
set XS=..\XSharp\XSharp.sln

echo Finding XSharp repo directory
IF EXIST %XS% (echo XSharp solution found!) else (
echo XSharp not found!
goto NOI2CXS
)

echo Looking for IL2CPU repo directory...
IF EXIST %IL2CPU% (echo IL2CPU solution found!) else (
echo IL2CPU not found!
goto NOI2CXS )


:NuGet
echo Running NuGet restore
Expand All @@ -38,9 +24,4 @@ if exist %MSBuild% (
)


start "Cosmos Builder" "source\Cosmos.Build.Builder\bin\Debug\Cosmos.Build.Builder.exe" "-VSPATH=%InstallDir%" %1 %2 %3 %4 %5 %6 %7 %8 %9


:NOI2CXS
echo install-vs2017.bat failed to find the required IL2CPU or XSharp directories
echo Be sure to see the Cosmos documentation for instructions on building Cosmos
start "Cosmos Builder" "source\Cosmos.Build.Builder\bin\Debug\Cosmos.Build.Builder.exe" "-VSPATH=%InstallDir%" %1 %2 %3 %4 %5 %6 %7 %8 %9
5 changes: 2 additions & 3 deletions source/Cosmos.System2/Graphics/Canvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,9 @@ public virtual void DrawRectangle(Pen pen, int x, int y, int width, int height)

public virtual void DrawFilledRectangle(Pen pen, int x_start, int y_start, int width, int height)
{
for (int i = 0; i != width; i++)
for (int y = y_start; y < y_start + height; y++)
{
DrawLine(pen, x_start, y_start, x_start + height, y_start);
y_start++;
DrawLine(pen, x_start, y, x_start + width - 1, y);
}
}

Expand Down

0 comments on commit 804e112

Please sign in to comment.