Skip to content

Commit

Permalink
v0.1.20-alpha; updating to dotnet 9
Browse files Browse the repository at this point in the history
  • Loading branch information
NoelFB committed Jan 14, 2025
1 parent ab89f42 commit 5b6d2a9
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 27 deletions.
4 changes: 2 additions & 2 deletions Framework/Foster.Framework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Title>Foster</Title>
<Product>Foster</Product>
<Version>0.1.19-alpha</Version>
<Version>0.1.20-alpha</Version>
<Authors>Noel Berry</Authors>
<Description>A small 2D cross-platform Game Framework</Description>
<RepositoryType>git</RepositoryType>
Expand Down
25 changes: 6 additions & 19 deletions Framework/Graphics/DrawCommand.cs
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@

namespace Foster.Framework;

public struct DrawCommand()
public struct DrawCommand(Target? target, Mesh mesh, Material material)
{
/// <summary>
/// Render Target. If not assigned, will target the Back Buffer
/// </summary>
public Target? Target;
public Target? Target = target;

/// <summary>
/// Material to use
/// </summary>
public Material Material;
public Material Material = material;

/// <summary>
/// Mesh to use
/// </summary>
public Mesh Mesh;
public Mesh Mesh = mesh;

/// <summary>
/// The Index to begin rendering from the Mesh
/// </summary>
public int MeshIndexStart;
public int MeshIndexStart = 0;

/// <summary>
/// The total number of Indices to draw from the Mesh
/// </summary>
public int MeshIndexCount;
public int MeshIndexCount = mesh.IndexCount;

/// <summary>
/// The Render State Blend Mode
Expand Down Expand Up @@ -58,19 +58,6 @@ public struct DrawCommand()
/// </summary>
public RectInt? Scissor = null;

/// <summary>
/// Creates a Draw Command based on the given mesh and material
/// </summary>
public DrawCommand(Target? target, Mesh mesh, Material material)
: this()
{
Target = target;
Mesh = mesh;
Material = material;
MeshIndexStart = 0;
MeshIndexCount = mesh.IndexCount;
}

public readonly void Submit()
{
Graphics.Submit(this);
Expand Down
2 changes: 1 addition & 1 deletion Framework/Images/Font.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private void Load(Stream stream)
{
// allocate enough room for the buffer
byte[] buffer = new byte[stream.Length];
stream.Read(buffer, 0, buffer.Length);
stream.ReadExactly(buffer, 0, buffer.Length);

// pin the buffer
dataHandle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
Expand Down
2 changes: 1 addition & 1 deletion Framework/Images/Image.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private unsafe void Load(Stream stream)
{
// get all the bytes
var data = new byte[stream.Length - stream.Position];
stream.Read(data);
stream.ReadExactly(data);

// load image from byte data
nint mem;
Expand Down
2 changes: 1 addition & 1 deletion Framework/Storage/Content.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public byte[] ReadAllBytes(string path)
{
using var stream = OpenRead(path);
byte[] buffer = new byte[stream.Length];
stream.Read(buffer);
stream.ReadExactly(buffer);
return buffer;
}

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ There is a [Samples](https://github.com/FosterFramework/Samples) repo which cont
Check out [Discussons](https://github.com/FosterFramework/Foster/discussions) or [Discord](https://discord.gg/K7tdFuP3Bg) to get involved.

### Dependencies
- [dotnet 8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) and [C# 12](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12)
- [dotnet 9.0](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) and [C# 13](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-13)
- [SDL2](https://github.com/libsdl-org/sdl) is the only external dependency, which is required by the [Platform library](https://github.com/FosterFramework/Foster/tree/main/Platform). By default this is statically compiled.

### Platform Library
Expand All @@ -27,7 +27,7 @@ Check out [Discussons](https://github.com/FosterFramework/Foster/discussions) or
### Rendering
- Implemented in OpenGL for Linux/Mac/Windows and D3D11 for Windows.
- Separate Shaders are required depending on which rendering API you're targetting.
- Planning to replace the rendering implementation with [SDL3 GPU when it is complete](https://github.com/FosterFramework/Foster/issues/1).
- Replacing the rendering implementation with [SDL3 GPU](https://github.com/FosterFramework/Foster/tree/app-refactor) in the near

### Notes
- Taken a lot of inspiration from other Frameworks and APIs, namely [FNA](https://fna-xna.github.io/).
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"version": "9.0.0",
"rollForward": "latestFeature",
"allowPrerelease": false
}
Expand Down

0 comments on commit 5b6d2a9

Please sign in to comment.