-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from Tornado-Technology/texture-rework
Texture Manager rework
- Loading branch information
Showing
16 changed files
with
267 additions
and
74 deletions.
There are no files selected for viewing
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
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
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
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
6 changes: 6 additions & 0 deletions
6
Hypercube.Client/Graphics/Texturing/Events/HandlesPreloadEvent.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
using Hypercube.Shared.EventBus.Events; | ||
using Hypercube.Shared.Resources; | ||
|
||
namespace Hypercube.Client.Graphics.Texturing.Events; | ||
|
||
public record struct HandlesPreloadEvent(HashSet<ResourcePath> Handles) : IEventArgs; |
6 changes: 6 additions & 0 deletions
6
Hypercube.Client/Graphics/Texturing/Events/TexturesPreloadEvent.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
using Hypercube.Shared.EventBus.Events; | ||
using Hypercube.Shared.Resources; | ||
|
||
namespace Hypercube.Client.Graphics.Texturing.Events; | ||
|
||
public record struct TexturesPreloadEvent(HashSet<ResourcePath> Textures) : IEventArgs; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
namespace Hypercube.Client.Graphics.Texturing; | ||
using Hypercube.Client.Graphics.Texturing.TextureSettings.TextureParameters; | ||
|
||
public interface ITextureHandle | ||
namespace Hypercube.Client.Graphics.Texturing; | ||
|
||
public interface ITextureHandle : IDisposable | ||
{ | ||
int Handle { get; } | ||
ITexture Texture { get; } | ||
|
||
void Bind(); | ||
void Bind(TextureTarget target); | ||
void Unbind(TextureTarget target); | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
using Hypercube.Shared.Math.Box; | ||
using Hypercube.Shared.Math.Vector; | ||
using Hypercube.Shared.Resources; | ||
|
||
namespace Hypercube.Client.Graphics.Texturing; | ||
|
||
public readonly struct Texture(Vector2Int size, byte[] data) : ITexture | ||
public readonly struct Texture(ResourcePath path, Vector2Int size, byte[] data) : ITexture | ||
{ | ||
public readonly Vector2Int Size = size; | ||
|
||
public int Width => size.X; | ||
public int Height => size.Y; | ||
public byte[] Data => data; | ||
|
||
public ResourcePath Path { get; } = path; | ||
public int Width { get; } = size.X; | ||
public int Height { get; } = size.Y; | ||
public byte[] Data { get; } = data; | ||
public Box2 QuadCrateTranslated(Vector2 position) | ||
{ | ||
return new Box2(position, position + (Vector2)Size); | ||
return new Box2(position, position + (Vector2)size); | ||
} | ||
} |
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
Oops, something went wrong.