Skip to content

Commit 0e24c14

Browse files
committed
Use type aliases instead of enumerations for C enums
1 parent e682561 commit 0e24c14

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

units/sdlrenderer.inc

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,23 @@ type
3636
tex_coord: TSDL_FPoint;
3737
end;
3838

39+
{**
40+
* The scaling mode for a texture.
41+
*}
3942
PSDL_ScaleMode = ^TSDL_ScaleMode;
40-
TSDL_ScaleMode = (
41-
SDL_ScaleModeNearest,
42-
SDL_ScaleModeLinear,
43-
SDL_ScaleModeBest
44-
);
43+
TSDL_ScaleMode = type cint;
44+
45+
const
46+
SDL_ScaleModeNearest = TSDL_ScaleMode(0); {**< nearest pixel sampling *}
47+
SDL_ScaleModeLinear = TSDL_ScaleMode(1); {**< linear filtering *}
48+
SDL_ScaleModeBest = TSDL_ScaleMode(2); {**< anisotropic filtering *}
4549

4650
{**
4751
* The access pattern allowed for a texture.
4852
*}
4953
type
5054
PSDL_TextureAccess = ^TSDL_TextureAccess;
51-
TSDL_TextureAccess = cint32;
55+
TSDL_TextureAccess = type cint;
5256

5357
const
5458
SDL_TEXTUREACCESS_STATIC = 0; {**< Changes rarely, not lockable *}
@@ -60,11 +64,12 @@ type
6064
* The texture channel modulation used in SDL_RenderCopy().
6165
*}
6266
PSDL_TextureModulate = ^TSDL_TextureModulate;
63-
TSDL_TextureModulate = (
64-
SDL_TEXTUREMODULATE_NONE, {**< No modulation *}
65-
SDL_TEXTUREMODULATE_COLOR, {**< srcC = srcC * color *}
66-
SDL_TEXTUREMODULATE_ALPHA {**< srcA = srcA * alpha *}
67-
);
67+
TSDL_TextureModulate = type cint;
68+
69+
const
70+
SDL_TEXTUREMODULATE_NONE = TSDL_TextureModulate(0); {**< No modulation *}
71+
SDL_TEXTUREMODULATE_COLOR = TSDL_TextureModulate(1); {**< srcC = srcC * color *}
72+
SDL_TEXTUREMODULATE_ALPHA = TSDL_TextureModulate(2); {**< srcA = srcA * alpha *}
6873

6974
{**
7075
* Flip constants for SDL_RenderCopyEx

0 commit comments

Comments
 (0)