Стартовый пул

This commit is contained in:
2024-04-02 08:46:59 +03:00
parent fd57fffd3a
commit 3bb34d000b
5591 changed files with 3291734 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="9"/>
<General>
<Flags>
<SaveOnlyProjectUnits Value="True"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<StringTable ProductVersion=""/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Release" Default="True"/>
<Item2 Name="Debug">
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="../../../bin/$(TargetCPU)-$(TargetOS)/demo06"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir);../../../headers"/>
<OtherUnitFiles Value="../../../headers;../../../extra;../../../src;../../../lib/jpeg/$(TargetCPU)-$(TargetOS);../../../lib/msvcrt/$(TargetCPU);../../../lib/ogg/$(TargetCPU)-$(TargetOS);../../../lib/theora/$(TargetCPU)-$(TargetOS);../../../lib/zlib/$(TargetCPU)-$(TargetOS);../../../lib/zip/$(TargetCPU)-$(TargetOS)"/>
<UnitOutputDirectory Value="../tmp/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<Checks>
<IOChecks Value="True"/>
<RangeChecks Value="True"/>
<OverflowChecks Value="True"/>
<StackChecks Value="True"/>
</Checks>
<VerifyObjMethodCallValidity Value="True"/>
<Optimizations>
<OptimizationLevel Value="0"/>
</Optimizations>
</CodeGeneration>
<Linking>
<Debugging>
<UseHeaptrc Value="True"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<Verbosity>
<ShowNotes Value="False"/>
<ShowHints Value="False"/>
<ShowGenInfo Value="False"/>
</Verbosity>
</Other>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="1">
<Item1>
<PackageName Value="BGRABitmapPack4NoGUI"/>
</Item1>
</RequiredPackages>
<Units Count="1">
<Unit0>
<Filename Value="demo06.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="../../../bin/$(TargetCPU)-$(TargetOS)/demo06"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir);../../../headers"/>
<OtherUnitFiles Value="../../../headers;../../../extra;../../../src;../../../lib/jpeg/$(TargetCPU)-$(TargetOS);../../../lib/msvcrt/$(TargetCPU);../../../lib/ogg/$(TargetCPU)-$(TargetOS);../../../lib/theora/$(TargetCPU)-$(TargetOS);../../../lib/zlib/$(TargetCPU)-$(TargetOS);../../../lib/zip/$(TargetCPU)-$(TargetOS)"/>
<UnitOutputDirectory Value="../tmp/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<Optimizations>
<OptimizationLevel Value="3"/>
</Optimizations>
</CodeGeneration>
<Linking>
<Debugging>
<GenerateDebugInfo Value="False"/>
<UseLineInfoUnit Value="False"/>
<StripSymbols Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<Verbosity>
<ShowNotes Value="False"/>
<ShowHints Value="False"/>
<ShowGenInfo Value="False"/>
</Verbosity>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,135 @@
program demo06;
{$I zglCustomConfig.cfg}
{$IFDEF WINDOWS}
{$R *.res}
{$ENDIF}
uses
Classes,BGRAGraphics,
BGRABitmapTypes,
BGRAZenGL in '..\BGRAZenGL.pas',
{$IFDEF USE_ZENGL_STATIC}
zgl_main,
zgl_screen,
zgl_window,
zgl_timers,
zgl_keyboard,
zgl_render_2d,
zgl_fx,
zgl_primitives_2d,
zgl_math_2d,
zgl_utils
{$ELSE}
zglHeader
{$ENDIF}
;
var
dirRes : UTF8String {$IFNDEF MACOSX} = '../data/' {$ENDIF};
fntMain : IBGLFont;
procedure Init;
//var
// i : Integer;
begin
// RU: Загружаем данные о шрифте.
// EN: Load the font.
fntMain := BGLZenFont( dirRes + 'font.zfi' );
//fntMain.Clipped := true;
// RU: Если же текстуры именуются без использования маски вида "$(имя_шрифта)FontName-page$(номер).$(расширение)", то загрузку можно произвести следующим образом(для png):
// EN: If textures were named without special mask - "$(font_name)-page$(number).$(extension)", then use this method to load them(for png):
//for i := 0 to fntMain.Count.Pages - 1 do
// fntMain.Pages[ i ] := tex_LoadFromFile( dirRes + 'font-page' + u_IntToStr( i ) + '.png' );
end;
procedure Draw;
var
r : zglTRect;
s : UTF8String;
begin
batch2d_Begin();
// RU: ZenGL работает исключительно с кодировкой UTF-8, поэтому весь текст должен быть в UTF-8.
// EN: ZenGL works only with UTF-8 encoding, so all text should be encoded with UTF-8.
fntMain.TextOut(400, 25, 'String with center alignment', taCenter);
fntMain.Scale := 2;
fntMain.TextOut(400, 65, 'Scaling', taCenter);
fntMain.Scale := 1;
fntMain.SetGradientColors(CSSRed,CSSLime,CSSBlue,CSSWhite);
fntMain.TextOut( 400, 125, 'Gradient color for every symbol', taCenter);
fntMain.GradientColors := false;
r.X := 0;
r.Y := 300 - 128;
r.W := 192;
r.H := 256;
with r do fntMain.TextRect(X,Y,W,H, 'Simple text rendering in rectangle' );
pr2d_Rect( r.X, r.Y, r.W, r.H, $FF0000 );
r.X := 800 - 192;
r.Y := 300 - 128;
r.W := 192;
r.H := 256;
with r do fntMain.TextRect(X,Y,W,H, 'Text rendering using horizontal right alignment and vertical bottom alignment', taRightJustify, tlBottom);
pr2d_Rect( r.X, r.Y, r.W, r.H, $FF0000 );
r.X := 400 - 192;
r.Y := 300 - 128;
r.W := 384-200;
r.H := 256-190;
fntMain.Clipped:= true;
fntMain.Justify:= true;
with r do fntMain.TextRect(X,Y,W,H, 'This text uses justify alignment and centered vertically. Text which doesn''t fit inside the rectangle will be cropped.',
tlCenter);
fntMain.Justify:= false;
fntMain.Clipped:= false;
pr2d_Rect( r.X, r.Y, r.W, r.H, $FF0000 );
r.X := 400 - 320;
r.Y := 300 + 160;
r.W := 640;
r.H := 128;
with r do fntMain.TextRect(X,Y,W,H, 'For starting new line LF symbol can be used' + #10 + 'code of which is equal to 10 and named in Unicode as "Line Feed"',
taCenter, tlCenter);
pr2d_Rect( r.X, r.Y, r.W, r.H, $FF0000 );
// RU: Выводим количество FPS в правом углу
// EN: Render FPS in the top right corner
s := 'FPS: ' + u_IntToStr( zgl_Get( RENDER_FPS ) );
fntMain.TextOut(800,0, s, taRightJustify);
batch2d_End();
end;
procedure Timer;
begin
if key_Press( K_ESCAPE ) Then zgl_Exit();
key_ClearState();
end;
Begin
{$IFNDEF USE_ZENGL_STATIC}
if not zglLoad( libZenGL ) Then exit;
{$ENDIF}
randomize();
timer_Add( @Timer, 16 );
zgl_Reg( SYS_LOAD, @Init );
zgl_Reg( SYS_DRAW, @Draw );
wnd_SetCaption( '06 - Text' );
wnd_ShowCursor( TRUE );
scr_SetOptions( 800, 600, REFRESH_MAXIMUM, FALSE, FALSE );
zgl_Init();
End.

