-
Notifications
You must be signed in to change notification settings - Fork 16
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 #196 from Susko3/add-SDL_GetTrayEntries-helper
Implement helper for `SDL_GetTrayEntries()`
- Loading branch information
Showing
4 changed files
with
54 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System; | ||
using System.Diagnostics; | ||
|
||
namespace SDL | ||
{ | ||
public sealed unsafe class SDLConstOpaquePointerArray<T> | ||
where T : unmanaged | ||
{ | ||
private readonly T** array; | ||
public readonly int Count; | ||
|
||
internal SDLConstOpaquePointerArray(T** array, int count) | ||
{ | ||
this.array = array; | ||
Count = count; | ||
} | ||
|
||
public T* this[int index] | ||
{ | ||
get | ||
{ | ||
ArgumentOutOfRangeException.ThrowIfNegative(index); | ||
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, Count); | ||
Debug.Assert(array[index] != null); | ||
return array[index]; | ||
} | ||
} | ||
} | ||
} |