Skip to content

Commit c77d8a8

Browse files
Merge pull request #2 from Free-Pascal-meets-SDL-Website/add-sdl3-init-log-version-revision
Add SDL3.pas, four inc-files and a test
2 parents 0b28d7b + 759bd81 commit c77d8a8

File tree

8 files changed

+3360
-0
lines changed

8 files changed

+3360
-0
lines changed

tests/testver.pas

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
This file is part of:
3+
4+
SDL3 for Pascal
5+
(https://github.com/PascalGameDevelopment/SDL3-for-Pascal)
6+
SPDX-License-Identifier: Zlib
7+
}
8+
9+
{ Test is based on testver.c }
10+
11+
program testver;
12+
13+
uses
14+
SDL3, SysUtils;
15+
16+
var
17+
version: Integer;
18+
19+
begin
20+
if SDL_VERSION_ATLEAST(3, 0, 0) then
21+
SDL_Log('Compiled with SDL 3.0 or newer')
22+
else
23+
SDL_Log('Compiled with SDL older than 3.0');
24+
25+
SDL_Log(PChar(Format('Compiled version: %d.%d.%d (%s)',[
26+
SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_MICRO_VERSION,
27+
SDL_REVISION])));
28+
version := SDL_GetVersion();
29+
SDL_Log(PChar(Format('Runtime version: %d.%d.%d (%s)',
30+
[SDL_VERSIONNUM_MAJOR(version), SDL_VERSIONNUM_MINOR(version), SDL_VERSIONNUM_MICRO(version),
31+
SDL_GetRevision()])));
32+
SDL_Quit();
33+
end.
34+

units/SDL_init.inc

Lines changed: 363 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)