View File

@@ -0,0 +1,163 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<Version Value="9"/>
<General>
<Flags>
<SaveOnlyProjectUnits Value="True"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<StringTable ProductVersion=""/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Release" Default="True"/>
<Item2 Name="Debug">
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="../../../bin/demo06"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir);../../../headers"/>
<OtherUnitFiles Value="../../../headers;../../../extra;../../../src;../../../lib/jpeg/$(TargetCPU)-$(TargetOS);../../../lib/msvcrt/$(TargetCPU);../../../lib/ogg/$(TargetCPU)-$(TargetOS);../../../lib/theora/$(TargetCPU)-$(TargetOS);../../../lib/zlib/$(TargetCPU)-$(TargetOS);../../../lib/zip/$(TargetCPU)-$(TargetOS)"/>
<UnitOutputDirectory Value="../tmp/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<Checks>
<IOChecks Value="True"/>
<RangeChecks Value="True"/>
<OverflowChecks Value="True"/>
<StackChecks Value="True"/>
</Checks>
<VerifyObjMethodCallValidity Value="True"/>
<Optimizations>
<OptimizationLevel Value="0"/>
</Optimizations>
</CodeGeneration>
<Linking>
<Debugging>
<UseHeaptrc Value="True"/>
</Debugging>
<Options>
<PassLinkerOptions Value="True"/>
<LinkerOptions Value="-macosx_version_min 10.4"/>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<Verbosity>
<ShowNotes Value="False"/>
<ShowHints Value="False"/>
<ShowGenInfo Value="False"/>
</Verbosity>
<CompilerMessages>
<UseMsgFile Value="True"/>
</CompilerMessages>
<CompilerPath Value="$(CompPath)"/>
<ExecuteAfter>
<Command Value="sh macosx_postbuild.sh"/>
</ExecuteAfter>
</Other>
</CompilerOptions>
</Item2>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<Units Count="1">
<Unit0>
<Filename Value="demo06.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="demo06"/>
</Unit0>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="../../../bin/demo06"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir);../../../headers"/>
<OtherUnitFiles Value="../../../headers;../../../extra;../../../src;../../../lib/jpeg/$(TargetCPU)-$(TargetOS);../../../lib/msvcrt/$(TargetCPU);../../../lib/ogg/$(TargetCPU)-$(TargetOS);../../../lib/theora/$(TargetCPU)-$(TargetOS);../../../lib/zlib/$(TargetCPU)-$(TargetOS);../../../lib/zip/$(TargetCPU)-$(TargetOS)"/>
<UnitOutputDirectory Value="../tmp/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<Optimizations>
<OptimizationLevel Value="3"/>
</Optimizations>
</CodeGeneration>
<Linking>
<Debugging>
<GenerateDebugInfo Value="False"/>
<UseLineInfoUnit Value="False"/>
<StripSymbols Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
<Options>
<PassLinkerOptions Value="True"/>
<LinkerOptions Value="-macosx_version_min 10.4"/>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<Verbosity>
<ShowNotes Value="False"/>
<ShowHints Value="False"/>
<ShowGenInfo Value="False"/>
</Verbosity>
<CompilerMessages>
<UseMsgFile Value="True"/>
</CompilerMessages>
<CompilerPath Value="$(CompPath)"/>
<ExecuteAfter>
<Command Value="sh macosx_postbuild.sh"/>
</ExecuteAfter>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>demo06</string>
<key>CFBundleIconFile</key>
<string>demo06</string>
<key>CFBundleName</key>
<string>demo06</string>
<key>CFBundleIdentifier</key>
<string>zengl.demo06</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>demo</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
</plist>

View File

@@ -0,0 +1,8 @@
# copy resources
cp ../../../bin/data/font* ../../../bin/demo06.app/Contents/Resources/
# copy binary into bundle
rm ../../../bin/demo06.app/Contents/MacOS/demo06
cp ../../../bin/demo06 ../../../bin/demo06.app/Contents/MacOS/demo06
# make Info.plist and copy icon
cp -f demo06_macosx.plist ../../../bin/demo06.app/Contents/Info.plist
cp ../../../bin/data/zengl.icns ../../../bin/demo06.app/Contents/Resources/demo06.icns