/
vuvk
/
ws3d_pascal
Обзор
Документация
Войти
/
vuvk
/
ws3d_pascal
Код
Запросы
0
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
FreePascal/Examples/01_HelloWorld.pas
74 строки
2 KB
Anton Vuvk
Initial commit v0.5.0
05 ноя 2018, 08:47
05 ноя 2018, 08:47
1ccdc16
Код
Авторство
О чём код?
// ---------------------------------------------------------------------------- // ������ ������ Vuvk // ����������� Nikolas (WorldSim3D developer) // ---------------------------------------------------------------------------- // ������ 01: Hello World // ���� ������� ������ ��������� ���� WorldSim3D, ���������� ����� Hello World // �� ������ � ������� ����� ������������ ������� ����������. // ---------------------------------------------------------------------------- program p01_HelloWorld; {Attach modules} uses SysUtils, WorldSim3D, SampleFunctions; {Declare variables} var MyFont : wFont=nil; sceneColor:wColor4s=(alpha:255;red:0;green:125;blue:0); fromPos:wVector2i=(x:120; y:80); toPos:wVector2i=(x:250; y:96); wndCaption:PWChar='Example 1: Hello World fps: '; prevFPS:Int32=0; fontPath:PChar='../../Assets/Fonts/Cyr.xml'; begin {Start engine} if not wEngineStart(wDRT_OPENGL,wDEFAULT_SCREENSIZE,32,false,true,true,false) then Halt; {Check resources} CheckFilePath(fontPath); {Load resources} MyFont:=wFontLoad(fontPath); {Show engine logo} wEngineShowLogo(true); {Main loop} while wEngineRunning() do begin wSceneBegin(sceneColor); {Draw text} fromPos.y:=80; toPos.y:=96; wFontDraw(MyFont,'Hello, World!',fromPos,toPos,wCOLOR4s_WHITE); fromPos.y+=30; toPos.y+=30; wFontDraw(MyFont,WStr('������, ���!'),fromPos,toPos,wCOLOR4s_WHITE); wSceneEnd(); wEngineCloseByEsc(); {Update fps} if prevFPS<>wEngineGetFPS() then begin prevFPS:=wEngineGetFPS(); wWindowSetCaption(wndCaption+WStr(FormatFloat('0',prevFPS))); end; end; {Stop engine} wEngineStop(true); end.