Browse Source
* Nearest (default) and linear filtering are supported. * Scaling is done by SDL, naturally. *** WE'RE BACK, BABY! ***improved_timing
Ian Burgmyer
5 years ago
4 changed files with 91 additions and 6 deletions
@ -0,0 +1,16 @@
|
||||
namespace DotSDL.Graphics { |
||||
/// <summary> |
||||
/// The scaling (filtering) style that should be used for the application.</summary> |
||||
public enum ScalingQuality { |
||||
/// <summary> |
||||
/// Nearest pixel sampling. This should be used if crisp, square pixels are desired. |
||||
/// </summary> |
||||
Nearest = 0, |
||||
|
||||
/// <summary> |
||||
/// Linear filtering. This will filter the surrounding pixels together, resulting |
||||
/// in a blurrier look. |
||||
/// </summary> |
||||
Linear = 1 |
||||
} |
||||
} |
@ -0,0 +1,34 @@
|
||||
using System.Runtime.InteropServices; |
||||
|
||||
namespace DotSDL.Interop.Core { |
||||
internal static class Hints { |
||||
/// <summary> |
||||
/// Represents a variable controlling the scaling quality. This variable can be set |
||||
/// to one of the following values: |
||||
/// |
||||
/// "0" or "nearest" - Nearest pixel sampling. |
||||
/// "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D) |
||||
/// "2" or "best" - Anisotropic filtering (supported by Direct3D) |
||||
/// |
||||
/// By default, nearest pixel sampling is used. |
||||
/// </summary> |
||||
internal const string RenderScaleQuality = "SDL_RENDER_SCALE_QUALITY"; |
||||
|
||||
/// <summary> |
||||
/// Gets the value of a hint. |
||||
/// </summary> |
||||
/// <param name="name">The name of the hint to set.</param> |
||||
/// <returns><c>true</c> if the hint was set, otherwise <c>false</c>.</returns> |
||||
[DllImport(Meta.CoreLib, EntryPoint = "SDL_SetHint", CallingConvention = CallingConvention.Cdecl)] |
||||
internal static extern string GetHint(string name); |
||||
|
||||
/// <summary> |
||||
/// Sets a hint with normal priority. |
||||
/// </summary> |
||||
/// <param name="name">The name of the hint to set.</param> |
||||
/// <param name="value">The value to set the hint to.</param> |
||||
/// <returns><c>true</c> if the hint was set, otherwise <c>false</c>.</returns> |
||||
[DllImport(Meta.CoreLib, EntryPoint = "SDL_SetHint", CallingConvention = CallingConvention.Cdecl)] |
||||
internal static extern bool SetHint(string name, string value); |
||||
} |
||||
} |
Loading…
Reference in new issue