https://wiki.freepascal.org/api.php?action=feedcontributions&user=Seenkao&feedformat=atomLazarus wiki - User contributions [en]2024-03-28T10:00:33ZUser contributionsMediaWiki 1.35.6https://wiki.freepascal.org/index.php?title=Game_Engine&diff=157398Game Engine2023-09-30T21:47:58Z<p>Seenkao: /* Game Engines */</p>
<hr />
<div>{{Game_Engine}}<br />
{{Menu_Game_Development}}<br />
<br />
A '''game engine''' is a software development environment designed to create [[Games|games]]. It distinguish from [[Game framework|game libraries]] in that:<br />
* Implements the ''game loop'', resource managers and other complex subsystems as networking communications, user interfaces and configuration systems.<br />
* Implements complex data structures, such as maps, particle systems and actors.<br />
* Implements tools as editors and data managers.<br />
All these subsystems would affect in gameplay aspects as movement, scoring or even genre. You can read this [http://en.wikipedia.org/wiki/Game_engine Wikipedia page] for more information.<br />
<br />
== Game Engines ==<br />
Here's a list of game engines that are Pascal/Delphi based or have Pascal binding libraries.<br />
<br />
{| class="wikitable sortable" width="100%"<br />
! Name <br />
! Site <br />
! Usage<br />
! Notes<br />
|-<br />
| [[Castle Game Engine]] <br />
| [https://castle-engine.io/ castle-engine.io] <br />
| FPC/Delphi<br />
| 2D & 3D, all platforms supported<br />
|-<br />
| Quad-Engine<br />
| [https://github.com/dillanspencer/Quad-Engine GitHub]<br />
| Delphi/FPC/C#/C++<br />
| Using Java 8 internal libraries, it is specifically designed for 2D games (no support for 3D), and proposes a set of functions for 2D resources management (images, sprites, animations, tiles...). Inputs and outputs are also available, with an easy keys retrieval, mouse movement... Management of music file is also available (Wav, Midi). Windowed and fullscreen are fully supported, with a complete frame rate control.<br />
|-<br />
| TERRA Game Engine <br />
| [https://github.com/Relfos/TERRA-Engine GitHub]<br />
| Delphi/FPC/Oxygene<br />
| 2D & 3D, all platforms supported<br />
|-<br />
| [http://www.tilengine.org Tilengine]<br />
| [https://github.com/turric4n/PascalTileEngine GitHub]<br />
| FPC/Delphi OOP Pascal Wrapper and bindings<br />
| Cross-platform 2D graphics engine for creating classic/retro games with tilemaps, sprites and palettes. Last update May 2020.<br />
|-<br />
| [[nxPascal]]<br />
| [https://github.com/Zaflis/nxpascal GitHub]<br />
| FPC/Delphi<br />
| For now only OpenGL is supported. No android or other mobile support yet.<br />
|-<br />
| g2mp<br />
| [https://github.com/MrDan2345/g2mp GitHub]<br />
| FPC<br />
| Ideologically replaced Dan Jet X, multiplatform, editor- and code-based development <br />
|-<br />
| Andorra 2D<br />
| [http://andorra.sourceforge.net/ SourceForge]<br />
| Delphi<br />
| Last update 2008<br />
|-<br />
| CAST II Game Engine<br />
| [http://www.casteng.com/ www.casteng.com]<br />
| Delphi<br />
| Alive? last update 2011<br />
|-<br />
| Delphi X <br />
| [http://www.micrel.cz/Dx/ www.micrel.cz/Dx]<br />
| Delphi<br />
|<br />
|-<br />
| Afterwarp<br />
| [http://www.afterwarp.net/ www.afterwarp.net]<br />
| FPC/Delphi<br />
| <br />
|-<br />
| Brtech1<br />
| [http://www.pascalgamedevelopment.com/showthread.php?13795-Brtech1 PascalGameDevelopment.com]<br />
| FPC<br />
| Not really available as an engine or library. Many videos can be found on youtube though. <br />
|-<br />
| GameMaker: Studio<br />
| [http://www.yoyogames.com/ www.yoyogames.com] <br />
| N/A <br />
| Yes, it's not really a game engine library. But it's a game engine and studio written originally in Delphi. Special Pascal proud. <br />
|-<br />
| MinGRo<br />
| [https://www.sf.net/p/mingro SourceForge]<br />
| FPC<br />
| Designed for old-school style games. Still work in progress. Build with [[FPC_and_Allegro|Allegro.pas]].<br />
|-<br />
| ZGameEditor<br />
| [http://www.zgameeditor.org/ www.zgameeditor.org] <br />
| FPC/Delphi<br />
| use OpenGL for graphics and a real time synthesizer for audio<br />
|-<br />
| SO Engine<br />
| [https://github.com/dimsa/ShadowEngine GitHub] <br />
| Delphi/FMX<br />
| Small Crossplatform (Win, Android, iOs) indy engine with formatters, animations, intersections and etc.<br />
|-<br />
| DGLE<br />
| [https://github.com/DGLE-HQ/DGLE GitHub] <br />
| Delphi/FPC/C#/C++<br />
| Powerful free open source cross-platform game engine.<br />
|-<br />
| raylib<br />
| [https://github.com/tazdij/raylib-pas GitHub] <br />
| FPC<br />
| A simple and easy-to-use raylib library<br />
|-<br />
| PGF<br />
| [https://github.com/GuvaCode/PGF GitHub] <br />
| FPC/Lazarus<br />
| The Phoenix Game Framework is a set of classes for helping in the creation of 2D and 3D games in pascal.<br />
|-<br />
| ZenGL<br />
| source code [https://code.google.com/archive/p/zengl/ ZenGL before version 3.12][https://sourceforge.net/projects/new-zengl/ ZenGL 4.2 and higher]<br />
| FPC/Lazarus/Delphi<br />
| Cross-platform game development library written in Pascal.<br />
|-<br />
| Apus Game Engine<br />
| [https://github.com/Cooler2/ApusGameEngine GitHub]<br />
| FPC/Delphi<br />
| 2D (with some 3D effects) engine<br />
|-<br />
| Ray4Laz<br />
| [https://github.com/GuvaCode/Ray4Laz GitHub]<br />
| FPC/Lazarus<br />
| is a simple and easy-to-use library to enjoy videogames programming<br />
|}<br />
<br />
==Physics Engines==<br />
These engines simulate the physical world (collisions, trajectories etc). Not really game engines per se, but could certainly be used in games.<br />
{| class="wikitable sortable" width="100%"<br />
! Name <br />
! Site <br />
! Usage<br />
! Notes<br />
|-<br />
| TundAx<br />
| [https://github.com/JordiCorbilla/thundax-delphi-physics-engine GitHub]<br />
| FPC/Delphi<br />
| <br />
|-<br />
| Newton<br />
| [http://www.saschawillems.de/ www.saschawillems.de]<br />
| [http://www.saschawillems.de/?page_id=76 Bindings]<br />
| <br />
|-<br />
| Box2D-Delphi<br />
| [https://sourceforge.net/projects/box2d-delphi/ SourceForge] <br />
| FPC/Delphi<br />
| This is Delphi implementation of [https://github.com/erincatto/Box2D Box2D] library.<br />
|-<br />
| Kraft<br />
| [https://github.com/BeRo1985/kraft GitHub]<br />
| FPC/Delphi<br />
| Pascal native physics engine by Benjamin Rosseaux.<br />
|}</div>Seenkaohttps://wiki.freepascal.org/index.php?title=Game_Engine/fr&diff=157397Game Engine/fr2023-09-30T21:46:26Z<p>Seenkao: /* Moteurs de jeu */</p>
<hr />
<div>{{Game_Engine}}<br />
<br />
== Vue d'ensemble ==<br />
Un moteur de jeu est une bibliotèque qui simplifie la création de jeu. Cela peut inclure tout ou partie des fonctionnalités suivantes :<br />
* création d'enveloppes (wrappers) sur des interfaces de systèmes comme des API graphiques.<br />
* des contrôles utilisateurs d'entrée et audio (SDL, ZenGL).<br />
* Ajout d'interfaces supplémentaires pour créer et contrôler l'environnement de contenu du jeu (comme p.ex. fait par le moteur de jeu Castle).<br />
<br />
[https://fr.wikipedia.org/wiki/Moteur_de_jeu vous pouvez en savoir plus ici]<br />
<br />
== Moteurs de jeu ==<br />
Voici une liste de moteurs de jeu basés sur Pascal/Delphi ou qui des bibliothèques de liaison (binding libraries) Pascal.<br />
<br />
{| class="wikitable sortable" width="100%"<br />
! Nom<br />
! Site <br />
! Usage<br />
! Notes<br />
|-<br />
| [[FPC et SDL|SDL]]<br />
| [http://www.libsdl.org www.libsdl.org] <br />
| Liaisons<br />
| <br />
|-<br />
| [[SDL2]]<br />
| [http://sourceforge.net/projects/sdl2fpc/?source=directory sdl-2-for-free-pascal-compiler] <br />
| FPC<br />
| <br />
|-<br />
| SMFL<br />
| [http://www.sfml-dev.org/index-fr.php http://www.sfml-dev.org/index-fr.php] <br />
| [https://github.com/CWBudde/PasSFML Liaisons]<br />
| <br />
|-<br />
| [[GLScene/fr|GLScene]]<br />
| [http://glscene.sourceforge.net/ sourceforge.net] <br />
| FPC/Delphi<br />
| Ce n'est pas réellement un moteur de jeu, mais plutôt un moteur de rendu 3D.<br />
|-<br />
| [[Castle Game Engine/fr|Castle Game Engine]] <br />
| [http://castle-engine.sourceforge.net/ sourceforge.net] <br />
| FPC<br />
|<br />
|-<br />
| [[ZenGL/fr|ZenGL]]<br />
| source code [https://code.google.com/archive/p/zengl/ ZenGL before version 3.12][https://sourceforge.net/projects/new-zengl/ ZenGL 4.2 and higher]<br />
| FPC/Delphi<br />
|<br />
|-<br />
| Quad-Engine<br />
| [http://quad-engine.com/ quad-engine.com] <br />
| Delphi/FPC/C#/C++<br />
| <br />
|-<br />
| TERRA Game Engine <br />
| [https://github.com/Relfos/TERRA-Engine github.com/Relfos/TERRA-Engine]<br />
| Delphi/FPC/Oxygene<br />
| 2D & 3D, toutes les plates-formes sont supportées<br />
|-<br />
| [[nxPascal/fr|nxPascal]]<br />
| [https://github.com/Zaflis/nxpascal github.com]<br />
| FPC/Delphi<br />
|<br />
|-<br />
| g2mp<br />
| [https://github.com/MrDan2345/g2mp github.com]<br />
| FPC<br />
| Idéologiqement, remplace Dan Jet X, multi plate-forme, éditeur et développement basé sur le code.<br />
|-<br />
| Andorra 2D<br />
| [http://andorra.sourceforge.net/ sourceforge.net]<br />
| Delphi<br />
| <br />
|-<br />
| CAST II Game Engine<br />
| [http://www.casteng.com/ http://www.casteng.com/]<br />
| Delphi<br />
| Toujours en vie ? dernière mise à jour 2011<br />
|-<br />
| Delphi X <br />
| [http://www.micrel.cz/Dx/ www.micrel.cz/Dx]<br />
| Delphi<br />
|<br />
|-<br />
| Afterwarp<br />
| [http://www.afterwarp.net/ www.afterwarp.net]<br />
| FPC/Delphi<br />
| <br />
|-<br />
| [[FPC_and_Allegro|Allegro]]<br />
| [http://alleg.sourceforge.net/ sourceforge.net]<br />
| [http://allegro-pas.sourceforge.net/ Liaisons Allegro-pas]<br />
|<br />
|-<br />
| Phoenix<br />
| [https://code.google.com/p/phoenixlib/ code.google.com]<br />
| FPC/Delphi<br />
|<br />
|-<br />
| Brtech1<br />
| [http://www.pascalgamedevelopment.com/showthread.php?13795-Brtech1 PascalGameDevelopment.com]<br />
| FPC<br />
| Pas vraiment disponible comme moteur ou bibliothèque. De nombreuses vidéos peuvent être trouvées sur Youtube.<br />
|-<br />
| GameMaker: Studio<br />
| [http://www.yoyogames.com/ www.yoyogames.com] <br />
| N/A <br />
| Oui, ce n'est pas vraiment une bibliotèque de moteur de jeu. Mais c'est un moteur de jeu et un studio écrit en Delphi.<br />
|-<br />
| ZGameEditor<br />
| [http://www.zgameeditor.org/ www.zgameeditor.org] <br />
| FPC/Delphi<br />
| <br />
|-<br />
| SO Engine<br />
| [https://github.com/dimsa/ShadowEngine github.com] <br />
| Delphi/FMX<br />
| Petit moteur indy multi plate-forme (Win, Android, iOs) avec des formatteurs des animations, des intersections, etc.<br />
|}<br />
<br />
==Jeux portés en Pascal==<br />
Cette liste contient des jeux et des bibliotèques portés. Les licences varient.<br />
{| class="wikitable sortable" width="100%"<br />
! Nom <br />
! Site <br />
! Usage<br />
! Notes<br />
|-<br />
| Delphi Doom<br />
| [http://sourceforge.net/projects/delphidoom/ Delphi Doom]<br />
| Delphi<br />
| Ressentez de la nostalgie :)<br />
|- <br />
| Quake vers Delphi<br />
| [http://sourceforge.net/projects/delphiquake/ Sourceforge] <br />
[http://www.geocities.ws/jimmyvalavanis/applications/delphiquake.html Ancienne version]<br />
| Delphi<br />
| Sourceforge est actif. Les anciens sites semblent être morts maintenant. Bien que le code source puisse être toujours téléchargeable.<br />
|-<br />
| Quake II Delphi (Quake 2 Delphi)<br />
| [http://www.sulaco.co.za/quake2/default.asp www.sulaco.co.za] [http://sourceforge.net/projects/quake2delphi/ sourceforge.net]<br />
| Delphi<br />
| <br />
|-<br />
| Civilization 2<br />
| [http://www.c-evo.org/ www.c-evo.org]<br />
| Delphi<br />
| Il a été repéré sur [http://forum.lazarus.freepascal.org/index.php/topic,7914.0.html le forum] de retour en 2009. Le moteur n'est pas le moteur original Civilization II. Bien que les ressources graphiques soient différentes, c'est un bon moteur TBS.<br />
|}<br />
<br />
==Jeux==<br />
Jeux écrits avec Free Pascal. Actuellement, ce sont des projets commerciaux, en sources ouverts ou fermés. D'autres en plus [[Projects_using_Lazarus#Games|ici]].<br />
<br />
{| class="wikitable sortable" width="100%"<br />
! Nom<br />
! Site <br />
! Open Source<br />
! Notes<br />
|- <br />
| Darkest Before the Dawn<br />
| http://castle-engine.sourceforge.net/darkest_before_dawn.php [https://play.google.com/store/apps/details?id=net.sourceforge.castleengine.darkestbeforedawn Google Play (Android version)]<br />
| {{Yes}}<br />
| Utilise Castle Game Engine<br />
|- <br />
| Castle<br />
| http://castle-engine.sourceforge.net/castle.php<br />
| {{Yes}}<br />
| Utilise Castle Game Engine<br />
|- <br />
| Diablo Roguelike<br />
| [http://diablo.chaosforge.org/ doom.chaosforge.org] [http://sourceforge.net/projects/diablorl/ Sourceforge.net]<br />
| {{Yes}}<br />
|<br />
|- <br />
| Doom Roguelike<br />
| [http://doom.chaosforge.org/ doom.chaosforge.org]<br />
| {{No}}<br />
|<br />
|- <br />
| Escape from the Universe<br />
| https://play.google.com/store/apps/details?id=com.catastrophe.games.escape.universe.space.shooter<br />
| {{No}}<br />
| Utilise Castle Game Engine<br />
|-<br />
| HedgeWars<br />
| [http://www.hedgewars.org/ www.hedgewars.org]<br />
| {{Yes}}<br />
| <br />
|- <br />
| Project "W"<br />
| [http://www.pascalgamedevelopment.com/showthread.php?3594-Projekt-quot-W-quot PascalGameDevelopment.com ]<br />
| {{No}}<br />
|<br />
|- <br />
| Scrabble 3D<br />
| [http://sourceforge.net/projects/scrabble/ sourceforge.net]<br />
| {{Yes}}<br />
|<br />
|- <br />
| UltraStar Deluxe<br />
| [http://sourceforge.net/projects/ultrastardx/ sourceforge.net]<br />
| {{Yes}}<br />
|<br />
|- <br />
| Minimon 3D<br />
| [http://www.minimon3d.com http://www.minimon3d.com]<br />
| {{No}}<br />
|<br />
|- <br />
| Mountains of Fire<br />
| http://castle-engine.sourceforge.net/mountains_of_fire.php<br />
| {{Yes}}<br />
| Utilise Castle Game Engine<br />
|- <br />
| Shu<br />
| [http://sourceforge.net/projects/rr-rr sourceforge.net]<br />
| {{Yes}}<br />
| RPG d'apparence intéressante - en cours<br />
|- <br />
| Project Helena<br />
| [https://sourceforge.net/projects/projecthelena/ sourceforge.net]<br />
| {{Yes}}<br />
| Un jeu d'Eugene Loza<br />
|- <br />
| Asteroids vs You<br />
| [https://github.com/dimsa/ShadowEngine/ github.com], [https://play.google.com/store/apps/details?id=com.ShadowEngine.AsteroidsVsYou Google Play (Android version)]<br />
| {{Yes}}<br />
| Jeu de démo Open Source pour le moteur SO.<br />
|}<br />
<br />
==Moteurs physiques==<br />
Ces moteurs simule le monde réel (collisions, trajectoires, etc). Ce ne sont pas réellement des moteurs de jeux en eux-mêmes, mais peuvent être employés dans les jeux.<br />
{| class="wikitable sortable" width="100%"<br />
! Nom<br />
! Site <br />
! Usage<br />
! Notes<br />
|-<br />
| TundAx<br />
| [https://github.com/JordiCorbilla/thundax-delphi-physics-engine github.com]<br />
| FPC/Delphi<br />
| <br />
|-<br />
| Newton<br />
| [http://www.saschawillems.de/ www.saschawillems.de]<br />
| [http://www.saschawillems.de/?page_id=76 Bindings]<br />
| <br />
|-<br />
| Box2D-Delphi<br />
| [https://code.google.com/p/box2d-delphi/ code.google.com] <br />
| FPC/Delphi<br />
| C'est l'implémentation Delphi de la bibliothèque [http://code.google.com/p/box2d/ Box2d].<br />
|-<br />
| Kraft<br />
| [https://github.com/BeRo1985/kraft github.com]<br />
| FPC/Delphi<br />
| Moteur physique nativement en Pascal par Benjamin Rosseaux.<br />
|-<br />
| PAPPE - PAscal Powerful Physics Engine<br />
| [https://sourceforge.net/projects/pappe/ sourceforge.net]<br />
| FPC/Delphi<br />
| Moteur physique nativement en Pascal par Benjamin Rosseaux. A été rendu obsolète par Kraft<br />
|}</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL&diff=157396ZenGL2023-09-30T21:41:37Z<p>Seenkao: /* In the updated version */</p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index}}<br />
<br />
== About ==<br />
<br />
'''ZenGL''' - a cross-platform game development library, designed to provide necessary functionality for rendering 2D graphics, handling input, sound output, etc.<br />
<br />
*'''Supported OS''': GNU/Linux, Windows, macOS, iOS, Android 2.1+<br />
<br />
*'''Supported compilers''': [[Free Pascal]], [[Delphi]]<br />
<br />
*'''Graphics API''': [[OpenGL]], OpenGL ES 1.x, Direct3D 8/9<br />
<br />
*'''Sound API''': OpenAL, DirectSound<br />
<br />
*'''License''': zlib<br />
<br />
*'''Authors''': Andrey "Andru" Kemka, Sergey "Seenkao" Shutkin<br />
<br />
== Links ==<br />
<br />
*[https://code.google.com/archive/p/zengl/ Download ZenGL before version 3.12]<br />
*[https://github.com/skalogryz/zengl ZenGL Mirror on GitHub]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
---<br />
*[https://github.com/Seenkao/New-ZenGL ZenGL up to version 4.2 (version 4.2 has been archived and not tested, see version on SourceForge)]<br />
*[https://sourceforge.net/projects/new-zengl/ SourceForge - ZenGL 4.2 and higher source code]<br />
<br />
== Tutorial ==<br />
<br />
'''Attention!''' All examples are contained in the downloaded version of the library. At this time, this is relevant for all versions of ZenGL.<br />
These tutorials are not fully compatible with the latest version of ZenGL.<br />
<br />
[[ZenGL Tutorial]]: This is a first tutorial for ZenGL: download, installation, source paths, compilation (statically or with so/dll/dylib) (Windows dll), and the First program 'Initialization' that comes with ZenGL.<br />
<br />
[[ZenGL Tutorial 2]]: This is the second tutorial on how to create a font and draw text in the window.<br />
<br />
== Features ==<br />
<br />
* '''Main'''<br />
o can be used as so/dll/dylib or statically compiled with your application <br />
o rendering to own or any other prepared window<br />
o logging<br />
o resource loading from files, memory and '''zip''' archives<br />
o multithreaded resource loading<br />
o easy way to add support for new resource format<br />
* '''Configuration of'''<br />
o antialiasing, screen resolution, refresh rate and vertical synchronization<br />
o aspect correction<br />
o title, position and size of window<br />
o cursor visibility in window space<br />
* '''Input'''<br />
o handling of keyboard, mouse and joystick input<br />
o handling of Unicode text input<br />
o possibility to restrict the input to the Latin alphabet<br />
* '''Textures'''<br />
o supports '''tga''', '''png''', '''jpg''' and '''pvr'''<br />
o correct work with NPOT textures<br />
o control the filter parameters<br />
o masking<br />
o ''render targets'' for rendering into texture<br />
* '''Text'''<br />
o textured Unicode font<br />
o rendering UTF-8 text<br />
o rendering text with alignment and other options like size, color and count of symbols<br />
* '''2D subsystem'''<br />
o ''batch render'' for high-speed rendering<br />
o rendering different primitives<br />
o sprite engine<br />
o rendering static and animated sprites and tiles<br />
o rendering distortion grid<br />
o rendering sprites with new texture coordinates (with the pixel dimension and the usual 0..1)<br />
o control the blend mode and color mix mode<br />
o control the color and alpha of vertices of sprites and primitives<br />
o additional sprite transformations (flipping, zooming, vertices offset)<br />
o fast clipping of invisible sprites<br />
o 2D camera with ability to zoom and rotate the scene<br />
* '''Sound'''<br />
o works through OpenAL or DirectSound; depends on configuration or OS<br />
o correct work without soundcard<br />
o supports '''wav''' and '''ogg''' as sound sample formats<br />
o playing audio files in separate thread<br />
o control volume and playback speed<br />
o moving sound sources in 3D space<br />
* '''Video'''<br />
o decoding video frames into texture<br />
o supports '''theora''' codec in '''ogv''' container<br />
* '''Math'''<br />
o basic set of additional math functions<br />
o triangulation functions<br />
o basic set of collision functions<br />
* '''Additional'''<br />
o reading and writing INI files<br />
o functions for working with files and memory<br />
<br />
== In the updated version ==<br />
<br />
'''Attention!''' Basic information in Russian! Thank you for understanding.<br />
* Corrected compilation for android for FPC 3.2.0 and higher.<br />
* Moved the main code to correct the library<br />
* Edited work with Windows 64<br />
* Fixed minor bugs<br />
* Edited some demo versions (for FPC and iOS demos were not corrected, demo versions for Lazarus and Delphi were revised)<br />
* Introduced defines<br />
** define USE_EXIT_ESCAPE - exit. Ability not to write additional code to exit the program by pressing the Escape key<br />
** USE_INIT_HANDLE definition - for using ZenGL in an already created window (LCL/VCL)<br />
* Introduced support for MacOS Cocoa<br />
<br />
Documentation is maintained inside ZenGL modules in Russian and English.<br />
<br />
Also see the updates in the file ''Update _ZenGL.txt'' (in Russian).<br />
<br />
[[Category:Components]]<br />
[[Category:Graphics]]<br />
[[Category:Audio]]<br />
[[Category:Multimedia]]<br />
[[Category:Video]]<br />
[[Category:Game Development]]<br />
[[Category:Games]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/de&diff=157395ZenGL/de2023-09-30T21:39:47Z<p>Seenkao: /* Allgemein */</p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index}}<br />
<br />
== Allgemein ==<br />
ZenGL ist eine plattformübergreifende Game-Library und wurde entworfen, um notwendige Funktionen wie 2D-Grafiken, Ein- und Ausgabebehandlung, Sound, etc. bereitzustellen.<br />
<br />
'''Unterstützte Betriebssysteme''': GNU/Linux, Windows, macOS, iOS*, Android 2.1+*<br><br />
'''Unterstützte Compiler''': FreePascal, Delphi<br><br />
'''Graphik API''': OpenGL, OpenGL ES 1.x*, Direct3D 8/9<br><br />
'''Sound API''': OpenAL, DirectSound<br><br />
'''Lizenz''': zlib<br />
<br />
Die Bibliothek wird zu diesem Zeitpunkt weiterentwickelt.<br />
<br />
== Links ==<br />
<br />
*[https://code.google.com/archive/p/zengl/ Download ZenGL]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL Bis Version 4.2 (Version 4.2 wurde archiviert und nicht getestet, siehe Version auf SourceForge)]<br />
*[https://sourceforge.net/projects/new-zengl/ SourceForge - ZenGL 4.2 und höher Quellcode]<br />
<br />
== Tutorial ==<br />
<br />
'''Beachtung!''' Alle Beispiele sind in der heruntergeladenen Version der Bibliothek enthalten (in neuen Versionen können sie geringfügig abweichen, dies kann für die Arbeit des entwickelten Programms von entscheidender Bedeutung sein).<br />
<br />
[[ZenGL Tutorial]]: Das ist das erste ZenGL Tutorial: Download, Installation, Quellpfade, Kompilieren (statisch oder mit so/dll/dylib) (Windows dll), und das erste Programm "Initialisation", das im ZenGL Paket enthalten ist.<br />
<br />
[[ZenGL Tutorial 2]]: Im zweiten Tutorial wird gezeigt, wie man einen Font erstellt und diesen auf ein ZenGL Fenster zeichnet.<br />
<br />
== Features ==<br />
<br />
* '''Allgemein'''<br />
o so/dll/dylib oder statisches Kompilieren von ZenGL gemeinsam mit der Applikation<br />
o Rendern in ein eigenes oder bereitgestelltes Fenster<br />
o Logging<br />
o Laden von Resourcen aus Dateien oder aus dem Speicher<br />
o Eine einfache Möglichkeit, Unterstützung für weitere Resourcen hinzuzufügen.<br />
* '''Einstellen von'''<br />
o Antialiasing, Bildschirmauflösung, Bildwiederholrate und Vertikaler Synchronisation<br />
o Aspect Correction<br />
o Titel, Position und Größe des Fensters<br />
o Sichtbarkeit des Cursors im Fenster<br />
* '''Eingabe'''<br />
o Keyboard, Maus und Joystick<br />
o Behandeln von Unicode Texteingabe<br />
o Möglichkeit, die Eingabe auf den ASCII Zeichensatz zu beschränken<br />
* '''Texturen'''<br />
o Unterstützung für '''tga''', '''png''' und '''jpg'''<br />
o Arbeitet korrekt mit NPOT Texturen<br />
o Kontrolle aller Filterparameter<br />
o Masking<br />
o ''Render Targets'', um auf Texturen zu rendern.<br />
* '''Text'''<br />
o texturierter Unicode-Font<br />
o Rendern von UTF-8 oder ANSI Text<br />
o Rendern von Text mit Ausrichtungen und anderen Optionen, wie Größe, Farbe, Anzahl der Zeichen<br />
* '''2D-Subsystem'''<br />
o ''batch render'' für High-Speed-Rendering<br />
o Rendern von verschiedenen "Primitives"<br />
o Sprite Engine<br />
o Rendern von statischen und animierten Sprites und Tiles (Kacheln)<br />
o rendering distortion grid<br />
o rendering sprites with new texture coordinates(with the pixel dimension and the usual 0..1)<br />
o control the blend mode and color mix mode<br />
o control the color and alpha of vertices of sprites and primitives<br />
o additional sprite transformations(flipping, zooming, vertices offset)<br />
o fast clipping of invisible sprites<br />
o 2D Kamera mit den Möglichkeiten zum Zoomen und Drehen. <br />
* '''Sound'''<br />
o arbeitet mit OpenAL oder DirectSound, basierend auf der Konfiguration des Betriebssystems<br />
o correct work without soundcard<br />
o unterstützt '''wav''' und '''ogg''' als Sounddateien<br />
o Abspielen von Audiodateien in einem separaten Thread<br />
o Kontrolle über Lautspärke und Abspielgeschwindigkeit<br />
o moving sound sources in 3D space<br />
* '''Math'''<br />
o Ein Satz zusätzlicher mathematischer Funktionen<br />
o triangulation functions<br />
o Kollisionsfunktionen<br />
* '''Zusätzlich'''<br />
o Lesen und Schreiben von INI-Files<br />
o Funktionen um mit Dateien im Speicher zu arbeiten<br />
<br />
== In der neuen Version ==<br />
<br />
*Die Kompilierung für Android für FPC 3.2.0 und höher wurde korrigiert.<br />
*Der Hauptcode wurde verschoben, um die Bibliothek zu korrigieren<br />
*Bearbeitete Arbeit mit Windows 64<br />
*Kleinere Fehler behoben<br />
*Bearbeitete Demoversionen (für iOS wurden Demos nicht korrigiert, Demoversionen für Lazarus, FPC und Delphi wurden überarbeitet)<br />
*Eingeführt von DEFINE<br />
**define - USE_EXIT_ESCAPE - exit. Jetzt müssen Sie keinen zusätzlichen Code schreiben, um das Programm durch Drücken der Escape-Taste zubeenden<br />
**define - USE_INIT_HANDLE - um ZenGL in einem bereits erstellten Fenster (LCL/VCL) zu verwenden<br />
*Unterstützung für macOS Cocoa eingeführt<br />
*Bearbeitete Arbeit mit Timern<br />
*Bearbeitete Arbeit mit Schriftarten<br />
*Bearbeitete Arbeit mit LCL/VCL<br />
<br />
[[Category:Components/de]]<br />
[[Category:Graphics/de]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/de&diff=157394ZenGL/de2023-09-30T21:38:55Z<p>Seenkao: /* Links */</p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index}}<br />
<br />
== Allgemein ==<br />
ZenGL ist eine plattformübergreifende Game-Library und wurde entworfen, um notwendige Funktionen wie 2D-Grafiken, Ein- und Ausgabebehandlung, Sound, etc. bereitzustellen.<br />
<br />
'''Unterstützte Betriebssysteme''': GNU/Linux, Windows, macOS, iOS*, Android 2.1+*<br><br />
'''Unterstützte Compiler''': FreePascal, Delphi<br><br />
'''Graphik API''': OpenGL, OpenGL ES 1.x*, Direct3D 8/9<br><br />
'''Sound API''': OpenAL, DirectSound<br><br />
'''Lizenz''': zlib<br />
<br />
''*'' - Nur in der [http://code.google.com/p/zengl/source/checkout svn]-Version<br />
<br />
Die Bibliothek wird zu diesem Zeitpunkt weiterentwickelt.<br />
<br />
== Links ==<br />
<br />
*[https://code.google.com/archive/p/zengl/ Download ZenGL]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL Bis Version 4.2 (Version 4.2 wurde archiviert und nicht getestet, siehe Version auf SourceForge)]<br />
*[https://sourceforge.net/projects/new-zengl/ SourceForge - ZenGL 4.2 und höher Quellcode]<br />
<br />
== Tutorial ==<br />
<br />
'''Beachtung!''' Alle Beispiele sind in der heruntergeladenen Version der Bibliothek enthalten (in neuen Versionen können sie geringfügig abweichen, dies kann für die Arbeit des entwickelten Programms von entscheidender Bedeutung sein).<br />
<br />
[[ZenGL Tutorial]]: Das ist das erste ZenGL Tutorial: Download, Installation, Quellpfade, Kompilieren (statisch oder mit so/dll/dylib) (Windows dll), und das erste Programm "Initialisation", das im ZenGL Paket enthalten ist.<br />
<br />
[[ZenGL Tutorial 2]]: Im zweiten Tutorial wird gezeigt, wie man einen Font erstellt und diesen auf ein ZenGL Fenster zeichnet.<br />
<br />
== Features ==<br />
<br />
* '''Allgemein'''<br />
o so/dll/dylib oder statisches Kompilieren von ZenGL gemeinsam mit der Applikation<br />
o Rendern in ein eigenes oder bereitgestelltes Fenster<br />
o Logging<br />
o Laden von Resourcen aus Dateien oder aus dem Speicher<br />
o Eine einfache Möglichkeit, Unterstützung für weitere Resourcen hinzuzufügen.<br />
* '''Einstellen von'''<br />
o Antialiasing, Bildschirmauflösung, Bildwiederholrate und Vertikaler Synchronisation<br />
o Aspect Correction<br />
o Titel, Position und Größe des Fensters<br />
o Sichtbarkeit des Cursors im Fenster<br />
* '''Eingabe'''<br />
o Keyboard, Maus und Joystick<br />
o Behandeln von Unicode Texteingabe<br />
o Möglichkeit, die Eingabe auf den ASCII Zeichensatz zu beschränken<br />
* '''Texturen'''<br />
o Unterstützung für '''tga''', '''png''' und '''jpg'''<br />
o Arbeitet korrekt mit NPOT Texturen<br />
o Kontrolle aller Filterparameter<br />
o Masking<br />
o ''Render Targets'', um auf Texturen zu rendern.<br />
* '''Text'''<br />
o texturierter Unicode-Font<br />
o Rendern von UTF-8 oder ANSI Text<br />
o Rendern von Text mit Ausrichtungen und anderen Optionen, wie Größe, Farbe, Anzahl der Zeichen<br />
* '''2D-Subsystem'''<br />
o ''batch render'' für High-Speed-Rendering<br />
o Rendern von verschiedenen "Primitives"<br />
o Sprite Engine<br />
o Rendern von statischen und animierten Sprites und Tiles (Kacheln)<br />
o rendering distortion grid<br />
o rendering sprites with new texture coordinates(with the pixel dimension and the usual 0..1)<br />
o control the blend mode and color mix mode<br />
o control the color and alpha of vertices of sprites and primitives<br />
o additional sprite transformations(flipping, zooming, vertices offset)<br />
o fast clipping of invisible sprites<br />
o 2D Kamera mit den Möglichkeiten zum Zoomen und Drehen. <br />
* '''Sound'''<br />
o arbeitet mit OpenAL oder DirectSound, basierend auf der Konfiguration des Betriebssystems<br />
o correct work without soundcard<br />
o unterstützt '''wav''' und '''ogg''' als Sounddateien<br />
o Abspielen von Audiodateien in einem separaten Thread<br />
o Kontrolle über Lautspärke und Abspielgeschwindigkeit<br />
o moving sound sources in 3D space<br />
* '''Math'''<br />
o Ein Satz zusätzlicher mathematischer Funktionen<br />
o triangulation functions<br />
o Kollisionsfunktionen<br />
* '''Zusätzlich'''<br />
o Lesen und Schreiben von INI-Files<br />
o Funktionen um mit Dateien im Speicher zu arbeiten<br />
<br />
== In der neuen Version ==<br />
<br />
*Die Kompilierung für Android für FPC 3.2.0 und höher wurde korrigiert.<br />
*Der Hauptcode wurde verschoben, um die Bibliothek zu korrigieren<br />
*Bearbeitete Arbeit mit Windows 64<br />
*Kleinere Fehler behoben<br />
*Bearbeitete Demoversionen (für iOS wurden Demos nicht korrigiert, Demoversionen für Lazarus, FPC und Delphi wurden überarbeitet)<br />
*Eingeführt von DEFINE<br />
**define - USE_EXIT_ESCAPE - exit. Jetzt müssen Sie keinen zusätzlichen Code schreiben, um das Programm durch Drücken der Escape-Taste zubeenden<br />
**define - USE_INIT_HANDLE - um ZenGL in einem bereits erstellten Fenster (LCL/VCL) zu verwenden<br />
*Unterstützung für macOS Cocoa eingeführt<br />
*Bearbeitete Arbeit mit Timern<br />
*Bearbeitete Arbeit mit Schriftarten<br />
*Bearbeitete Arbeit mit LCL/VCL<br />
<br />
[[Category:Components/de]]<br />
[[Category:Graphics/de]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/de&diff=157393ZenGL/de2023-09-30T21:37:02Z<p>Seenkao: /* Allgemein */</p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index}}<br />
<br />
== Allgemein ==<br />
ZenGL ist eine plattformübergreifende Game-Library und wurde entworfen, um notwendige Funktionen wie 2D-Grafiken, Ein- und Ausgabebehandlung, Sound, etc. bereitzustellen.<br />
<br />
'''Unterstützte Betriebssysteme''': GNU/Linux, Windows, macOS, iOS*, Android 2.1+*<br><br />
'''Unterstützte Compiler''': FreePascal, Delphi<br><br />
'''Graphik API''': OpenGL, OpenGL ES 1.x*, Direct3D 8/9<br><br />
'''Sound API''': OpenAL, DirectSound<br><br />
'''Lizenz''': zlib<br />
<br />
''*'' - Nur in der [http://code.google.com/p/zengl/source/checkout svn]-Version<br />
<br />
Die Bibliothek wird zu diesem Zeitpunkt weiterentwickelt.<br />
<br />
== Links ==<br />
<br />
*[http://zengl.org/download.html Download ZenGL]<br><br />
*[http://zengl.org/extra.html Extra Downloads]<br />
*[http://zengl.org/ Homepage]<br><br />
*[http://zengl.org/wiki Wiki]<br><br />
*[http://zengl.org/forum Offizielles Forum (englisch)]<br><br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL eine neue Version]<br />
<br />
== Tutorial ==<br />
<br />
'''Beachtung!''' Alle Beispiele sind in der heruntergeladenen Version der Bibliothek enthalten (in neuen Versionen können sie geringfügig abweichen, dies kann für die Arbeit des entwickelten Programms von entscheidender Bedeutung sein).<br />
<br />
[[ZenGL Tutorial]]: Das ist das erste ZenGL Tutorial: Download, Installation, Quellpfade, Kompilieren (statisch oder mit so/dll/dylib) (Windows dll), und das erste Programm "Initialisation", das im ZenGL Paket enthalten ist.<br />
<br />
[[ZenGL Tutorial 2]]: Im zweiten Tutorial wird gezeigt, wie man einen Font erstellt und diesen auf ein ZenGL Fenster zeichnet.<br />
<br />
== Features ==<br />
<br />
* '''Allgemein'''<br />
o so/dll/dylib oder statisches Kompilieren von ZenGL gemeinsam mit der Applikation<br />
o Rendern in ein eigenes oder bereitgestelltes Fenster<br />
o Logging<br />
o Laden von Resourcen aus Dateien oder aus dem Speicher<br />
o Eine einfache Möglichkeit, Unterstützung für weitere Resourcen hinzuzufügen.<br />
* '''Einstellen von'''<br />
o Antialiasing, Bildschirmauflösung, Bildwiederholrate und Vertikaler Synchronisation<br />
o Aspect Correction<br />
o Titel, Position und Größe des Fensters<br />
o Sichtbarkeit des Cursors im Fenster<br />
* '''Eingabe'''<br />
o Keyboard, Maus und Joystick<br />
o Behandeln von Unicode Texteingabe<br />
o Möglichkeit, die Eingabe auf den ASCII Zeichensatz zu beschränken<br />
* '''Texturen'''<br />
o Unterstützung für '''tga''', '''png''' und '''jpg'''<br />
o Arbeitet korrekt mit NPOT Texturen<br />
o Kontrolle aller Filterparameter<br />
o Masking<br />
o ''Render Targets'', um auf Texturen zu rendern.<br />
* '''Text'''<br />
o texturierter Unicode-Font<br />
o Rendern von UTF-8 oder ANSI Text<br />
o Rendern von Text mit Ausrichtungen und anderen Optionen, wie Größe, Farbe, Anzahl der Zeichen<br />
* '''2D-Subsystem'''<br />
o ''batch render'' für High-Speed-Rendering<br />
o Rendern von verschiedenen "Primitives"<br />
o Sprite Engine<br />
o Rendern von statischen und animierten Sprites und Tiles (Kacheln)<br />
o rendering distortion grid<br />
o rendering sprites with new texture coordinates(with the pixel dimension and the usual 0..1)<br />
o control the blend mode and color mix mode<br />
o control the color and alpha of vertices of sprites and primitives<br />
o additional sprite transformations(flipping, zooming, vertices offset)<br />
o fast clipping of invisible sprites<br />
o 2D Kamera mit den Möglichkeiten zum Zoomen und Drehen. <br />
* '''Sound'''<br />
o arbeitet mit OpenAL oder DirectSound, basierend auf der Konfiguration des Betriebssystems<br />
o correct work without soundcard<br />
o unterstützt '''wav''' und '''ogg''' als Sounddateien<br />
o Abspielen von Audiodateien in einem separaten Thread<br />
o Kontrolle über Lautspärke und Abspielgeschwindigkeit<br />
o moving sound sources in 3D space<br />
* '''Math'''<br />
o Ein Satz zusätzlicher mathematischer Funktionen<br />
o triangulation functions<br />
o Kollisionsfunktionen<br />
* '''Zusätzlich'''<br />
o Lesen und Schreiben von INI-Files<br />
o Funktionen um mit Dateien im Speicher zu arbeiten<br />
<br />
== In der neuen Version ==<br />
<br />
*Die Kompilierung für Android für FPC 3.2.0 und höher wurde korrigiert.<br />
*Der Hauptcode wurde verschoben, um die Bibliothek zu korrigieren<br />
*Bearbeitete Arbeit mit Windows 64<br />
*Kleinere Fehler behoben<br />
*Bearbeitete Demoversionen (für iOS wurden Demos nicht korrigiert, Demoversionen für Lazarus, FPC und Delphi wurden überarbeitet)<br />
*Eingeführt von DEFINE<br />
**define - USE_EXIT_ESCAPE - exit. Jetzt müssen Sie keinen zusätzlichen Code schreiben, um das Programm durch Drücken der Escape-Taste zubeenden<br />
**define - USE_INIT_HANDLE - um ZenGL in einem bereits erstellten Fenster (LCL/VCL) zu verwenden<br />
*Unterstützung für macOS Cocoa eingeführt<br />
*Bearbeitete Arbeit mit Timern<br />
*Bearbeitete Arbeit mit Schriftarten<br />
*Bearbeitete Arbeit mit LCL/VCL<br />
<br />
[[Category:Components/de]]<br />
[[Category:Graphics/de]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/es&diff=157392ZenGL/es2023-09-30T21:36:16Z<p>Seenkao: /* Enlaces */</p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index/es}}<br />
<br />
== Principal ==<br />
ZenGL - librería de desarrollo de juegos multi-platforma, diseñado para proporcionar la funcionalidad necesaria para la generación de gráficos 2D, manejo de la entrada, de la salida, del sonido, etc<br />
<br />
'''SO Soportados''': GNU/Linux, Windows, macOS<br><br />
'''Compiladores soportados''': FreePascal, Delphi<br><br />
'''API de Gráficos''': OpenGL, Direct3D 8/9<br><br />
'''API de Sonido''': OpenAL, DirectSound<br><br />
'''Licencia''': zlib<br />
<br />
''*'' Disponible en versión [http://code.google.com/p/zengl/source/checkout svn]<br />
<br />
== Enlaces ==<br />
<br />
*[https://code.google.com/archive/p/zengl/ Descargar ZenGL 3.12]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL Hasta la versión 4.2 (la versión 4.2 ha sido archivada y no probada, consulte la versión en SourceForge)]<br />
*[https://sourceforge.net/projects/new-zengl/ SourceForge - ZenGL 4.2 y código fuente superior]<br />
<br />
== Tutorial ==<br />
<br />
'''¡Atención!''' Todos los ejemplos están contenidos en la versión descargada de la biblioteca (en las nuevas versiones pueden diferir levemente, pero son fundamentales para el trabajo del programa desarrollado).<br />
<br />
[[ZenGL Tutorial/es]]: Este es un primer tutorial para ZenGL: descarga, instalación, rutas del código fuente, compilación (estática o con so/dll/dylib) (Windows dll), y el primer programa 'Inicialización' que viene con ZenGL.<br />
<br />
[[ZenGL Tutorial 2/es]]: Este es el segundo tutorial que muestra como crear una fuente y dibujar texto en la ventana.<br />
<br />
== Caracteristicas ==<br />
<br />
* '''Principal'''<br />
o puede ser usado como so/dll/dylib o estáticamente compilado con tu aplicación<br />
o renderizar para la propia o alguna otra ventana preparada<br />
o logging<br />
o carga de recursos desde archivos y memoria<br />
o forma fácil para agregar soporte para nuevos formatos de recursos<br />
* '''Configurción de'''<br />
o antialiasing, resolución de pantalla, tasa de refresco y sincronización vertical<br />
o corrección del aspecto<br />
o título, posición y tamaño de la ventana<br />
o visibilidad del cursor en el espacio de la ventana<br />
* '''Entrada'''<br />
o manejar entrada del teclado, ratón y mando<br />
o manejar entrada de texto Unicode<br />
o posibilidad de restringir la entrada al alfabeto Latín<br />
* '''Texturas'''<br />
o soporta '''tga''', '''png''' y '''jpg'''<br />
o trabaja correctamente con texturas NPOT<br />
o controla los parámetros de filtros<br />
o máscaras<br />
o ''objetivos de renderizado'' para renderizar en textura<br />
* '''Texto'''<br />
o fuente-Unicode texturizada<br />
o renderizar texto UTF-8 o ANSI<br />
o renderizar texto con alineamiento y otras opciones como tamaño, color y conteo de símbolos<br />
* '''Subsistema-2D'''<br />
o ''renderizado en lote'' para renderizado de alta velocidad<br />
o renderizar diferentes primitivas<br />
o motor de sprites<br />
o renderizar sprites y azulejos estáticos y animados<br />
o renderizar grilla de distorsión<br />
o renderizar sprites con coordenadas de nueva textura (con la dimensión del píxel y el usual 0..1)<br />
o controlar el modo de mezcla y mezcla de color<br />
o controlar el color y opacidad de los vertices de sprites y primitivas<br />
o transformaciones adicionales de sprite (girado, zoom, desplazamiento de vértices)<br />
o recorte rápido de sprites invisibles<br />
o camara 2d con la capacidad de zoom y rotar la escena<br />
* '''Sonido'''<br />
o trabaja a través de OpenAL o DirectSound, dependiendo de la configuración o el SO<br />
o trabaja correctamente sin placa de sonido<br />
o soporta '''wav''' y '''ogg''' como muestras de sonido<br />
o reproducir archivos de audio en hilos separados<br />
o controlar el volumen y velocidad de reproducción<br />
o mover fuentes de sonido en un espacio 3D<br />
* '''Matemática'''<br />
o set básico de funciones matemáticas adicionales<br />
o funciones de triangulación<br />
o set básico de funciones de colisión<br />
* '''Adicional'''<br />
o leer y escribir archivos ini<br />
o funciones para trabajar con archivos y memoria<br />
<br />
== En la nueva versión ==<br />
<br />
* Compilación corregida para Android para FPC 3.2.0 y superior.<br />
* Se movió el código principal para corregir la biblioteca.<br />
* Trabajo fijo con Windows 64<br />
* Corregidos errores menores<br />
* Versiones de demostración editadas (para iOS, las demostraciones no se corrigieron, se revisaron las versiones de demostración para Lazarus, FPC y Delphi)<br />
* Introducido por DEFINE<br />
** define - USE_EXIT_ESCAPE - salir. Posibilidad de no escribir código adicional para salir del programa presionando la tecla Escape<br />
** define - USE_INIT_HANDLE - para usar ZenGL en una ventana ya creada (LCL/VCL)<br />
* Soporte introducido para macOS Cocoa<br />
* Cambiado: trabajar con temporizadores, trabajando con fuentes, trabajar con LCL/VCL.<br />
<br />
[[Category:Components/es]]<br />
[[Category:Graphics/es]]<br />
[[category:Español]][[category:Castellano]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/es&diff=157391ZenGL/es2023-09-30T21:34:18Z<p>Seenkao: /* Principal */</p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index/es}}<br />
<br />
== Principal ==<br />
ZenGL - librería de desarrollo de juegos multi-platforma, diseñado para proporcionar la funcionalidad necesaria para la generación de gráficos 2D, manejo de la entrada, de la salida, del sonido, etc<br />
<br />
'''SO Soportados''': GNU/Linux, Windows, macOS<br><br />
'''Compiladores soportados''': FreePascal, Delphi<br><br />
'''API de Gráficos''': OpenGL, Direct3D 8/9<br><br />
'''API de Sonido''': OpenAL, DirectSound<br><br />
'''Licencia''': zlib<br />
<br />
''*'' Disponible en versión [http://code.google.com/p/zengl/source/checkout svn]<br />
<br />
== Enlaces ==<br />
<br />
*[http://zengl.org/download.html Descargar ZenGL]<br><br />
*[http://zengl.org/extra.html Descargar Extras]<br />
*[http://zengl.org/ Página Principal]<br><br />
*[http://zengl.org/wiki Wiki]<br><br />
*[http://zengl.org/forum Foro Oficial]<br><br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL Una nueva version]<br />
<br />
== Tutorial ==<br />
<br />
'''¡Atención!''' Todos los ejemplos están contenidos en la versión descargada de la biblioteca (en las nuevas versiones pueden diferir levemente, pero son fundamentales para el trabajo del programa desarrollado).<br />
<br />
[[ZenGL Tutorial/es]]: Este es un primer tutorial para ZenGL: descarga, instalación, rutas del código fuente, compilación (estática o con so/dll/dylib) (Windows dll), y el primer programa 'Inicialización' que viene con ZenGL.<br />
<br />
[[ZenGL Tutorial 2/es]]: Este es el segundo tutorial que muestra como crear una fuente y dibujar texto en la ventana.<br />
<br />
== Caracteristicas ==<br />
<br />
* '''Principal'''<br />
o puede ser usado como so/dll/dylib o estáticamente compilado con tu aplicación<br />
o renderizar para la propia o alguna otra ventana preparada<br />
o logging<br />
o carga de recursos desde archivos y memoria<br />
o forma fácil para agregar soporte para nuevos formatos de recursos<br />
* '''Configurción de'''<br />
o antialiasing, resolución de pantalla, tasa de refresco y sincronización vertical<br />
o corrección del aspecto<br />
o título, posición y tamaño de la ventana<br />
o visibilidad del cursor en el espacio de la ventana<br />
* '''Entrada'''<br />
o manejar entrada del teclado, ratón y mando<br />
o manejar entrada de texto Unicode<br />
o posibilidad de restringir la entrada al alfabeto Latín<br />
* '''Texturas'''<br />
o soporta '''tga''', '''png''' y '''jpg'''<br />
o trabaja correctamente con texturas NPOT<br />
o controla los parámetros de filtros<br />
o máscaras<br />
o ''objetivos de renderizado'' para renderizar en textura<br />
* '''Texto'''<br />
o fuente-Unicode texturizada<br />
o renderizar texto UTF-8 o ANSI<br />
o renderizar texto con alineamiento y otras opciones como tamaño, color y conteo de símbolos<br />
* '''Subsistema-2D'''<br />
o ''renderizado en lote'' para renderizado de alta velocidad<br />
o renderizar diferentes primitivas<br />
o motor de sprites<br />
o renderizar sprites y azulejos estáticos y animados<br />
o renderizar grilla de distorsión<br />
o renderizar sprites con coordenadas de nueva textura (con la dimensión del píxel y el usual 0..1)<br />
o controlar el modo de mezcla y mezcla de color<br />
o controlar el color y opacidad de los vertices de sprites y primitivas<br />
o transformaciones adicionales de sprite (girado, zoom, desplazamiento de vértices)<br />
o recorte rápido de sprites invisibles<br />
o camara 2d con la capacidad de zoom y rotar la escena<br />
* '''Sonido'''<br />
o trabaja a través de OpenAL o DirectSound, dependiendo de la configuración o el SO<br />
o trabaja correctamente sin placa de sonido<br />
o soporta '''wav''' y '''ogg''' como muestras de sonido<br />
o reproducir archivos de audio en hilos separados<br />
o controlar el volumen y velocidad de reproducción<br />
o mover fuentes de sonido en un espacio 3D<br />
* '''Matemática'''<br />
o set básico de funciones matemáticas adicionales<br />
o funciones de triangulación<br />
o set básico de funciones de colisión<br />
* '''Adicional'''<br />
o leer y escribir archivos ini<br />
o funciones para trabajar con archivos y memoria<br />
<br />
== En la nueva versión ==<br />
<br />
* Compilación corregida para Android para FPC 3.2.0 y superior.<br />
* Se movió el código principal para corregir la biblioteca.<br />
* Trabajo fijo con Windows 64<br />
* Corregidos errores menores<br />
* Versiones de demostración editadas (para iOS, las demostraciones no se corrigieron, se revisaron las versiones de demostración para Lazarus, FPC y Delphi)<br />
* Introducido por DEFINE<br />
** define - USE_EXIT_ESCAPE - salir. Posibilidad de no escribir código adicional para salir del programa presionando la tecla Escape<br />
** define - USE_INIT_HANDLE - para usar ZenGL en una ventana ya creada (LCL/VCL)<br />
* Soporte introducido para macOS Cocoa<br />
* Cambiado: trabajar con temporizadores, trabajando con fuentes, trabajar con LCL/VCL.<br />
<br />
[[Category:Components/es]]<br />
[[Category:Graphics/es]]<br />
[[category:Español]][[category:Castellano]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/fr&diff=157390ZenGL/fr2023-09-30T21:33:40Z<p>Seenkao: /* L'essentiel */</p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index/fr}}<br />
<br />
== L'essentiel ==<br />
ZenGL - bibliothèque de développement de jeu multi plate-forme, conçue pour fournir les fonctionnalités nécessaire pour le rendu des graphiques 2D, traitement des entrées, sortie sonores, etc.<br />
<br />
'''OS supportés''': GNU/Linux, Windows, macOS, iOS, Android 2.1+<br/><br />
'''Compilateurs supportés''': FreePascal, Delphi<br/><br />
'''API Graphique''': OpenGL, OpenGL ES 1.x, Direct3D 8/9<br/><br />
'''API de son''': OpenAL, DirectSound<br/><br />
'''Licence''': zlib<br />
<br />
== Liens ==<br />
<br />
*[https://code.google.com/archive/p/zengl/ Télécharger ZenGL 3.12]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL Jusqu'à la version 4.2 (la version 4.2 a été archivée et non testée, voir version sur SourceForge)]<br />
*[https://sourceforge.net/projects/new-zengl/ SourceForge - сode source ZenGL 4.2 et supérieur]<br />
<br />
== Tutoriel ==<br />
<br />
'''Attention!''' Tous les exemples sont contenus dans la version téléchargée de la bibliothèque (dans les nouvelles versions, ils peuvent différer légèrement, mais critiques pour le travail du programme développé).<br />
<br />
[[ZenGL Tutorial/fr|Tutoriel ZenGL]] : C'est le premier tutoriel pour ZenGL : téléchargement, installation, chemins des sources, compilation (statiquement ou avec so/dll/dylib) (Windows dll), et le premier programme 'Initialization' qui vient avec ZenGL.<br/><br />
[[ZenGL Tutorial 2/fr|Tutoriel ZenGL 2]] : C'est le second tutoriel sur comment créer une fonte et dessiner du texte dans la fenêtre.<br />
<br />
== Caractéristiques ==<br />
<br />
* '''Principal'''<br />
o peut être utilisé comme so/dll/dylib ou statiquement compilé avec votre application<br />
o rendu en propre ("to own") ou vers toute autre fenêtre préparée<br />
o enregistrement ("logging")<br />
o chargement de ressource depuis des fichiers, la mémoire et archives '''zip'''<br />
o chargement de ressource multi-threadé<br />
o ajout facilité du support de nouveau format de ressource<br />
* '''Configuration'''<br />
o anticrénelage ("antialiasing"), résolution d'écran, taux de rafraichissement et synchronisation verticale<br />
o correction d'aspect<br />
o titre, position et taille de la fenêtre<br />
o visibilité du curseur dans l'espace de la fenêtre<br />
* '''Entrée'''<br />
o traitement du clavier, de la souris et de l'entrée joystick<br />
o traitement de l'entrée de texte Unicode<br />
o possibilité de restreindre l'entrée à l'alphabet latin<br />
* '''Textures'''<br />
o supporte '''tga''', '''png''', '''jpg''' et '''pvr'''<br />
o fonctionnement correct avec les [https://www.opengl.org/wiki/NPOT_Texture textures NPOT] (non puissance de 2)<br />
o contrôle des paramètres de filtre<br />
o masquage<br />
o ''cibles de rendu''("render targets") pour le rendu en texture<br />
* '''Texte'''<br />
o font Unicode texturée<br />
o rendu de texte UTF-8<br />
o rendu de texte avec alignement et autres options comme la taille, la couleur et le compte de symbole ("count of symbols")<br />
* '''sous-système 2D'''<br />
o ''rendu différé'' ("batch render") pour le rendu à haute vitesse<br />
o rendu de différentes primitives<br />
o moteur de lutin ("sprite")<br />
o rendu de lutins et tuiles ("tiles") statiques et animé.<br />
o rendu de grille de distortion<br />
o rendu des lutins avec de nouvelles coordonnées de textures (avec la dimension de pixel et l'habituel 0..1)<br />
o contrôle du mode de mélange et du mode mix de couleurs ("color mix mode")<br />
o contrôle de la couleur et de l'alpha des sommets des lutins et primitives<br />
o transformations supplémentaires de lutin (flipping, zoom ("zooming"), décalage de sommets ("vertices offset"))<br />
o découpage ("clipping") rapide des lutins invisibles<br />
o caméra 2D avec possibilité de zoom et de rotation de la scène<br />
* '''Son'''<br />
o fonctionne à travers OpenAL ou DirectSound; selon la configuration et le système d'exploitation<br />
o marche correctement avec la carte son<br />
o supporte '''wav''' et '''ogg''' comme formats des échantillons sonores<br />
o lecture des fichiers audio dans un thread séparé<br />
o contrôle du volume et de la vitesse de lecture<br />
o déplacement des sources sonores dans l'espace 3D<br />
* '''Vidéo'''<br />
o décodage des trames vidéo dans la texture<br />
o supporte le codec '''theora''' dans un conteneur '''ogv'''<br />
* '''Maths'''<br />
o ensemble de base de fonctions mathématiques supplémentaires<br />
o fonctions de triangulation<br />
o ensemble de base de fonctions de collision<br />
* '''Supplément'''<br />
o lecture et écriture de fichier INI<br />
o fonctions pour travailler avec les fichiers et la mémoire<br />
<br/><br />
<br />
== Dans la nouvelle version ==<br />
<br />
* Correction de la compilation pour Android pour FPC 3.2.0 et supérieur.<br />
* Déplacement du code principal pour corriger la bibliothèque<br />
* Travail édité avec Windows 64<br />
* Correction de bugs mineurs<br />
* Versions de démonstration éditées (pour iOS, les démos n'ont pas été corrigées, les versions de démonstration pour Lazarus, FPC et Delphi ont été révisées)<br />
* Introduit par DEFINE<br />
** define - USE_EXIT_ESCAPE - quitter. Possibilité de ne pas écrire de code supplémentaire pour quitter le programme en appuyant sur la touche Échap<br />
** define - USE_INIT_HANDLE - pour utiliser ZenGL dans une fenêtre déjà créée (LCL/VCL)<br />
* Prise en charge introduite pour macOS Cocoa<br />
* Changé: travailler avec des minuteries, travailler avec des polices, travailler avec LCL/VCL</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/fr&diff=157389ZenGL/fr2023-09-30T21:33:19Z<p>Seenkao: /* Liens */</p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index/fr}}<br />
<br />
== L'essentiel ==<br />
ZenGL - bibliothèque de développement de jeu multi plate-forme, conçue pour fournir les fonctionnalités nécessaire pour le rendu des graphiques 2D, traitement des entrées, sortie sonores, etc.<br />
<br />
'''OS supportés''': GNU/Linux, Windows, macOS, iOS, Android 2.1+<br/><br />
'''Compilateurs supportés''': FreePascal, Delphi<br/><br />
'''API Graphique''': OpenGL, OpenGL ES 1.x, Direct3D 8/9<br/><br />
'''API de son''': OpenAL, DirectSound<br/><br />
'''Licence''': [http://zengl.org/license.html zlib]<br />
<br />
== Liens ==<br />
<br />
*[https://code.google.com/archive/p/zengl/ Télécharger ZenGL 3.12]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL Jusqu'à la version 4.2 (la version 4.2 a été archivée et non testée, voir version sur SourceForge)]<br />
*[https://sourceforge.net/projects/new-zengl/ SourceForge - сode source ZenGL 4.2 et supérieur]<br />
<br />
== Tutoriel ==<br />
<br />
'''Attention!''' Tous les exemples sont contenus dans la version téléchargée de la bibliothèque (dans les nouvelles versions, ils peuvent différer légèrement, mais critiques pour le travail du programme développé).<br />
<br />
[[ZenGL Tutorial/fr|Tutoriel ZenGL]] : C'est le premier tutoriel pour ZenGL : téléchargement, installation, chemins des sources, compilation (statiquement ou avec so/dll/dylib) (Windows dll), et le premier programme 'Initialization' qui vient avec ZenGL.<br/><br />
[[ZenGL Tutorial 2/fr|Tutoriel ZenGL 2]] : C'est le second tutoriel sur comment créer une fonte et dessiner du texte dans la fenêtre.<br />
<br />
== Caractéristiques ==<br />
<br />
* '''Principal'''<br />
o peut être utilisé comme so/dll/dylib ou statiquement compilé avec votre application<br />
o rendu en propre ("to own") ou vers toute autre fenêtre préparée<br />
o enregistrement ("logging")<br />
o chargement de ressource depuis des fichiers, la mémoire et archives '''zip'''<br />
o chargement de ressource multi-threadé<br />
o ajout facilité du support de nouveau format de ressource<br />
* '''Configuration'''<br />
o anticrénelage ("antialiasing"), résolution d'écran, taux de rafraichissement et synchronisation verticale<br />
o correction d'aspect<br />
o titre, position et taille de la fenêtre<br />
o visibilité du curseur dans l'espace de la fenêtre<br />
* '''Entrée'''<br />
o traitement du clavier, de la souris et de l'entrée joystick<br />
o traitement de l'entrée de texte Unicode<br />
o possibilité de restreindre l'entrée à l'alphabet latin<br />
* '''Textures'''<br />
o supporte '''tga''', '''png''', '''jpg''' et '''pvr'''<br />
o fonctionnement correct avec les [https://www.opengl.org/wiki/NPOT_Texture textures NPOT] (non puissance de 2)<br />
o contrôle des paramètres de filtre<br />
o masquage<br />
o ''cibles de rendu''("render targets") pour le rendu en texture<br />
* '''Texte'''<br />
o font Unicode texturée<br />
o rendu de texte UTF-8<br />
o rendu de texte avec alignement et autres options comme la taille, la couleur et le compte de symbole ("count of symbols")<br />
* '''sous-système 2D'''<br />
o ''rendu différé'' ("batch render") pour le rendu à haute vitesse<br />
o rendu de différentes primitives<br />
o moteur de lutin ("sprite")<br />
o rendu de lutins et tuiles ("tiles") statiques et animé.<br />
o rendu de grille de distortion<br />
o rendu des lutins avec de nouvelles coordonnées de textures (avec la dimension de pixel et l'habituel 0..1)<br />
o contrôle du mode de mélange et du mode mix de couleurs ("color mix mode")<br />
o contrôle de la couleur et de l'alpha des sommets des lutins et primitives<br />
o transformations supplémentaires de lutin (flipping, zoom ("zooming"), décalage de sommets ("vertices offset"))<br />
o découpage ("clipping") rapide des lutins invisibles<br />
o caméra 2D avec possibilité de zoom et de rotation de la scène<br />
* '''Son'''<br />
o fonctionne à travers OpenAL ou DirectSound; selon la configuration et le système d'exploitation<br />
o marche correctement avec la carte son<br />
o supporte '''wav''' et '''ogg''' comme formats des échantillons sonores<br />
o lecture des fichiers audio dans un thread séparé<br />
o contrôle du volume et de la vitesse de lecture<br />
o déplacement des sources sonores dans l'espace 3D<br />
* '''Vidéo'''<br />
o décodage des trames vidéo dans la texture<br />
o supporte le codec '''theora''' dans un conteneur '''ogv'''<br />
* '''Maths'''<br />
o ensemble de base de fonctions mathématiques supplémentaires<br />
o fonctions de triangulation<br />
o ensemble de base de fonctions de collision<br />
* '''Supplément'''<br />
o lecture et écriture de fichier INI<br />
o fonctions pour travailler avec les fichiers et la mémoire<br />
<br/><br />
<br />
== Dans la nouvelle version ==<br />
<br />
* Correction de la compilation pour Android pour FPC 3.2.0 et supérieur.<br />
* Déplacement du code principal pour corriger la bibliothèque<br />
* Travail édité avec Windows 64<br />
* Correction de bugs mineurs<br />
* Versions de démonstration éditées (pour iOS, les démos n'ont pas été corrigées, les versions de démonstration pour Lazarus, FPC et Delphi ont été révisées)<br />
* Introduit par DEFINE<br />
** define - USE_EXIT_ESCAPE - quitter. Possibilité de ne pas écrire de code supplémentaire pour quitter le programme en appuyant sur la touche Échap<br />
** define - USE_INIT_HANDLE - pour utiliser ZenGL dans une fenêtre déjà créée (LCL/VCL)<br />
* Prise en charge introduite pour macOS Cocoa<br />
* Changé: travailler avec des minuteries, travailler avec des polices, travailler avec LCL/VCL</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/ru&diff=157388ZenGL/ru2023-09-30T21:30:11Z<p>Seenkao: /* Ссылки */</p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index/ru}}<br />
<br />
== О ZenGL ==<br />
<br />
'''ZenGL''' - кросс-платформенная библиотека, разработанная, чтобы обеспечить необходимый функционал для отрисовки двухмерных игр, обработки устройств ввода, воспроизведение звука и музыки.<br />
<br />
*'''Поддерживаемые ОС''': GNU/Linux(32/64), Windows(32/64), macOS(Carbon/Cocoa), iOS, Android 2.1+<br />
<br />
*'''Компиляторы''': Free Pascal, Delphi<br />
<br />
*'''Графические API''': [https://wiki.freepascal.org/OpenGL/ru OpenGL], OpenGL ES 1.x, Direct3D 8/9<br />
<br />
*'''Аудио API''': OpenAL, DirectSound<br />
<br />
*'''Лицензия''': zlib<br />
<br />
В данное время библиотека дорабатывается.<br />
<br />
== Ссылки ==<br />
<br />
*[https://code.google.com/archive/p/zengl/ Download ZenGL до версии 3.12]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL До версии 4.2 (версия 4.2 уведена в архив и не тестирована, смотрите версию на SourceForge)]<br />
*[https://sourceforge.net/projects/new-zengl/ SourceForge - исходный код ZenGL 4.2 и выше]<br />
<br />
== Обучающие примеры ==<br />
<br />
'''Внимание!''' Все примеры содержатся в скачиваемой версии библиотеки (в новых версиях они могут незначительно, но критично для работы разрабатываемой программы, отличаться).<br />
<br />
[[ZenGL Tutorial]]: Первый пример для ZenGL знакомит с самой библиотекой. Рассказывается о том как скачать, установить библиотеку. Настроить компилятор (среду разработки) для компиляции проектов. Сборка проекта как статической так динамической библиотекой ZenGL. А так же рассматривается одна и программ-примеров 'Initialization', которая входит в библиотеку ZenGL.<br />
<br />
[[ZenGL Tutorial 2]]: Второй пример рассказывает о том, как создавать шрифты и выводить текст на экран.<br />
<br />
== Возможности библиотеки ==<br />
<br />
*Основные<br />
** библиотека может быть скомпилирована статически к проекту, или использоваться, как динамическая библиотека (в обновлённой версии только статическая компиляция)<br />
** рендеринг как в собственное, так и в заранее подготовленное окно (LCL, VCL)<br />
** журнал событий <br />
** загрузка ресурсов из файлов, памяти и '''zip''' архивов<br />
** многопоточная загрузка ресурсов<br />
** возможность расширить количество поддерживаемых форматов данных<br />
* Возможности настройки графики<br />
** Сглаживание (antialiasing), разрешение и частоту обновления экрана (screen resolution, refresh rate) а так же контролировать вертикальную синхронизацию (v-sync)<br />
** коррекция пропорций выводимого изображения относительно заданных размеров<br />
** управление заголовком и размером окна, наличие автоматического центрирования<br />
** управление видимостью курсора в пределах окна<br />
* Устройства ввода<br />
** обработка событий клавиатуры, мыши и джойстика<br />
** ввод Unicode символов<br />
** возможность ограничить ввод только латинской раскладкой<br />
*Вывод Текстур<br />
** поддержка форматов '''tga''', '''png''', '''jpg''' и '''pvr'''<br />
** поддержка текстур размером не кратным 2 (Non Power Of Two)<br />
** управление параметрами фильтрации<br />
** работа с масками<br />
** ''render targets'' отрисовка в текстуры<br />
*Вывод текста<br />
** реализация Unicode шрифты на основе текстур<br />
** вывод UTF-8 текста<br />
** управление отступами, размером, цветом вершин и количеством символов в тексте<br />
*2D подсистема<br />
** ''batch render'' для повышения производительности рендеринга<br />
** рендеринг основных видов примитивов<br />
** спрайтовый движок<br />
** вывод статических и анимированных спрайтов и тайлов<br />
** рендеринг трансформирующейся сетки<br />
** рендеринг спрайтов с ручным указанием текстурных координат(с пиксельной размерностью и обычным 0..1)<br />
** управление режимом блендинга и смешивания цвета<br />
** возможность назначения цвета и альфы отдельным вершинам спрайтов и примитивов<br />
** дополнительные трансформации спрайтов(зеркальное отражения, увеличение, смещение вершин)<br />
** быстрое отсечение спрайтов выходящих за пределы видимости<br />
** наличие 2D камеры с возможностью увеличения и поворота содержимого сцены<br />
* Звук<br />
** вывод звука с помощью библиотек OpenAL или DirectSound (зависит от настроек проекта и операционной системы)<br />
** возможность правильной работы, даже при отсутствии звуковой карты <br />
** поддержка форматов '''wav''' и 'ogg'''<br />
** потоковое воспроизведение аудио-файлов<br />
** контроль за громкостью звука и темпом воспроизведения<br />
** трехмерное позиционирование источника звука в пространстве<br />
* Видео<br />
** декодирование видео заставок в текстуры <br />
** поддержка кодека '''theora''' в формате '''ogv''' <br />
* Математический вычисление <br />
** базовый набор вспомогательных мат. функций<br />
** необходимый набор функций для триангуляции<br />
** простейшие функции проверки столкновений <br />
* Доплнительно<br />
** чтение и запись INI файлов<br />
** дополнительные функции для работы с файлами и памятью<br />
<br />
== В обновлённой версии ==<br />
<br />
*Корректирована компиляция под android под версию FPC 3.2.0 и выше.<br />
*Скомпилированы библиотеки (Ogg, Vorbis, Theora) для всех архитектур Android: x86, x86_64, ARM32 и ARM64.<br />
*Перебран основной код для коррекции работы библиотеки<br />
*Редактирована работа с Windows 64<br />
*Исправлены мелкие баги<br />
*Редактированы демо-версии (для iOS демки не правились, перебраны демо-версии для Lazarus, FPC и Delphi)<br />
*Введены DEFINE<br />
** define - USE_EXIT_ESCAPE - выход. Возможность не писать дополнительный код для выхода из программы по нажатию клавиши Escape<br />
** define - USE_INIT_HANDLE - для использования ZenGL в уже созданное окно (LCL/VCL)<br />
*Введена поддержка MacOS Cocoa<br />
*Редактирована работа с таймерами<br />
*Редактирована работа со шрифтами<br />
*Редактирована работа с LCL/VCL<br />
<br />
Добавлен внутренний движок, основанный на функциональности ZenGL - Green Engine.<br />
<br />
Возможности Green Engine:<br />
<br />
- собственное поле ввода и его функциональность.<br />
<br />
<br />
Ведётся документация внутри модулей ZenGL.<br />
<br />
Так же смотрите обновления в файле ''Update _ZenGL.txt'' (на русском).<br />
<br />
{{AutoCategory}}<br />
[[Category:Components/ru]]<br />
[[Category:Graphics/ru]]<br />
[[Category:Audio/ru]]<br />
[[Category:Video/ru]]<br />
[[Category:Multimedia/ru]]<br />
[[Category:Game Development/ru]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL&diff=157387ZenGL2023-09-30T21:29:41Z<p>Seenkao: /* Links */</p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index}}<br />
<br />
== About ==<br />
<br />
'''ZenGL''' - a cross-platform game development library, designed to provide necessary functionality for rendering 2D graphics, handling input, sound output, etc.<br />
<br />
*'''Supported OS''': GNU/Linux, Windows, macOS, iOS, Android 2.1+<br />
<br />
*'''Supported compilers''': [[Free Pascal]], [[Delphi]]<br />
<br />
*'''Graphics API''': [[OpenGL]], OpenGL ES 1.x, Direct3D 8/9<br />
<br />
*'''Sound API''': OpenAL, DirectSound<br />
<br />
*'''License''': zlib<br />
<br />
*'''Authors''': Andrey "Andru" Kemka, Sergey "Seenkao" Shutkin<br />
<br />
== Links ==<br />
<br />
*[https://code.google.com/archive/p/zengl/ Download ZenGL before version 3.12]<br />
*[https://github.com/skalogryz/zengl ZenGL Mirror on GitHub]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
---<br />
*[https://github.com/Seenkao/New-ZenGL ZenGL up to version 4.2 (version 4.2 has been archived and not tested, see version on SourceForge)]<br />
*[https://sourceforge.net/projects/new-zengl/ SourceForge - ZenGL 4.2 and higher source code]<br />
<br />
== Tutorial ==<br />
<br />
'''Attention!''' All examples are contained in the downloaded version of the library. At this time, this is relevant for all versions of ZenGL.<br />
These tutorials are not fully compatible with the latest version of ZenGL.<br />
<br />
[[ZenGL Tutorial]]: This is a first tutorial for ZenGL: download, installation, source paths, compilation (statically or with so/dll/dylib) (Windows dll), and the First program 'Initialization' that comes with ZenGL.<br />
<br />
[[ZenGL Tutorial 2]]: This is the second tutorial on how to create a font and draw text in the window.<br />
<br />
== Features ==<br />
<br />
* '''Main'''<br />
o can be used as so/dll/dylib or statically compiled with your application <br />
o rendering to own or any other prepared window<br />
o logging<br />
o resource loading from files, memory and '''zip''' archives<br />
o multithreaded resource loading<br />
o easy way to add support for new resource format<br />
* '''Configuration of'''<br />
o antialiasing, screen resolution, refresh rate and vertical synchronization<br />
o aspect correction<br />
o title, position and size of window<br />
o cursor visibility in window space<br />
* '''Input'''<br />
o handling of keyboard, mouse and joystick input<br />
o handling of Unicode text input<br />
o possibility to restrict the input to the Latin alphabet<br />
* '''Textures'''<br />
o supports '''tga''', '''png''', '''jpg''' and '''pvr'''<br />
o correct work with NPOT textures<br />
o control the filter parameters<br />
o masking<br />
o ''render targets'' for rendering into texture<br />
* '''Text'''<br />
o textured Unicode font<br />
o rendering UTF-8 text<br />
o rendering text with alignment and other options like size, color and count of symbols<br />
* '''2D subsystem'''<br />
o ''batch render'' for high-speed rendering<br />
o rendering different primitives<br />
o sprite engine<br />
o rendering static and animated sprites and tiles<br />
o rendering distortion grid<br />
o rendering sprites with new texture coordinates (with the pixel dimension and the usual 0..1)<br />
o control the blend mode and color mix mode<br />
o control the color and alpha of vertices of sprites and primitives<br />
o additional sprite transformations (flipping, zooming, vertices offset)<br />
o fast clipping of invisible sprites<br />
o 2D camera with ability to zoom and rotate the scene<br />
* '''Sound'''<br />
o works through OpenAL or DirectSound; depends on configuration or OS<br />
o correct work without soundcard<br />
o supports '''wav''' and '''ogg''' as sound sample formats<br />
o playing audio files in separate thread<br />
o control volume and playback speed<br />
o moving sound sources in 3D space<br />
* '''Video'''<br />
o decoding video frames into texture<br />
o supports '''theora''' codec in '''ogv''' container<br />
* '''Math'''<br />
o basic set of additional math functions<br />
o triangulation functions<br />
o basic set of collision functions<br />
* '''Additional'''<br />
o reading and writing INI files<br />
o functions for working with files and memory<br />
<br />
== In the updated version ==<br />
<br />
'''Attention!''' Basic information in Russian! Thank you for understanding.<br />
* Corrected compilation for android for FPC 3.2.0 and higher.<br />
* Moved the main code to correct the library<br />
* Edited work with Windows 64<br />
* Fixed minor bugs<br />
* Edited some demo versions (for FPC and iOS demos were not corrected, demo versions for Lazarus and Delphi were revised)<br />
* Introduced defines<br />
** define USE_EXIT_ESCAPE - exit. Ability not to write additional code to exit the program by pressing the Escape key<br />
** USE_INIT_HANDLE definition - for using ZenGL in an already created window (LCL/VCL)<br />
* Introduced support for MacOS Cocoa<br />
<br />
[[Category:Components]]<br />
[[Category:Graphics]]<br />
[[Category:Audio]]<br />
[[Category:Multimedia]]<br />
[[Category:Video]]<br />
[[Category:Game Development]]<br />
[[Category:Games]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL&diff=157386ZenGL2023-09-30T13:35:28Z<p>Seenkao: /* About */</p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index}}<br />
<br />
== About ==<br />
<br />
'''ZenGL''' - a cross-platform game development library, designed to provide necessary functionality for rendering 2D graphics, handling input, sound output, etc.<br />
<br />
*'''Supported OS''': GNU/Linux, Windows, macOS, iOS, Android 2.1+<br />
<br />
*'''Supported compilers''': [[Free Pascal]], [[Delphi]]<br />
<br />
*'''Graphics API''': [[OpenGL]], OpenGL ES 1.x, Direct3D 8/9<br />
<br />
*'''Sound API''': OpenAL, DirectSound<br />
<br />
*'''License''': zlib<br />
<br />
*'''Authors''': Andrey "Andru" Kemka, Sergey "Seenkao" Shutkin<br />
<br />
== Links ==<br />
<br />
*[http://zengl.org/download.html Download ZenGL]<br><br />
*[https://github.com/andru-kun/zengl ZenGL Mirror on GitHub]<br />
*[http://zengl.org/extra.html Extra Downloads]<br />
*[http://zengl.org/ Homepage]<br><br />
*[http://zengl.org/wiki Wiki]<br><br />
*[http://zengl.org/forum Official forum]<br><br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
---<br />
*[https://github.com/Seenkao/New-ZenGL A new version]<br />
<br />
== Tutorial ==<br />
<br />
'''Attention!''' All examples are contained in the downloaded version of the library. At this time, this is relevant for all versions of ZenGL.<br />
These tutorials are not fully compatible with the latest version of ZenGL.<br />
<br />
[[ZenGL Tutorial]]: This is a first tutorial for ZenGL: download, installation, source paths, compilation (statically or with so/dll/dylib) (Windows dll), and the First program 'Initialization' that comes with ZenGL.<br />
<br />
[[ZenGL Tutorial 2]]: This is the second tutorial on how to create a font and draw text in the window.<br />
<br />
== Features ==<br />
<br />
* '''Main'''<br />
o can be used as so/dll/dylib or statically compiled with your application <br />
o rendering to own or any other prepared window<br />
o logging<br />
o resource loading from files, memory and '''zip''' archives<br />
o multithreaded resource loading<br />
o easy way to add support for new resource format<br />
* '''Configuration of'''<br />
o antialiasing, screen resolution, refresh rate and vertical synchronization<br />
o aspect correction<br />
o title, position and size of window<br />
o cursor visibility in window space<br />
* '''Input'''<br />
o handling of keyboard, mouse and joystick input<br />
o handling of Unicode text input<br />
o possibility to restrict the input to the Latin alphabet<br />
* '''Textures'''<br />
o supports '''tga''', '''png''', '''jpg''' and '''pvr'''<br />
o correct work with NPOT textures<br />
o control the filter parameters<br />
o masking<br />
o ''render targets'' for rendering into texture<br />
* '''Text'''<br />
o textured Unicode font<br />
o rendering UTF-8 text<br />
o rendering text with alignment and other options like size, color and count of symbols<br />
* '''2D subsystem'''<br />
o ''batch render'' for high-speed rendering<br />
o rendering different primitives<br />
o sprite engine<br />
o rendering static and animated sprites and tiles<br />
o rendering distortion grid<br />
o rendering sprites with new texture coordinates (with the pixel dimension and the usual 0..1)<br />
o control the blend mode and color mix mode<br />
o control the color and alpha of vertices of sprites and primitives<br />
o additional sprite transformations (flipping, zooming, vertices offset)<br />
o fast clipping of invisible sprites<br />
o 2D camera with ability to zoom and rotate the scene<br />
* '''Sound'''<br />
o works through OpenAL or DirectSound; depends on configuration or OS<br />
o correct work without soundcard<br />
o supports '''wav''' and '''ogg''' as sound sample formats<br />
o playing audio files in separate thread<br />
o control volume and playback speed<br />
o moving sound sources in 3D space<br />
* '''Video'''<br />
o decoding video frames into texture<br />
o supports '''theora''' codec in '''ogv''' container<br />
* '''Math'''<br />
o basic set of additional math functions<br />
o triangulation functions<br />
o basic set of collision functions<br />
* '''Additional'''<br />
o reading and writing INI files<br />
o functions for working with files and memory<br />
<br />
== In the updated version ==<br />
<br />
'''Attention!''' Basic information in Russian! Thank you for understanding.<br />
* Corrected compilation for android for FPC 3.2.0 and higher.<br />
* Moved the main code to correct the library<br />
* Edited work with Windows 64<br />
* Fixed minor bugs<br />
* Edited some demo versions (for FPC and iOS demos were not corrected, demo versions for Lazarus and Delphi were revised)<br />
* Introduced defines<br />
** define USE_EXIT_ESCAPE - exit. Ability not to write additional code to exit the program by pressing the Escape key<br />
** USE_INIT_HANDLE definition - for using ZenGL in an already created window (LCL/VCL)<br />
* Introduced support for MacOS Cocoa<br />
<br />
[[Category:Components]]<br />
[[Category:Graphics]]<br />
[[Category:Audio]]<br />
[[Category:Multimedia]]<br />
[[Category:Video]]<br />
[[Category:Game Development]]<br />
[[Category:Games]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/ru&diff=157385ZenGL/ru2023-09-30T13:33:51Z<p>Seenkao: /* Ссылки */</p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index/ru}}<br />
<br />
== О ZenGL ==<br />
<br />
'''ZenGL''' - кросс-платформенная библиотека, разработанная, чтобы обеспечить необходимый функционал для отрисовки двухмерных игр, обработки устройств ввода, воспроизведение звука и музыки.<br />
<br />
*'''Поддерживаемые ОС''': GNU/Linux(32/64), Windows(32/64), macOS(Carbon/Cocoa), iOS, Android 2.1+<br />
<br />
*'''Компиляторы''': Free Pascal, Delphi<br />
<br />
*'''Графические API''': [https://wiki.freepascal.org/OpenGL/ru OpenGL], OpenGL ES 1.x, Direct3D 8/9<br />
<br />
*'''Аудио API''': OpenAL, DirectSound<br />
<br />
*'''Лицензия''': zlib<br />
<br />
В данное время библиотека дорабатывается.<br />
<br />
== Ссылки ==<br />
<br />
*[https://code.google.com/archive/p/zengl/ Download ZenGL до версии 3.12]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL До версии 4.2 (версия 4.2 уведена в архив и не тестирована, смотрите версию на SourceForge)]<br />
*[https://sourceforge.net/projects/new-zengl/ SourceForge - все последние версии]<br />
<br />
== Обучающие примеры ==<br />
<br />
'''Внимание!''' Все примеры содержатся в скачиваемой версии библиотеки (в новых версиях они могут незначительно, но критично для работы разрабатываемой программы, отличаться).<br />
<br />
[[ZenGL Tutorial]]: Первый пример для ZenGL знакомит с самой библиотекой. Рассказывается о том как скачать, установить библиотеку. Настроить компилятор (среду разработки) для компиляции проектов. Сборка проекта как статической так динамической библиотекой ZenGL. А так же рассматривается одна и программ-примеров 'Initialization', которая входит в библиотеку ZenGL.<br />
<br />
[[ZenGL Tutorial 2]]: Второй пример рассказывает о том, как создавать шрифты и выводить текст на экран.<br />
<br />
== Возможности библиотеки ==<br />
<br />
*Основные<br />
** библиотека может быть скомпилирована статически к проекту, или использоваться, как динамическая библиотека (в обновлённой версии только статическая компиляция)<br />
** рендеринг как в собственное, так и в заранее подготовленное окно (LCL, VCL)<br />
** журнал событий <br />
** загрузка ресурсов из файлов, памяти и '''zip''' архивов<br />
** многопоточная загрузка ресурсов<br />
** возможность расширить количество поддерживаемых форматов данных<br />
* Возможности настройки графики<br />
** Сглаживание (antialiasing), разрешение и частоту обновления экрана (screen resolution, refresh rate) а так же контролировать вертикальную синхронизацию (v-sync)<br />
** коррекция пропорций выводимого изображения относительно заданных размеров<br />
** управление заголовком и размером окна, наличие автоматического центрирования<br />
** управление видимостью курсора в пределах окна<br />
* Устройства ввода<br />
** обработка событий клавиатуры, мыши и джойстика<br />
** ввод Unicode символов<br />
** возможность ограничить ввод только латинской раскладкой<br />
*Вывод Текстур<br />
** поддержка форматов '''tga''', '''png''', '''jpg''' и '''pvr'''<br />
** поддержка текстур размером не кратным 2 (Non Power Of Two)<br />
** управление параметрами фильтрации<br />
** работа с масками<br />
** ''render targets'' отрисовка в текстуры<br />
*Вывод текста<br />
** реализация Unicode шрифты на основе текстур<br />
** вывод UTF-8 текста<br />
** управление отступами, размером, цветом вершин и количеством символов в тексте<br />
*2D подсистема<br />
** ''batch render'' для повышения производительности рендеринга<br />
** рендеринг основных видов примитивов<br />
** спрайтовый движок<br />
** вывод статических и анимированных спрайтов и тайлов<br />
** рендеринг трансформирующейся сетки<br />
** рендеринг спрайтов с ручным указанием текстурных координат(с пиксельной размерностью и обычным 0..1)<br />
** управление режимом блендинга и смешивания цвета<br />
** возможность назначения цвета и альфы отдельным вершинам спрайтов и примитивов<br />
** дополнительные трансформации спрайтов(зеркальное отражения, увеличение, смещение вершин)<br />
** быстрое отсечение спрайтов выходящих за пределы видимости<br />
** наличие 2D камеры с возможностью увеличения и поворота содержимого сцены<br />
* Звук<br />
** вывод звука с помощью библиотек OpenAL или DirectSound (зависит от настроек проекта и операционной системы)<br />
** возможность правильной работы, даже при отсутствии звуковой карты <br />
** поддержка форматов '''wav''' и 'ogg'''<br />
** потоковое воспроизведение аудио-файлов<br />
** контроль за громкостью звука и темпом воспроизведения<br />
** трехмерное позиционирование источника звука в пространстве<br />
* Видео<br />
** декодирование видео заставок в текстуры <br />
** поддержка кодека '''theora''' в формате '''ogv''' <br />
* Математический вычисление <br />
** базовый набор вспомогательных мат. функций<br />
** необходимый набор функций для триангуляции<br />
** простейшие функции проверки столкновений <br />
* Доплнительно<br />
** чтение и запись INI файлов<br />
** дополнительные функции для работы с файлами и памятью<br />
<br />
== В обновлённой версии ==<br />
<br />
*Корректирована компиляция под android под версию FPC 3.2.0 и выше.<br />
*Скомпилированы библиотеки (Ogg, Vorbis, Theora) для всех архитектур Android: x86, x86_64, ARM32 и ARM64.<br />
*Перебран основной код для коррекции работы библиотеки<br />
*Редактирована работа с Windows 64<br />
*Исправлены мелкие баги<br />
*Редактированы демо-версии (для iOS демки не правились, перебраны демо-версии для Lazarus, FPC и Delphi)<br />
*Введены DEFINE<br />
** define - USE_EXIT_ESCAPE - выход. Возможность не писать дополнительный код для выхода из программы по нажатию клавиши Escape<br />
** define - USE_INIT_HANDLE - для использования ZenGL в уже созданное окно (LCL/VCL)<br />
*Введена поддержка MacOS Cocoa<br />
*Редактирована работа с таймерами<br />
*Редактирована работа со шрифтами<br />
*Редактирована работа с LCL/VCL<br />
<br />
Добавлен внутренний движок, основанный на функциональности ZenGL - Green Engine.<br />
<br />
Возможности Green Engine:<br />
<br />
- собственное поле ввода и его функциональность.<br />
<br />
<br />
Ведётся документация внутри модулей ZenGL.<br />
<br />
Так же смотрите обновления в файле ''Update _ZenGL.txt'' (на русском).<br />
<br />
{{AutoCategory}}<br />
[[Category:Components/ru]]<br />
[[Category:Graphics/ru]]<br />
[[Category:Audio/ru]]<br />
[[Category:Video/ru]]<br />
[[Category:Multimedia/ru]]<br />
[[Category:Game Development/ru]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/ru&diff=157384ZenGL/ru2023-09-30T13:32:53Z<p>Seenkao: /* Ссылки */</p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index/ru}}<br />
<br />
== О ZenGL ==<br />
<br />
'''ZenGL''' - кросс-платформенная библиотека, разработанная, чтобы обеспечить необходимый функционал для отрисовки двухмерных игр, обработки устройств ввода, воспроизведение звука и музыки.<br />
<br />
*'''Поддерживаемые ОС''': GNU/Linux(32/64), Windows(32/64), macOS(Carbon/Cocoa), iOS, Android 2.1+<br />
<br />
*'''Компиляторы''': Free Pascal, Delphi<br />
<br />
*'''Графические API''': [https://wiki.freepascal.org/OpenGL/ru OpenGL], OpenGL ES 1.x, Direct3D 8/9<br />
<br />
*'''Аудио API''': OpenAL, DirectSound<br />
<br />
*'''Лицензия''': zlib<br />
<br />
В данное время библиотека дорабатывается.<br />
<br />
== Ссылки ==<br />
<br />
*[https://code.google.com/archive/p/zengl/ Download ZenGL до версии 3.12]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL До версии 4.2 (уведена в архив и не тестирована)]<br />
*[https://sourceforge.net/projects/new-zengl/ SourceForge - все последние версии]<br />
<br />
== Обучающие примеры ==<br />
<br />
'''Внимание!''' Все примеры содержатся в скачиваемой версии библиотеки (в новых версиях они могут незначительно, но критично для работы разрабатываемой программы, отличаться).<br />
<br />
[[ZenGL Tutorial]]: Первый пример для ZenGL знакомит с самой библиотекой. Рассказывается о том как скачать, установить библиотеку. Настроить компилятор (среду разработки) для компиляции проектов. Сборка проекта как статической так динамической библиотекой ZenGL. А так же рассматривается одна и программ-примеров 'Initialization', которая входит в библиотеку ZenGL.<br />
<br />
[[ZenGL Tutorial 2]]: Второй пример рассказывает о том, как создавать шрифты и выводить текст на экран.<br />
<br />
== Возможности библиотеки ==<br />
<br />
*Основные<br />
** библиотека может быть скомпилирована статически к проекту, или использоваться, как динамическая библиотека (в обновлённой версии только статическая компиляция)<br />
** рендеринг как в собственное, так и в заранее подготовленное окно (LCL, VCL)<br />
** журнал событий <br />
** загрузка ресурсов из файлов, памяти и '''zip''' архивов<br />
** многопоточная загрузка ресурсов<br />
** возможность расширить количество поддерживаемых форматов данных<br />
* Возможности настройки графики<br />
** Сглаживание (antialiasing), разрешение и частоту обновления экрана (screen resolution, refresh rate) а так же контролировать вертикальную синхронизацию (v-sync)<br />
** коррекция пропорций выводимого изображения относительно заданных размеров<br />
** управление заголовком и размером окна, наличие автоматического центрирования<br />
** управление видимостью курсора в пределах окна<br />
* Устройства ввода<br />
** обработка событий клавиатуры, мыши и джойстика<br />
** ввод Unicode символов<br />
** возможность ограничить ввод только латинской раскладкой<br />
*Вывод Текстур<br />
** поддержка форматов '''tga''', '''png''', '''jpg''' и '''pvr'''<br />
** поддержка текстур размером не кратным 2 (Non Power Of Two)<br />
** управление параметрами фильтрации<br />
** работа с масками<br />
** ''render targets'' отрисовка в текстуры<br />
*Вывод текста<br />
** реализация Unicode шрифты на основе текстур<br />
** вывод UTF-8 текста<br />
** управление отступами, размером, цветом вершин и количеством символов в тексте<br />
*2D подсистема<br />
** ''batch render'' для повышения производительности рендеринга<br />
** рендеринг основных видов примитивов<br />
** спрайтовый движок<br />
** вывод статических и анимированных спрайтов и тайлов<br />
** рендеринг трансформирующейся сетки<br />
** рендеринг спрайтов с ручным указанием текстурных координат(с пиксельной размерностью и обычным 0..1)<br />
** управление режимом блендинга и смешивания цвета<br />
** возможность назначения цвета и альфы отдельным вершинам спрайтов и примитивов<br />
** дополнительные трансформации спрайтов(зеркальное отражения, увеличение, смещение вершин)<br />
** быстрое отсечение спрайтов выходящих за пределы видимости<br />
** наличие 2D камеры с возможностью увеличения и поворота содержимого сцены<br />
* Звук<br />
** вывод звука с помощью библиотек OpenAL или DirectSound (зависит от настроек проекта и операционной системы)<br />
** возможность правильной работы, даже при отсутствии звуковой карты <br />
** поддержка форматов '''wav''' и 'ogg'''<br />
** потоковое воспроизведение аудио-файлов<br />
** контроль за громкостью звука и темпом воспроизведения<br />
** трехмерное позиционирование источника звука в пространстве<br />
* Видео<br />
** декодирование видео заставок в текстуры <br />
** поддержка кодека '''theora''' в формате '''ogv''' <br />
* Математический вычисление <br />
** базовый набор вспомогательных мат. функций<br />
** необходимый набор функций для триангуляции<br />
** простейшие функции проверки столкновений <br />
* Доплнительно<br />
** чтение и запись INI файлов<br />
** дополнительные функции для работы с файлами и памятью<br />
<br />
== В обновлённой версии ==<br />
<br />
*Корректирована компиляция под android под версию FPC 3.2.0 и выше.<br />
*Скомпилированы библиотеки (Ogg, Vorbis, Theora) для всех архитектур Android: x86, x86_64, ARM32 и ARM64.<br />
*Перебран основной код для коррекции работы библиотеки<br />
*Редактирована работа с Windows 64<br />
*Исправлены мелкие баги<br />
*Редактированы демо-версии (для iOS демки не правились, перебраны демо-версии для Lazarus, FPC и Delphi)<br />
*Введены DEFINE<br />
** define - USE_EXIT_ESCAPE - выход. Возможность не писать дополнительный код для выхода из программы по нажатию клавиши Escape<br />
** define - USE_INIT_HANDLE - для использования ZenGL в уже созданное окно (LCL/VCL)<br />
*Введена поддержка MacOS Cocoa<br />
*Редактирована работа с таймерами<br />
*Редактирована работа со шрифтами<br />
*Редактирована работа с LCL/VCL<br />
<br />
Добавлен внутренний движок, основанный на функциональности ZenGL - Green Engine.<br />
<br />
Возможности Green Engine:<br />
<br />
- собственное поле ввода и его функциональность.<br />
<br />
<br />
Ведётся документация внутри модулей ZenGL.<br />
<br />
Так же смотрите обновления в файле ''Update _ZenGL.txt'' (на русском).<br />
<br />
{{AutoCategory}}<br />
[[Category:Components/ru]]<br />
[[Category:Graphics/ru]]<br />
[[Category:Audio/ru]]<br />
[[Category:Video/ru]]<br />
[[Category:Multimedia/ru]]<br />
[[Category:Game Development/ru]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/ru&diff=157383ZenGL/ru2023-09-30T13:31:54Z<p>Seenkao: </p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index/ru}}<br />
<br />
== О ZenGL ==<br />
<br />
'''ZenGL''' - кросс-платформенная библиотека, разработанная, чтобы обеспечить необходимый функционал для отрисовки двухмерных игр, обработки устройств ввода, воспроизведение звука и музыки.<br />
<br />
*'''Поддерживаемые ОС''': GNU/Linux(32/64), Windows(32/64), macOS(Carbon/Cocoa), iOS, Android 2.1+<br />
<br />
*'''Компиляторы''': Free Pascal, Delphi<br />
<br />
*'''Графические API''': [https://wiki.freepascal.org/OpenGL/ru OpenGL], OpenGL ES 1.x, Direct3D 8/9<br />
<br />
*'''Аудио API''': OpenAL, DirectSound<br />
<br />
*'''Лицензия''': zlib<br />
<br />
В данное время библиотека дорабатывается.<br />
<br />
== Ссылки ==<br />
<br />
*[https://code.google.com/archive/p/zengl/ Download ZenGL 3.12 and other]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL До версии 4.2 (уведена в архив и не тестирована)]<br />
*[https://sourceforge.net/projects/new-zengl/ SourceForge - все последние версии]<br />
<br />
== Обучающие примеры ==<br />
<br />
'''Внимание!''' Все примеры содержатся в скачиваемой версии библиотеки (в новых версиях они могут незначительно, но критично для работы разрабатываемой программы, отличаться).<br />
<br />
[[ZenGL Tutorial]]: Первый пример для ZenGL знакомит с самой библиотекой. Рассказывается о том как скачать, установить библиотеку. Настроить компилятор (среду разработки) для компиляции проектов. Сборка проекта как статической так динамической библиотекой ZenGL. А так же рассматривается одна и программ-примеров 'Initialization', которая входит в библиотеку ZenGL.<br />
<br />
[[ZenGL Tutorial 2]]: Второй пример рассказывает о том, как создавать шрифты и выводить текст на экран.<br />
<br />
== Возможности библиотеки ==<br />
<br />
*Основные<br />
** библиотека может быть скомпилирована статически к проекту, или использоваться, как динамическая библиотека (в обновлённой версии только статическая компиляция)<br />
** рендеринг как в собственное, так и в заранее подготовленное окно (LCL, VCL)<br />
** журнал событий <br />
** загрузка ресурсов из файлов, памяти и '''zip''' архивов<br />
** многопоточная загрузка ресурсов<br />
** возможность расширить количество поддерживаемых форматов данных<br />
* Возможности настройки графики<br />
** Сглаживание (antialiasing), разрешение и частоту обновления экрана (screen resolution, refresh rate) а так же контролировать вертикальную синхронизацию (v-sync)<br />
** коррекция пропорций выводимого изображения относительно заданных размеров<br />
** управление заголовком и размером окна, наличие автоматического центрирования<br />
** управление видимостью курсора в пределах окна<br />
* Устройства ввода<br />
** обработка событий клавиатуры, мыши и джойстика<br />
** ввод Unicode символов<br />
** возможность ограничить ввод только латинской раскладкой<br />
*Вывод Текстур<br />
** поддержка форматов '''tga''', '''png''', '''jpg''' и '''pvr'''<br />
** поддержка текстур размером не кратным 2 (Non Power Of Two)<br />
** управление параметрами фильтрации<br />
** работа с масками<br />
** ''render targets'' отрисовка в текстуры<br />
*Вывод текста<br />
** реализация Unicode шрифты на основе текстур<br />
** вывод UTF-8 текста<br />
** управление отступами, размером, цветом вершин и количеством символов в тексте<br />
*2D подсистема<br />
** ''batch render'' для повышения производительности рендеринга<br />
** рендеринг основных видов примитивов<br />
** спрайтовый движок<br />
** вывод статических и анимированных спрайтов и тайлов<br />
** рендеринг трансформирующейся сетки<br />
** рендеринг спрайтов с ручным указанием текстурных координат(с пиксельной размерностью и обычным 0..1)<br />
** управление режимом блендинга и смешивания цвета<br />
** возможность назначения цвета и альфы отдельным вершинам спрайтов и примитивов<br />
** дополнительные трансформации спрайтов(зеркальное отражения, увеличение, смещение вершин)<br />
** быстрое отсечение спрайтов выходящих за пределы видимости<br />
** наличие 2D камеры с возможностью увеличения и поворота содержимого сцены<br />
* Звук<br />
** вывод звука с помощью библиотек OpenAL или DirectSound (зависит от настроек проекта и операционной системы)<br />
** возможность правильной работы, даже при отсутствии звуковой карты <br />
** поддержка форматов '''wav''' и 'ogg'''<br />
** потоковое воспроизведение аудио-файлов<br />
** контроль за громкостью звука и темпом воспроизведения<br />
** трехмерное позиционирование источника звука в пространстве<br />
* Видео<br />
** декодирование видео заставок в текстуры <br />
** поддержка кодека '''theora''' в формате '''ogv''' <br />
* Математический вычисление <br />
** базовый набор вспомогательных мат. функций<br />
** необходимый набор функций для триангуляции<br />
** простейшие функции проверки столкновений <br />
* Доплнительно<br />
** чтение и запись INI файлов<br />
** дополнительные функции для работы с файлами и памятью<br />
<br />
== В обновлённой версии ==<br />
<br />
*Корректирована компиляция под android под версию FPC 3.2.0 и выше.<br />
*Скомпилированы библиотеки (Ogg, Vorbis, Theora) для всех архитектур Android: x86, x86_64, ARM32 и ARM64.<br />
*Перебран основной код для коррекции работы библиотеки<br />
*Редактирована работа с Windows 64<br />
*Исправлены мелкие баги<br />
*Редактированы демо-версии (для iOS демки не правились, перебраны демо-версии для Lazarus, FPC и Delphi)<br />
*Введены DEFINE<br />
** define - USE_EXIT_ESCAPE - выход. Возможность не писать дополнительный код для выхода из программы по нажатию клавиши Escape<br />
** define - USE_INIT_HANDLE - для использования ZenGL в уже созданное окно (LCL/VCL)<br />
*Введена поддержка MacOS Cocoa<br />
*Редактирована работа с таймерами<br />
*Редактирована работа со шрифтами<br />
*Редактирована работа с LCL/VCL<br />
<br />
Добавлен внутренний движок, основанный на функциональности ZenGL - Green Engine.<br />
<br />
Возможности Green Engine:<br />
<br />
- собственное поле ввода и его функциональность.<br />
<br />
<br />
Ведётся документация внутри модулей ZenGL.<br />
<br />
Так же смотрите обновления в файле ''Update _ZenGL.txt'' (на русском).<br />
<br />
{{AutoCategory}}<br />
[[Category:Components/ru]]<br />
[[Category:Graphics/ru]]<br />
[[Category:Audio/ru]]<br />
[[Category:Video/ru]]<br />
[[Category:Multimedia/ru]]<br />
[[Category:Game Development/ru]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=Game_framework&diff=157382Game framework2023-09-30T13:05:25Z<p>Seenkao: </p>
<hr />
<div>{{Menu_Game_Development}}<br />
<br />
A '''game framework''' is a library designed to help game development. It usually defines [https://en.wikipedia.org/wiki/Application_programming_interface APIs] to deal with [[Graphics libraries|graphics]], sound, user input, data files, etc. In most cases it defines a high-level API that allows cross-platform development.<br />
<br />
Main difference between game frameworks and [[Game Engine|game engines]] is that the latter also implements the game loop, as well as complex data structures (maps, actors...), data containers and tools.<br />
<br />
==Game frameworks==<br />
<br />
{| class="wikitable sortable" width="100%"<br />
! Name <br />
! Site <br />
! Usage<br />
! License<br />
! Notes<br />
|-<br />
| [[FPC_and_Allegro|Allegro]]<br />
| [http://liballeg.org/ liballeg.org]<br />
| [http://allegro-pas.sourceforge.net/ Bindings Allegro-pas]<br />
| Allegro 1-4: Beerware, Allegro 5: zlib<br />
| Allegro is a cross-platform library mainly aimed at video game and multimedia programming. It handles common, low-level tasks such as creating windows, accepting user input, loading data, drawing images, playing sounds, etc. and generally abstracting away the underlying platform.<br />
|-<br />
| Phoenix<br />
| [https://github.com/GuvaCode/PGF GitHub]<br />
| FPC/Delphi<br />
| Mozilla Public License<br />
| A set of Delphi 7+ and Free Pascal components and classes to help in creating hardware accelerated 2D and 3D games.<br />
|-<br />
| [[GLScene]]<br />
| [http://glscene.sourceforge.net/ SourceForge] <br />
| FPC/Delphi<br />
| Mozilla Public License<br />
| GLScene is a free OpenGL-based library for the Delphi programming language, C++ and Free Pascal. It provides visual components and objects allowing description and rendering of 3D scenes.<br />
|-<br />
| Raylib<br />
| [https://www.raylib.com/ www.raylib.com] <br />
| FPC/Lazarus [https://github.com/sysrpl/Raylib.4.0.Pascal Raylib 4.0 Pascal Bindings]<br />
| Zlib<br />
| Raylib is a popular game development toolkit in the computer programming education space. It provides windowing, input, graphics, text, audio, collision detection, and a basic GUI. The official website contains many examples and an easy to learn and use documentation cheatsheet. <br />
|-<br />
| SFML<br />
| [https://www.sfml-dev.org/ www.sfml-dev.org] <br />
| FPC/Lazarus [https://github.com/DJMaster/csfml-fpc SFML headers] [https://github.com/CWBudde/PasSFML PasSFML(OOP)]<br />
| <br />
| SFML is a simple, fast, cross-platform and object-oriented multimedia API. It provides access to windowing, graphics, audio and network. <br />
|-<br />
| SDL<br />
| [http://www.libsdl.org www.libsdl.org] <br />
| [https://github.com/PascalGameDevelopment/SDL2-for-Pascal SDL2 for Pascal] [http://sourceforge.net/projects/sdl2fpc/?source=directory SDL2 bindings for FPC] [https://sourceforge.net/projects/lazsdl2/ Laz2SDL] [https://github.com/ev1313/Pascal-SDL-2-Headers SDL2 Headers] <br />
| SDL2: [http://libsdl.org/license.php zlib]<br />
| Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.<br />
|-<br />
| [[ZenGL]]<br />
| [https://sourceforge.net/projects/new-zengl/ SourceForge] <br />
| FPC/Delphi<br />
| [http://www.zengl.org/license.html Zlib]<br />
| Cross-platform game development library written in Pascal, designed to provide necessary functionality for rendering 2D-graphics, handling input, sound output, etc.<br />
|}<br />
<br />
==Other libraries for games==<br />
Libraries that aren't to create games but are useful. <br />
<br />
{| class="wikitable sortable" width="100%"<br />
! Name <br />
! Site <br />
! Usage<br />
! License<br />
! Notes<br />
|-<br />
| [[Steam Wrapper]]<br />
| [https://github.com/thecocce/steamwrapper https://github.com/thecocce/steamwrapper] <br />
| FPC/Delphi<br />
|<br />
| Cross-platform game development wrapper written in Pascal, designed to provide necessary functionality for rendering 2D-graphics, handling input, sound output, etc.<br />
|}<br />
<br />
==Using LCL for game development==<br />
1) From forum member '''furious programming'''.<br />
<br />
I suggest not to waste your time on LCL to build games, because it is not suitable for creating games for many reasons, including the most important:<br />
<br />
* no Direct3D and OpenGL support<br />
* unable to use GPU for rendering textures<br />
* no exclusive video mode support and available screen resolutions<br />
* absolutely no support for sound mixer and playing multiple sounds at the same time<br />
* lack of support for game controllers and their full functionality<br />
* lack o V-Sync support<br />
<br />
What I mentioned above are the basics, without which creating even a simple game will be inconvenient, the game itself will be very limited, and its performance will be very low (software rendering is horribly slow in compare to GPU rendering). As you can see, it doesn't make much sense.<br />
<br />
Whether you want to make a tiny game or a bigger one, use the library dedicated to their creation. It does not have to be SDL, but it is important that it has all the functionality to create full-fledged video games. However, if you are interested in creating a 2D game, I strongly advise you not to use 3D engines for this purpose, because it will significantly complicate the implementation, and you will get discouraged very quickly.<br />
<br />
Use something small, light, functional and, above all, supported at all times. I suggest SDL because it meets all the requirements and is great, but it can also be Allegro, because it's the same shelf.<br />
<br />
2) From forum member '''Seenkao'''.<br />
<br />
There are quite a few solutions for using both LCL and OpenGL/DirectX at the same time. They can be seen in neighboring topics and on the Free Pascal wiki. In the German forum, almost all OpenGL tutorials are made under LCL. dglOpenGL.pas - allows you to work with LCL on Windows without much knowledge of creating an OpenGL window/context.<br />
<br />
* [[OpenGL Tutorial]]<br />
* [https://wiki.delphigl.com/index.php/Lazarus_-_OpenGL_3.3_Tutorial dglOpenGL tutorial, Deutsch]<br />
* [https://forum.lazarus.freepascal.org/index.php/topic,42306.0.html Metal, OpenGL demos]<br />
* [[GLScene]]<br />
* [https://github.com/Dev-Demi/GLEngine2D GLEngine2D], based on dglOpenGL. Deprecated. But it works.<br />
* [[Game Engine]]<br />
<br />
I don't even think I can fully cover this topic. And there's a good chance I'll miss something. LCL can also be used with SDL, Castle Game Engine, PGF, Apus Game Engine, ZenGL and many other engines.<br />
Connecting controllers does not depend at all on what we use. To do this, you just need to use the necessary libraries. Often that already come with game engines. And it can also be used in LCL.<br />
With sound, no one forbids the use of single-channel / multi-channel sound. All this is provided in the respective libraries. And it can also be used in LCL.<br />
<br />
The only reason this is not a suitable option is if you have a highly loaded application. Here I partly agree! In simple games, this has almost no effect.<br />
<br />
==See also==<br />
* [[Graphics libraries]]<br />
* [[Game Engine|Game engine]]<br />
<br />
[[Category:Game Development]] [[Category:Games]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/fr&diff=148687ZenGL/fr2021-12-17T07:23:56Z<p>Seenkao: </p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index/fr}}<br />
<br />
== L'essentiel ==<br />
ZenGL - bibliothèque de développement de jeu multi plate-forme, conçue pour fournir les fonctionnalités nécessaire pour le rendu des graphiques 2D, traitement des entrées, sortie sonores, etc.<br />
<br />
'''OS supportés''': GNU/Linux, Windows, macOS, iOS, Android 2.1+<br/><br />
'''Compilateurs supportés''': FreePascal, Delphi<br/><br />
'''API Graphique''': OpenGL, OpenGL ES 1.x, Direct3D 8/9<br/><br />
'''API de son''': OpenAL, DirectSound<br/><br />
'''Licence''': [http://zengl.org/license.html zlib]<br />
<br />
== Liens ==<br />
<br />
*[http://zengl.org/download.html Télécharger ZenGL]<br />
*[http://zengl.org/extra.html Téléchargement d'Extras]<br />
*[http://zengl.org/ Page d'accueil]<br />
*[http://zengl.org/wiki Wiki]<br />
*[http://zengl.org/forum Forum officiel]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL Une nouvelle version]<br />
<br />
== Tutoriel ==<br />
<br />
'''Attention!''' Tous les exemples sont contenus dans la version téléchargée de la bibliothèque (dans les nouvelles versions, ils peuvent différer légèrement, mais critiques pour le travail du programme développé).<br />
<br />
[[ZenGL Tutorial/fr|Tutoriel ZenGL]] : C'est le premier tutoriel pour ZenGL : téléchargement, installation, chemins des sources, compilation (statiquement ou avec so/dll/dylib) (Windows dll), et le premier programme 'Initialization' qui vient avec ZenGL.<br/><br />
[[ZenGL Tutorial 2/fr|Tutoriel ZenGL 2]] : C'est le second tutoriel sur comment créer une fonte et dessiner du texte dans la fenêtre.<br />
<br />
== Caractéristiques ==<br />
<br />
* '''Principal'''<br />
o peut être utilisé comme so/dll/dylib ou statiquement compilé avec votre application<br />
o rendu en propre ("to own") ou vers toute autre fenêtre préparée<br />
o enregistrement ("logging")<br />
o chargement de ressource depuis des fichiers, la mémoire et archives '''zip'''<br />
o chargement de ressource multi-threadé<br />
o ajout facilité du support de nouveau format de ressource<br />
* '''Configuration'''<br />
o anticrénelage ("antialiasing"), résolution d'écran, taux de rafraichissement et synchronisation verticale<br />
o correction d'aspect<br />
o titre, position et taille de la fenêtre<br />
o visibilité du curseur dans l'espace de la fenêtre<br />
* '''Entrée'''<br />
o traitement du clavier, de la souris et de l'entrée joystick<br />
o traitement de l'entrée de texte Unicode<br />
o possibilité de restreindre l'entrée à l'alphabet latin<br />
* '''Textures'''<br />
o supporte '''tga''', '''png''', '''jpg''' et '''pvr'''<br />
o fonctionnement correct avec les [https://www.opengl.org/wiki/NPOT_Texture textures NPOT] (non puissance de 2)<br />
o contrôle des paramètres de filtre<br />
o masquage<br />
o ''cibles de rendu''("render targets") pour le rendu en texture<br />
* '''Texte'''<br />
o font Unicode texturée<br />
o rendu de texte UTF-8<br />
o rendu de texte avec alignement et autres options comme la taille, la couleur et le compte de symbole ("count of symbols")<br />
* '''sous-système 2D'''<br />
o ''rendu différé'' ("batch render") pour le rendu à haute vitesse<br />
o rendu de différentes primitives<br />
o moteur de lutin ("sprite")<br />
o rendu de lutins et tuiles ("tiles") statiques et animé.<br />
o rendu de grille de distortion<br />
o rendu des lutins avec de nouvelles coordonnées de textures (avec la dimension de pixel et l'habituel 0..1)<br />
o contrôle du mode de mélange et du mode mix de couleurs ("color mix mode")<br />
o contrôle de la couleur et de l'alpha des sommets des lutins et primitives<br />
o transformations supplémentaires de lutin (flipping, zoom ("zooming"), décalage de sommets ("vertices offset"))<br />
o découpage ("clipping") rapide des lutins invisibles<br />
o caméra 2D avec possibilité de zoom et de rotation de la scène<br />
* '''Son'''<br />
o fonctionne à travers OpenAL ou DirectSound; selon la configuration et le système d'exploitation<br />
o marche correctement avec la carte son<br />
o supporte '''wav''' et '''ogg''' comme formats des échantillons sonores<br />
o lecture des fichiers audio dans un thread séparé<br />
o contrôle du volume et de la vitesse de lecture<br />
o déplacement des sources sonores dans l'espace 3D<br />
* '''Vidéo'''<br />
o décodage des trames vidéo dans la texture<br />
o supporte le codec '''theora''' dans un conteneur '''ogv'''<br />
* '''Maths'''<br />
o ensemble de base de fonctions mathématiques supplémentaires<br />
o fonctions de triangulation<br />
o ensemble de base de fonctions de collision<br />
* '''Supplément'''<br />
o lecture et écriture de fichier INI<br />
o fonctions pour travailler avec les fichiers et la mémoire<br />
<br/><br />
<br />
== Dans la nouvelle version ==<br />
<br />
* Correction de la compilation pour Android pour FPC 3.2.0 et supérieur.<br />
* Déplacement du code principal pour corriger la bibliothèque<br />
* Travail édité avec Windows 64<br />
* Correction de bugs mineurs<br />
* Versions de démonstration éditées (pour iOS, les démos n'ont pas été corrigées, les versions de démonstration pour Lazarus, FPC et Delphi ont été révisées)<br />
* Introduit par DEFINE<br />
** define - USE_EXIT_ESCAPE - quitter. Possibilité de ne pas écrire de code supplémentaire pour quitter le programme en appuyant sur la touche Échap<br />
** define - USE_INIT_HANDLE - pour utiliser ZenGL dans une fenêtre déjà créée (LCL/VCL)<br />
* Prise en charge introduite pour macOS Cocoa<br />
* Changé: travailler avec des minuteries, travailler avec des polices, travailler avec LCL/VCL</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/es&diff=148686ZenGL/es2021-12-17T07:23:29Z<p>Seenkao: </p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index/es}}<br />
<br />
== Principal ==<br />
ZenGL - librería de desarrollo de juegos multi-platforma, diseñado para proporcionar la funcionalidad necesaria para la generación de gráficos 2D, manejo de la entrada, de la salida, del sonido, etc<br />
<br />
'''SO Soportados''': GNU/Linux, Windows, macOS<br><br />
'''Compiladores soportados''': FreePascal, Delphi<br><br />
'''API de Gráficos''': OpenGL, Direct3D 8/9<br><br />
'''API de Sonido''': OpenAL, DirectSound<br><br />
'''Licencia''': GNU LGPL version 3<br />
<br />
''*'' Disponible en versión [http://code.google.com/p/zengl/source/checkout svn]<br />
<br />
== Enlaces ==<br />
<br />
*[http://zengl.org/download.html Descargar ZenGL]<br><br />
*[http://zengl.org/extra.html Descargar Extras]<br />
*[http://zengl.org/ Página Principal]<br><br />
*[http://zengl.org/wiki Wiki]<br><br />
*[http://zengl.org/forum Foro Oficial]<br><br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL Una nueva version]<br />
<br />
== Tutorial ==<br />
<br />
'''¡Atención!''' Todos los ejemplos están contenidos en la versión descargada de la biblioteca (en las nuevas versiones pueden diferir levemente, pero son fundamentales para el trabajo del programa desarrollado).<br />
<br />
[[ZenGL Tutorial/es]]: Este es un primer tutorial para ZenGL: descarga, instalación, rutas del código fuente, compilación (estática o con so/dll/dylib) (Windows dll), y el primer programa 'Inicialización' que viene con ZenGL.<br />
<br />
[[ZenGL Tutorial 2/es]]: Este es el segundo tutorial que muestra como crear una fuente y dibujar texto en la ventana.<br />
<br />
== Caracteristicas ==<br />
<br />
* '''Principal'''<br />
o puede ser usado como so/dll/dylib o estáticamente compilado con tu aplicación<br />
o renderizar para la propia o alguna otra ventana preparada<br />
o logging<br />
o carga de recursos desde archivos y memoria<br />
o forma fácil para agregar soporte para nuevos formatos de recursos<br />
* '''Configurción de'''<br />
o antialiasing, resolución de pantalla, tasa de refresco y sincronización vertical<br />
o corrección del aspecto<br />
o título, posición y tamaño de la ventana<br />
o visibilidad del cursor en el espacio de la ventana<br />
* '''Entrada'''<br />
o manejar entrada del teclado, ratón y mando<br />
o manejar entrada de texto Unicode<br />
o posibilidad de restringir la entrada al alfabeto Latín<br />
* '''Texturas'''<br />
o soporta '''tga''', '''png''' y '''jpg'''<br />
o trabaja correctamente con texturas NPOT<br />
o controla los parámetros de filtros<br />
o máscaras<br />
o ''objetivos de renderizado'' para renderizar en textura<br />
* '''Texto'''<br />
o fuente-Unicode texturizada<br />
o renderizar texto UTF-8 o ANSI<br />
o renderizar texto con alineamiento y otras opciones como tamaño, color y conteo de símbolos<br />
* '''Subsistema-2D'''<br />
o ''renderizado en lote'' para renderizado de alta velocidad<br />
o renderizar diferentes primitivas<br />
o motor de sprites<br />
o renderizar sprites y azulejos estáticos y animados<br />
o renderizar grilla de distorsión<br />
o renderizar sprites con coordenadas de nueva textura (con la dimensión del píxel y el usual 0..1)<br />
o controlar el modo de mezcla y mezcla de color<br />
o controlar el color y opacidad de los vertices de sprites y primitivas<br />
o transformaciones adicionales de sprite (girado, zoom, desplazamiento de vértices)<br />
o recorte rápido de sprites invisibles<br />
o camara 2d con la capacidad de zoom y rotar la escena<br />
* '''Sonido'''<br />
o trabaja a través de OpenAL o DirectSound, dependiendo de la configuración o el SO<br />
o trabaja correctamente sin placa de sonido<br />
o soporta '''wav''' y '''ogg''' como muestras de sonido<br />
o reproducir archivos de audio en hilos separados<br />
o controlar el volumen y velocidad de reproducción<br />
o mover fuentes de sonido en un espacio 3D<br />
* '''Matemática'''<br />
o set básico de funciones matemáticas adicionales<br />
o funciones de triangulación<br />
o set básico de funciones de colisión<br />
* '''Adicional'''<br />
o leer y escribir archivos ini<br />
o funciones para trabajar con archivos y memoria<br />
<br />
== En la nueva versión ==<br />
<br />
* Compilación corregida para Android para FPC 3.2.0 y superior.<br />
* Se movió el código principal para corregir la biblioteca.<br />
* Trabajo fijo con Windows 64<br />
* Corregidos errores menores<br />
* Versiones de demostración editadas (para iOS, las demostraciones no se corrigieron, se revisaron las versiones de demostración para Lazarus, FPC y Delphi)<br />
* Introducido por DEFINE<br />
** define - USE_EXIT_ESCAPE - salir. Posibilidad de no escribir código adicional para salir del programa presionando la tecla Escape<br />
** define - USE_INIT_HANDLE - para usar ZenGL en una ventana ya creada (LCL/VCL)<br />
* Soporte introducido para macOS Cocoa<br />
* Cambiado: trabajar con temporizadores, trabajando con fuentes, trabajar con LCL/VCL.<br />
<br />
[[Category:Components/es]]<br />
[[Category:Graphics/es]]<br />
[[category:Español]][[category:Castellano]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL&diff=148685ZenGL2021-12-17T07:22:35Z<p>Seenkao: </p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index}}<br />
<br />
== Main ==<br />
<br />
'''ZenGL''' - a cross-platform game development library, designed to provide necessary functionality for rendering 2D graphics, handling input, sound output, etc.<br />
<br />
*'''Supported OS''': GNU/Linux, Windows, macOS, iOS, Android 2.1+<br />
<br />
*'''Supported compilers''': [[Free Pascal]], [[Delphi]]<br />
<br />
*'''Graphics API''': [[OpenGL]], OpenGL ES 1.x, Direct3D 8/9<br />
<br />
*'''Sound API''': OpenAL, DirectSound<br />
<br />
*'''License''': [http://zengl.org/license.html ZenGL]<br />
<br />
== Links ==<br />
<br />
*[http://zengl.org/download.html Download ZenGL]<br><br />
*[https://github.com/andru-kun/zengl ZenGL Mirror on GitHub]<br />
*[http://zengl.org/extra.html Extra Downloads]<br />
*[http://zengl.org/ Homepage]<br><br />
*[http://zengl.org/wiki Wiki]<br><br />
*[http://zengl.org/forum Official forum]<br><br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
---<br />
*[https://github.com/Seenkao/New-ZenGL A new version]<br />
<br />
== Tutorial ==<br />
<br />
'''Attention!''' All examples are contained in the downloaded version of the library. At this time, this is relevant for all versions of ZenGL.<br />
These tutorials are not fully compatible with the latest version of ZenGL.<br />
<br />
[[ZenGL Tutorial]]: This is a first tutorial for ZenGL: download, installation, source paths, compilation (statically or with so/dll/dylib) (Windows dll), and the First program 'Initialization' that comes with ZenGL.<br />
<br />
[[ZenGL Tutorial 2]]: This is the second tutorial on how to create a font and draw text in the window.<br />
<br />
== Features ==<br />
<br />
* '''Main'''<br />
o can be used as so/dll/dylib or statically compiled with your application <br />
o rendering to own or any other prepared window<br />
o logging<br />
o resource loading from files, memory and '''zip''' archives<br />
o multithreaded resource loading<br />
o easy way to add support for new resource format<br />
* '''Configuration of'''<br />
o antialiasing, screen resolution, refresh rate and vertical synchronization<br />
o aspect correction<br />
o title, position and size of window<br />
o cursor visibility in window space<br />
* '''Input'''<br />
o handling of keyboard, mouse and joystick input<br />
o handling of Unicode text input<br />
o possibility to restrict the input to the Latin alphabet<br />
* '''Textures'''<br />
o supports '''tga''', '''png''', '''jpg''' and '''pvr'''<br />
o correct work with NPOT textures<br />
o control the filter parameters<br />
o masking<br />
o ''render targets'' for rendering into texture<br />
* '''Text'''<br />
o textured Unicode font<br />
o rendering UTF-8 text<br />
o rendering text with alignment and other options like size, color and count of symbols<br />
* '''2D subsystem'''<br />
o ''batch render'' for high-speed rendering<br />
o rendering different primitives<br />
o sprite engine<br />
o rendering static and animated sprites and tiles<br />
o rendering distortion grid<br />
o rendering sprites with new texture coordinates (with the pixel dimension and the usual 0..1)<br />
o control the blend mode and color mix mode<br />
o control the color and alpha of vertices of sprites and primitives<br />
o additional sprite transformations (flipping, zooming, vertices offset)<br />
o fast clipping of invisible sprites<br />
o 2D camera with ability to zoom and rotate the scene<br />
* '''Sound'''<br />
o works through OpenAL or DirectSound; depends on configuration or OS<br />
o correct work without soundcard<br />
o supports '''wav''' and '''ogg''' as sound sample formats<br />
o playing audio files in separate thread<br />
o control volume and playback speed<br />
o moving sound sources in 3D space<br />
* '''Video'''<br />
o decoding video frames into texture<br />
o supports '''theora''' codec in '''ogv''' container<br />
* '''Math'''<br />
o basic set of additional math functions<br />
o triangulation functions<br />
o basic set of collision functions<br />
* '''Additional'''<br />
o reading and writing INI files<br />
o functions for working with files and memory<br />
<br />
== In the updated version ==<br />
<br />
'''Attention!''' Basic information in Russian! Thank you for understanding.<br />
* Corrected compilation for android for FPC 3.2.0 and higher.<br />
* Moved the main code to correct the library<br />
* Edited work with Windows 64<br />
* Fixed minor bugs<br />
* Edited some demo versions (for FPC and iOS demos were not corrected, demo versions for Lazarus and Delphi were revised)<br />
* Introduced defines<br />
** define USE_EXIT_ESCAPE - exit. Ability not to write additional code to exit the program by pressing the Escape key<br />
** USE_INIT_HANDLE definition - for using ZenGL in an already created window (LCL/VCL)<br />
* Introduced support for MacOS Cocoa<br />
<br />
[[Category:Components]]<br />
[[Category:Graphics]]<br />
[[Category:Audio]]<br />
[[Category:Multimedia]]<br />
[[Category:Video]]<br />
[[Category:Game Development]]<br />
[[Category:Games]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=Qemu_and_other_emulators&diff=147104Qemu and other emulators2021-10-04T10:02:59Z<p>Seenkao: </p>
<hr />
<div>This note covers setting up Qemu on an x86-based development system running Linux. This allows native (rather than cross) development tools to be run, which can be useful:<br />
* where the target system has performance/resource issues (e.g. some ARM systems)<br />
* is not run natively due to company policy (older versions of Microsoft Windows)<br />
* is quite simply unavailable at a reasonable price (e.g. SGI MIPS systems or the Chinese MIPS-based systems).<br />
<br />
It also briefly mentions User Mode Linux for x86 and the Hercules emulator for IBM zSeries mainframes despite the fact that these are not particularly relevant to Free Pascal, and Docker containerisation. It does not consider x86-on-x86 virtualisation systems such as VMware, Microsoft Hyper-V or Oracle VirtualBox, and only considers Linux KVM as a foundation technology for Qemu.<br />
<br />
== The Host System ==<br />
<br />
In the current case, the host is a Compaq rack-mount server running at around 3GHz with several Gb RAM; be warned that performance will drop off drastically with a lower specification system. It has two internal drive cages, the first is connected to a RAID controller and is used for the host operating system and tools, the second is connected to a SCSI controller and contains 6x discs each of which is used for a different guest system.<br />
<br />
The host IP address is 192.168.1.22 and the system is named pye-dev-07, the default gateway and name server are on 192.168.1.1. Guest systems are on the 192.168.22.x subnet and are named pye-dev-07a (192.168.22.16), pye-dev-07b (192.168.22.17) and so on, they have their own gateway 192.168.22.1 which is known to the site router and firewalls.<br />
<br />
The host operating system is Debian "Squeeze", the host normally runs headless and may be accessed by SSH, X using XDMCP, or VNC. The display manager is gdm since this has a better XDMCP implementation than the alternatives, however in practice graphical login is most often handled by VNC.<br />
<br />
The following guests are implemented:<br />
<br />
; pye-dev-07a : Debian on ARM (little-endian, armel) using Qemu<br />
<br />
; pye-dev-07b : Debian on MIPS (little-endian, mipsel) using Qemu<br />
<br />
; pye-dev-07c : Slackware x86 13.37 using Qemu<br />
<br />
; pye-dev-07d : Slackware x86 13.37 using User Mode Linux<br />
<br />
; pye-dev-07e : Windows 2K using Qemu<br />
<br />
; pye-dev-07f : Debian on zSeries using the Hercules emulator<br />
<br />
; pye-dev-07g : Debian on 68k using the Aranym emulator<br />
<br />
Originally, pye-dev-07a was earmarked for big-endian ARM, but this appears to be being phased out by Debian so is probably no longer a viable target. Anybody planning to port FPC to the AVR-based Arduino?<br />
<br />
In general, multiple guests can run simultaneously although this has not been exhaustively tested recently.<br />
<br />
In the case of Linux the guest systems are each installed on an 18Gb disc, in the case of Windows a 36Gb disc is used. Each disc is assigned a label using e2label (arm, armel and so on), so that the startup script can mount it by name irrespective of which drive cage slot it's in.<br />
<br />
== Debian Guest using Qemu ==<br />
<br />
Select a suitable Debian mirror and version, for example<br />
<br />
http://ftp.de.debian.org/debian/dists/squeeze/main/...<br />
<br />
Fetch a kernel and initrd image for Debian Squeeze, as below.<br />
<br />
<u>For ARM (little-endian):</u><br />
.../main/installer-armel/current/images/versatile/netboot/vmlinux-2.6.32-5-versatile<br />
.../main/installer-armel/current/images/versatile/netboot/initrd.gz<br />
<br />
In addition for this architecture you also need:<br />
<br />
http://people.debian.org/~aurel32/qemu/armel/initrd.img-2.6.32-5-versatile<br />
<br />
<u>For MIPS (little-endian):</u><br />
.../main/installer-mipsel/current/images/malta/netboot/vmlinux-2.6.32-5-4kc-malta<br />
.../main/installer-mipsel/current/images/malta/netboot/initrd.gz<br />
<br />
Copy these to the disc reserved for the guest, e.g. /export/mipsel.<br />
<br />
Create a filesystem for Qemu, e.g.:<br />
<br />
<syntaxhighlight lang="bash"># qemu-img create -f qcow mipsel_hda.img 16G</syntaxhighlight><br />
<br />
Expect that to round up to around 17.1 Gb, if it doesn't then experiment. Start Qemu, telling it what kernel, initrd and filesystem to use:<br />
<br />
<u>For ARM (little-endian):</u><br />
<syntaxhighlight lang="bash"><br />
# qemu-system-arm -M versatilepb -kernel vmlinuz-2.6.32-5-versatile -initrd initrd.gz \<br />
-hda armel_hda.img -append root=/dev/ram<br />
</syntaxhighlight><br />
<br />
Note that the above command requires X access, e.g. ssh with the -X option.<br />
<br />
<u>For MIPS (little-endian):</u><br />
<syntaxhighlight lang="bash"><br />
# qemu-system-mipsel -M malta -kernel vmlinux-2.6.32-5-4kc-malta -initrd initrd.gz \<br />
-hda mipsel_hda.img -append "root=/dev/ram console=ttyS0" -nographic<br />
</syntaxhighlight><br />
<br />
Install the guest operating system as usual, splitting the disc into 16.5Gb for / with the remainder (around 700Mb) as swap. This will be slow, 8 or 9 hours is not implausible, so make sure that nobody's about to turn off your mains or disconnect you from the Internet.<br />
<br />
Don't worry if it tells you it's not installing a loader- it's not needed since the kernel and initrd are loaded into memory by the host.<br />
<br />
Boot the operating system and set network addresses etc. Use 192.168.22.16 or similar, with a gateway of 192.168.22.1.<br />
<br />
<u>For ARM (little-endian):</u><br />
<syntaxhighlight lang="bash"><br />
# qemu-system-arm -M versatilepb -kernel vmlinuz-2.6.32-5-versatile \<br />
-initrd initrd.img-2.6.32-5-versatile -hda armel_hda.img -append "root=/dev/sda1"<br />
</syntaxhighlight><br />
<br />
<u>For MIPS (little-endian):</u><br />
<syntaxhighlight lang="bash"><br />
# qemu-system-mipsel -M malta -kernel vmlinux-2.6.32-5-4kc-malta \<br />
-hda mipsel_hda.img -append "root=/dev/sda1 console=ttyS0" -nographic<br />
</syntaxhighlight><br />
<br />
Finally, you should be able to boot the operating system with an operational network. This relies on having /etc/qemu-ifup and /etc/qemu-ifdown files (see below), and passes additional parameters to them in shell variables. In outline:<br />
<br />
<u>For ARM (little-endian):</u><br />
<syntaxhighlight lang="bash"><br />
# qemu-system-arm -M versatilepb -m 256 -hda armel_hda.img \<br />
-kernel vmlinuz-2.6.32-5-versatile -initrd initrd.img-2.6.32-5-versatile \<br />
-append 'root=/dev/sda1 text' \<br />
-net nic,macaddr=00:16:3e:00:00:01 -net tap,ifname=tun1<br />
</syntaxhighlight><br />
<br />
<u>For MIPS (little-endian):</u><br />
<syntaxhighlight lang="bash"><br />
# qemu-system-mipsel -M malta -m 256 -hda mipsel_hda.img \<br />
-kernel vmlinux-2.6.32-5-4kc-malta -no-reboot \<br />
-append 'root=/dev/sda1 console=ttyS0' -nographic \<br />
-net nic,macaddr=00:16:3e:00:00:02 -net tap,ifname=tun2<br />
</syntaxhighlight><br />
<br />
Remember that if you change the network interface type or MAC address you will probably need to delete entries from the guest's /etc/udev/rules.d/z??_persistent-net.rules file.<br />
<br />
== Windows 2K Guest using Qemu ==<br />
<br />
Use dd to save a .iso image of the installation CD. Create a filesystem image:<br />
<br />
<syntaxhighlight lang="bash"># qemu-img create -f qcow2 win2k.img 32G</syntaxhighlight><br />
<br />
Boot using startup script as below. Note that this must specify a non-default network card, since Qemu's current (as of 2011) default is not supported by Windows 2K.<br />
<br />
''TODO: run with kernel support module.''<br />
<br />
== KVM on a Linux host ==<br />
<br />
KVM (Kernel-based Virtual Machine) is an enabling API supported on more recent x86 and x86-64 (AMD64) systems, this replaces the older KQemu kernel module which is now deprecated by both Qemu and the kernel.<br />
<br />
KVM is typically enabled by the host system BIOS. If not enabled by the BIOS it cannot be enabled by the kernel or by (a suitably privileged) application program, since the x86 architecture requires power to be cycled to change the state of this facility. The result of this is that KVM might be unavailable (no /dev/kvm device) even if it shown as supported by the CPU flags in /proc/cpuinfo.<br />
<br />
== Common Qemu startup, ifup and ifdown scripts ==<br />
<br />
There is much commonality irrespective of whether the guest is running Linux or Windows.<br />
<br />
<u>First startup script (e.g. /export/C):</u><br />
<syntaxhighlight lang="bash"><br />
#!/bin/sh<br />
<br />
mount -L mipsel<br />
cd /export/mipsel<br />
. ./C-2<br />
</syntaxhighlight><br />
<br />
<u>Second startup script for ARM (little-endian):</u><br />
<syntaxhighlight lang="bash"><br />
#!/bin/sh<br />
<br />
# Routine startup of a Qemu guest relies on (the host) running /etc/qemu-ifup<br />
# to condition ARP, forwarding etc.<br />
<br />
QEMU_ID=1<br />
QEMU='qemu-system-arm -M versatilepb'<br />
QEMU_RAM='-m 256'<br />
QEMU_HD='-hda armel_hda.img'<br />
QEMU_CD=''<br />
QEMU_BOOT="-kernel vmlinuz-2.6.32-5-versatile -append 'root=/dev/sda1 text' -initrd initrd.img-2.6.32-5-versatile"<br />
# QEMU_MONITOR='-monitor stdio -nographic'<br />
# QEMU_MONITOR='-nographic'<br />
QEMU_VGA=''<br />
VNC_ID=$(($QEMU_ID+1))<br />
# QEMU_VNC="-vnc :$VNC_ID -k en-gb"<br />
QEMU_VNC=''<br />
QEMU_NET="-net nic,macaddr=00:16:3e:00:00:0$QEMU_ID -net tap,ifname=tun$QEMU_ID"<br />
QEMU_GUEST_IP_ADDRESS=192.168.22.17<br />
QEMU_GUEST_IP_GATEWAY=192.168.22.1<br />
QEMU_HOST_GATEWAY_IF=eth1<br />
export QEMU_GUEST_IP_ADDRESS QEMU_GUEST_IP_GATEWAY QEMU_HOST_GATEWAY_IF<br />
<br />
echo \* $QEMU $QEMU_RAM $QEMU_HD $QEMU_CD $QEMU_BOOT \<br />
$QEMU_MONITOR $QEMU_VGA $QEMU_NET $QEMU_VNC<br />
<br />
screen -S QEMU_$QEMU_ID \<br />
sh -c "$QEMU $QEMU_RAM $QEMU_HD $QEMU_CD $QEMU_BOOT \<br />
$QEMU_MONITOR $QEMU_VGA $QEMU_NET $QEMU_VNC"<br />
<br />
cd ..<br />
</syntaxhighlight><br />
<br />
<u>Second startup script for MIPS (little-endian):</u><br />
<syntaxhighlight lang="bash"><br />
#!/bin/sh<br />
<br />
# Routine startup of a Qemu guest relies on (the host) running /etc/qemu-ifup<br />
# to condition ARP, forwarding etc.<br />
<br />
QEMU_ID=2<br />
QEMU='qemu-system-mipsel -M malta'<br />
QEMU_RAM='-m 256'<br />
QEMU_HD='-hda mipsel_hda.img'<br />
QEMU_CD=''<br />
QEMU_BOOT="-kernel vmlinux-2.6.32-5-4kc-malta -append 'root=/dev/sda1 console=ttyS0' -no-reboot"<br />
# QEMU_MONITOR='-monitor stdio -nographic'<br />
QEMU_MONITOR='-nographic'<br />
QEMU_VGA=''<br />
VNC_ID=$(($QEMU_ID+1))<br />
# QEMU_VNC="-vnc :$VNC_ID -k en-gb"<br />
QEMU_VNC=''<br />
QEMU_NET="-net nic,macaddr=00:16:3e:00:00:0$QEMU_ID -net tap,ifname=tun$QEMU_ID"<br />
QEMU_GUEST_IP_ADDRESS=192.168.22.18<br />
QEMU_GUEST_IP_GATEWAY=192.168.22.1<br />
QEMU_HOST_GATEWAY_IF=eth1<br />
export QEMU_GUEST_IP_ADDRESS QEMU_GUEST_IP_GATEWAY QEMU_HOST_GATEWAY_IF<br />
<br />
echo \* $QEMU $QEMU_RAM $QEMU_HD $QEMU_CD $QEMU_BOOT \<br />
$QEMU_MONITOR $QEMU_VGA $QEMU_NET $QEMU_VNC<br />
<br />
screen -S QEMU_$QEMU_ID \<br />
sh -c "$QEMU $QEMU_RAM $QEMU_HD $QEMU_CD $QEMU_BOOT \<br />
$QEMU_MONITOR $QEMU_VGA $QEMU_NET $QEMU_VNC"<br />
<br />
cd ..<br />
</syntaxhighlight><br />
<br />
<u>Second startup script for Windows:</u><br />
<syntaxhighlight lang="bash"><br />
#!/bin/sh<br />
<br />
# Routine startup of a Qemu guest relies on (the host) running /etc/qemu-ifup<br />
# to condition ARP, forwarding etc.<br />
<br />
QEMU_ID=4<br />
QEMU=qemu<br />
QEMU_RAM='-m 256'<br />
QEMU_HD='-hda win2k.img'<br />
QEMU_CD='-cdrom Windows2k-SP4.iso'<br />
QEMU_BOOT='-boot c'<br />
QEMU_MONITOR='-monitor stdio'<br />
QEMU_VGA='-vga cirrus'<br />
VNC_ID=$(($QEMU_ID+1))<br />
QEMU_VNC="-vnc :$VNC_ID -k en-gb"<br />
QEMU_NET="-net nic,macaddr=00:16:3e:00:00:0$QEMU_ID,model=rtl8139 -net tap,ifname=tun$QEMU_ID"<br />
QEMU_GUEST_IP_ADDRESS=192.168.22.20<br />
QEMU_GUEST_IP_GATEWAY=192.168.22.1<br />
QEMU_HOST_GATEWAY_IF=eth1<br />
export QEMU_GUEST_IP_ADDRESS QEMU_GUEST_IP_GATEWAY QEMU_HOST_GATEWAY_IF<br />
<br />
echo \* $QEMU $QEMU_RAM $QEMU_HD $QEMU_CD $QEMU_BOOT \<br />
$QEMU_MONITOR $QEMU_VGA $QEMU_NET $QEMU_VNC<br />
<br />
screen -S QEMU_$QEMU_ID \<br />
$QEMU $QEMU_RAM $QEMU_HD $QEMU_CD $QEMU_BOOT \<br />
$QEMU_MONITOR $QEMU_VGA $QEMU_NET $QEMU_VNC<br />
<br />
cd ..<br />
</syntaxhighlight><br />
<br />
<u>/etc/qemu-ifup (for both Linux and Windows):</u><br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
<br />
# if-up file for qemu, heavily cribbed from the command sequence embedded in<br />
# User Mode Linux. MarkMLl.<br />
<br />
echo Running /etc/qemu-ifup $1 $2...<br />
<br />
# For compatibility with UML the only parameter here is $1 which is the<br />
# interface name. I've put in a reference to $2 so we can see it if anything<br />
# changes.<br />
<br />
# I'm going to assume that qemu is always run by root. This is fairly<br />
# reasonable since it allows guest OSes to be fired up which themselves might<br />
# give access to confidential data etc. if compromised.<br />
<br />
# Here's my equivalent to the host-side UML setup for Qemu. We're hamstrung<br />
# here by the fact that the emulator is not telling us what IP address it's<br />
# trying to enable, there isn't a 1:1 correspondence between IP addresses and<br />
# interfaces since the latter depends on the order the sessions are started.<br />
#<br />
# As a hack, assume that the caller exports QEMU_GUEST_IP_ADDRESS (e.g.<br />
# 192.168.17.16), QEMU_GUEST_IP_GATEWAY (e.g. 192.168.17.1) and<br />
# QEMU_HOST_GATEWAY_IF (e.g. eth0).<br />
<br />
echo \* modprobe tun<br />
modprobe tun<br />
<br />
echo \* ifconfig $1 $QEMU_GUEST_IP_GATEWAY netmask 255.255.255.255 up<br />
ifconfig $1 $QEMU_GUEST_IP_GATEWAY netmask 255.255.255.255 up<br />
<br />
X=`cat /proc/sys/net/ipv4/ip_forward`<br />
if [ "$X" == "0" ]; then<br />
<br />
# Use either this...<br />
<br />
# echo Global forwarding is not enabled. Please refer to the administrator<br />
# echo responsible for this machine, enabling it might be a security hazard.<br />
<br />
# ...or this.<br />
<br />
echo Forcibly enabling global forwarding, note that this might be a security hazard.<br />
echo \* echo 1 \> /proc/sys/net/ipv4/ip_forward<br />
echo 1 > /proc/sys/net/ipv4/ip_forward<br />
X=`cat /proc/sys/net/ipv4/ip_forward`<br />
if [ "$X" == "0" ]; then<br />
echo Unable to enable global forwarding. Please refer to the administrator<br />
echo responsible for this machine.<br />
fi<br />
fi<br />
<br />
echo \* route add -host $QEMU_GUEST_IP_ADDRESS dev $1<br />
route add -host $QEMU_GUEST_IP_ADDRESS dev $1<br />
<br />
echo \* echo 1 \> /proc/sys/net/ipv4/conf/$1/proxy_arp<br />
echo 1 > /proc/sys/net/ipv4/conf/$1/proxy_arp<br />
X=`cat /proc/sys/net/ipv4/conf/$1/proxy_arp`<br />
if [ "$X" == "0" ]; then<br />
echo -n Retrying<br />
while [ "$X" == "0" ]; do<br />
sleep 1<br />
echo -n .<br />
echo 1 > /proc/sys/net/ipv4/conf/$1/proxy_arp<br />
X=`cat /proc/sys/net/ipv4/conf/$1/proxy_arp`<br />
done<br />
echo OK<br />
fi<br />
<br />
echo \* arp -Ds $QEMU_GUEST_IP_ADDRESS $1 pub<br />
arp -Ds $QEMU_GUEST_IP_ADDRESS $1 pub<br />
<br />
echo \* arp -Ds $QEMU_GUEST_IP_ADDRESS $QEMU_HOST_GATEWAY_IF pub<br />
arp -Ds $QEMU_GUEST_IP_ADDRESS $QEMU_HOST_GATEWAY_IF pub<br />
<br />
# Set up experimental UDP proxies. Depending on the protocol of interest<br />
# messages in one or both directions might need to be relayed.<br />
#<br />
# UDP port 79 is used for Dialarm signals, a unidirectional proxy is<br />
# adequate for this but detection of hosts changing state (i.e. being<br />
# added to or removed from the population of cooperating systems) is far<br />
# more responsive if a bidirectional proxy is available.<br />
<br />
PROXY_ID=1<br />
case "$1" in<br />
tun1)<br />
PROXY_ID=2<br />
;;<br />
tun2)<br />
PROXY_ID=3<br />
;;<br />
tun3)<br />
PROXY_ID=4<br />
;;<br />
tun4)<br />
PROXY_ID=5<br />
;;<br />
tun5)<br />
PROXY_ID=6<br />
;;<br />
tun6)<br />
PROXY_ID=7<br />
;;<br />
tun7)<br />
PROXY_ID=8<br />
;;<br />
esac<br />
<br />
# echo \* udp-broadcast-relay -f $PROXY_ID 79 $QEMU_HOST_GATEWAY_IF $1<br />
# /usr/local/src/udp-broadcast-relay/udp-broadcast-relay-0.3/udp-broadcast-relay \<br />
# -f $PROXY_ID 79 $QEMU_HOST_GATEWAY_IF $1<br />
<br />
# Alternatively use this one which is oriented towards IP addresses<br />
# rather than interfaces.<br />
<br />
# Note attempt to counteract any niceness applied to Qemu itself.<br />
<br />
ps ax | grep 'udp-proxy[ ]-z 79 ' >/dev/null 2>&1<br />
if [ $? != 0 ]; then<br />
echo \* udp-proxy -z 79 $QEMU_GUEST_IP_ADDRESS<br />
/usr/bin/nice --adjustment=20 /usr/local/src/udp-proxy/udp-proxy -z 79 $QEMU_GUEST_IP_ADDRESS<br />
else<br />
echo \* Already running udp-proxy -z 79 $QEMU_GUEST_IP_ADDRESS<br />
fi<br />
<br />
# echo \* udp-proxy -z 13264 $QEMU_GUEST_IP_ADDRESS<br />
# /usr/local/src/udp-proxy/udp-proxy -z 13264 $QEMU_GUEST_IP_ADDRESS<br />
<br />
echo .../qemu/qemu-ifup completed.<br />
</syntaxhighlight><br />
<br />
<u>/etc/qemu-ifdown (for both Linux and Windows):</u><br />
<syntaxhighlight lang="bash"><br />
#!/bin/sh<br />
<br />
echo \* route del -host $QEMU_GUEST_IP_ADDRESS dev $1<br />
route del -host $QEMU_GUEST_IP_ADDRESS dev $1<br />
<br />
echo \* ifconfig $1 down<br />
ifconfig $1 down<br />
</syntaxhighlight><br />
<br />
In actual fact, these operations were cribbed from User Mode Linux (below) where they are embedded inside a host library.<br />
<br />
== Slackware x86 Guest using User Mode Linux ==<br />
<br />
User Mode Linux runs a guest kernel as a standard program, i.e. there is no emulation or virtualisation involved. The guest kernel can be allocated either physical discs or filesystems contained in files.<br />
<br />
Put a .iso corresponding to a recent Slackware DVD in /export/uml. Unpack the initrd using zcat and cpio, save it as an ext3 image initrd_unpacked. Using dd create an empty file root_fs_slackware which will be partitioned and formatted during installation.<br />
<br />
Use the sources from e.g. a recent Slackware to compile kernel plus modules with ARCH=um using a suffix -uml. Save the kernel to /export/uml/linux, install the modules and then copy them into the initrd filesystem.<br />
<br />
Boot the UML kernel, telling it to use the initrd image and DVD iso:<br />
<br />
<syntaxhighlight lang="bash"># ./linux ubd0=initrd_unpacked ubd1=root_fs_slackware fake_ide ubd2r=slackware-13.37-install-dvd.iso rw</syntaxhighlight><br />
<br />
Run fdisk and setup as normal, you might need to tell it to install to /dev/ubd1 and use /dev/ubd2 for source. Finally, copy the modules onto the target filesystem.<br />
<br />
When complete start up like this:<br />
<br />
<syntaxhighlight lang="bash"><br />
# Routine startup of a UML guest relies on (the host) running /usr/lib/uml/uml_net<br />
# to condition ARP, forwarding etc.<br />
<br />
echo \* ./linux ubd0=initrd_unpacked ubd1=root_fs_slackware fake_ide ubd2r=slackware-13.37-install-dvd.iso \<br />
root=/dev/ubdb1 eth0=tuntap,,,192.168.1.22<br />
<br />
screen -S UML_3 \<br />
./linux ubd0=initrd_unpacked ubd1=root_fs_slackware fake_ide ubd2r=slackware-13.37-install-dvd.iso \<br />
root=/dev/ubdb1 eth0=tuntap,,,192.168.1.22<br />
<br />
cd ..<br />
</syntaxhighlight><br />
<br />
Note that this is usually run from an X session, since the multiple virtual consoles appear as separate xterms. Also see [http://wiki.freepascal.org/linux/kernel/user_mode_VM].<br />
<br />
== Debian 68k Guest using Aranym ==<br />
<br />
<syntaxhighlight lang="bash"># apt-get install aranym</syntaxhighlight><br />
<br />
I (MarkMLl) note this installs bridge-utils but instead am going to use my standard Qemu-style startup scripts, which themselves were originally based on sequences executed internally by UML; note that Hercules for zSeries (above) is the odd-one-out here since the guest uses SLIP for networking.<br />
<br />
Referring to https://wiki.debian.org/Aranym/Quick, download https://www.freewrt.org/~tg/dc11m68k.tgz and check its signature. Unpack, noting a kernel vmlinuz-2.6.39-2-atari, a filesystem image dc11.img.xz and a configuration file aranym.config.<br />
<br />
In aranym.config, change the ETH0 section to read:<br />
<br />
Type = ptp<br />
HostIP = 192.168.22.1<br />
AtariIP = 192.168.22.22<br />
Netmask = 255.255.255.0<br />
<br />
Change the startup script runaranym to read:<br />
<br />
<syntaxhighlight lang="bash"><br />
#!/bin/sh<br />
<br />
QEMU_GUEST_IP_ADDRESS=192.168.22.22<br />
QEMU_GUEST_IP_GATEWAY=192.168.22.1<br />
QEMU_HOST_GATEWAY=eth0<br />
export QEMU_GUEST_IP_ADDRESS QEMU_GUEST_IP_GATEWAY QEMU_HOST_GATEWAY<br />
<br />
/etc/qemu-ifup tap7<br />
<br />
cd "$(dirname "$0")"<br />
SDL_AUDIODRIVER=dummy; export SDL_AUDIODRIVER<br />
aranym-mmu -l -c aranym.config<br />
<br />
/etc/qemu-ifdown tap7<br />
</syntaxhighlight><br />
<br />
Uncompress the image file:<br />
<br />
<syntaxhighlight lang="bash"># unxz dc11.img.xz</syntaxhighlight><br />
<br />
Using xterm on a graphical login, run the startup script:<br />
<br />
<syntaxhighlight lang="bash"># runaranym</syntaxhighlight><br />
<br />
The result of that should be a console for the guest Debian system.<br />
<br />
On the guest console, login as root with password root, and immediately change the password to something appropriate using the passwd command. Change the hostname in /etc/hostname and /etc/hosts, the IP address etc. in /etc/network/interfaces, and the nameserver in /etc/resolv.conf. Reboot and check that the network is operational by pinging from the guest to the site router (e.g. 192.168.1.1) and then pinging the guest (192.168.22.22) from any convenient system; if this doesn't work fix it before continuing.<br />
<br />
Then as described on https://wiki.debian.org/Aranym/Quick run the three commands:<br />
<br />
<syntaxhighlight lang="bash"><br />
# dpkg-reconfigure openssh-server<br />
# apt-get update<br />
# apt-get install popularity-contest<br />
</syntaxhighlight><br />
<br />
Finally edit /root/profile to remove the reminder to run the above. It should now be possible to login using SSH, and to continue to configure and use the system like any Debian guest.<br />
<br />
== Debian zSeries Guest using Hercules, without VM ==<br />
<br />
Hercules is a commercial-grade emulator for IBM mainframes, it is available as a standard package for e.g. Debian and related Linux distributions. Once the emulator is running, enter<br />
<br />
ipl 120<br />
<br />
to boot Linux from device 120. Hopefully SSH will be operational so you won't need to interact with the console, but if you do then prefix each line that is to go to the guest operating system (i.e. rather than to the console itself) with a dot.<br />
<br />
Refer to the URL in the script below for more details.<br />
<br />
Startup:<br />
<br />
<syntaxhighlight lang="bash"><br />
#!/bin/sh<br />
<br />
# PREREQUISITE: Boot with ipl 120<br />
<br />
# Note that this makes no attempt to support IPv6.<br />
<br />
iptables -t nat -A POSTROUTING -o eth1 -s 192.168.22.0/24 -j MASQUERADE<br />
iptables -A FORWARD -s 192.168.22.0/24 -j ACCEPT<br />
iptables -A FORWARD -d 192.168.22.0/24 -j ACCEPT<br />
echo 1 > /proc/sys/net/ipv4/ip_forward<br />
echo 1 > /proc/sys/net/ipv4/conf/all/proxy_arp<br />
<br />
# http://www.josefsipek.net/docs/s390-linux/hercules-s390.html<br />
<br />
screen -S HERC_5 \<br />
hercules<br />
<br />
cd ..<br />
</syntaxhighlight><br />
<br />
Configuration:<br />
<br />
CPUSERIAL 000069 # CPU serial number<br />
CPUMODEL 9672 # CPU model number<br />
MAINSIZE 256 # Main storage size in megabytes<br />
XPNDSIZE 0 # Expanded storage size in megabytes<br />
CNSLPORT 3270 # TCP port number to which consoles connect<br />
NUMCPU 2 # Number of CPUs<br />
LOADPARM 0120.... # IPL parameter<br />
OSTAILOR LINUX # OS tailoring<br />
PANRATE SLOW # Panel refresh rate (SLOW, FAST)<br />
ARCHMODE ESAME # Architecture mode ESA/390 or ESAME<br />
<br />
# .-----------------------Device number<br />
# | .-----------------Device type<br />
# | | .---------File name and parameters<br />
# | | |<br />
# V V V<br />
#--- ---- --------------------<br />
<br />
# console<br />
001F 3270<br />
<br />
# terminal<br />
0009 3215<br />
<br />
# reader<br />
000C 3505 /export/zlinux/rdr/kernel.debian /export/zlinux/rdr/parmfile.debian /export/zlinux/rdr/initrd.debian autopad eof<br />
<br />
# printer<br />
000E 1403 /export/zlinux/prt/print00e.txt crlf<br />
<br />
# dasd<br />
0120 3390 /export/zlinux/dasd/3390.LINUX.0120<br />
0121 3390 /export/zlinux/dasd/3390.LINUX.0121<br />
<br />
# tape<br />
0581 3420<br />
<br />
# network s390 realbox<br />
# 0A00,0A01 CTCI -n /dev/net/tun -t 1500 10.1.1.2 10.1.1.1<br />
0A00,0A01 CTCI -n /dev/net/tun -t 1500 192.168.22.21 192.168.1.22<br />
<br />
Note that the guest network is configured as SLIP via a simulated CTC (Channel To Channel) device. Best not fooled with.<br />
<br />
== Debian zSeries Guest using Hercules, with VM ==<br />
<br />
This combination is unlikely to work using freely-available software, since Linux requires at least an S/390 G3 system while the most recent IBM VM available is VM/370. It might be technically possible to run a non-free VM on Hercules, but at the time of writing it is at best unclear whether this could be done legally.<br />
<br />
This means that it is not, for example, possible to run a VM host with simultaneous Linux and MUSIC/SP guests.<br />
<br />
== MUSIC/SP using Sim/390 or Hercules ==<br />
<br />
''This section is an outline only. Note that in the IBM ecosystem OS and VM are the names of specific operating systems, rather than being a generic abbreviation; in addition DOS is a '60s-era IBM operating system with no connection to Microsoft or PCs.''<br />
<br />
MUSIC/SP is a freely-available (but not open source) operating system which implements a subset of IBM's MVS API, i.e. is to some extent compatible with operating systems of the OS/360 lineage in particular OS/VS1, extended with some novel features including a filesystem with user-accessible directories. It does not provide an API compatible with Linux, and uses the EBCDIC character set.<br />
<br />
Unlike other freely-available OS-compatible operating systems (see for example [http://www.ibiblio.org/jmaynard/], [http://gunkies.org/wiki/Installing_VM/370_on_Hercules], and the section below), MUSIC/SP provides TCP/IP networking. However this requires that the IUCV (Inter User Communication Vehicle) be provided by the underlying platform and that there is a suitable network support kernel for it to talk to: these are normally made available by IBM's VM operating system (VM/SP or VM/ESA, a sufficiently-recent version of which is not freely available).<br />
<br />
Considering emulated environments, IUCV can be provided either by running a recent VM on top of Hercules, or by running the freely-available (but not open source) Sim/390 emulator on Windows. Hercules does not provide IUCV or a network support kernel directly (although as of early 2012 this might be being addressed), so while MUSIC/SP will run on Hercules it will not have TCP/IP-based networking facilities: use Sim/390 if you really need this.<br />
<br />
Regrettably, the maintainer of MUSIC/SP and Sim/390 is no longer active, and while binaries and documentation remain available for download via [http://www.canpub.com/teammpg/de/mcgweb/] the sources are not.<br />
<br />
== VM/370 using Hercules ==<br />
<br />
''This section is an outline only. Note that in the IBM ecosystem OS and VM are the names of specific operating systems, rather than being a generic abbreviation; in addition DOS is a '60s-era IBM operating system with no connection to Microsoft or PCs.''<br />
<br />
VM/370, which is freely available as the "SixPack" (currently v1.2 as of early 2013), provides a hypervisor running on the "bare metal" which can host multiple single- or multitasking operating systems such as the (provided) Conversational Monitor System (CMS) or derivatives of DOS or OS (e.g. VSE or MVS).<br />
<br />
The CMS interactive environment is a distant cousin to unix, and is probably usable by anybody who remembers MS-DOS or older operating systems; the "SixPack" includes extensive but not complete online help. There is no networking API exposed to user programs: code and data may be moved between the host computer (running Hercules) and guest sessions by mounting files simulating tape devices, by simulations of an 80-column card punch and reader, or by a simulation of a line printer.<br />
<br />
In common with other IBM operating systems of the era, the documented API is in the form of macros for an IBM-compatible assembler; other types of interface are available including diag codes for communication between CMS and VM, and virtualised hardware access using Channel Control Words (CCWs). The services provided are roughly comparable with MS-DOS v1 or CP/M, i.e. there are separate sets of macros for handling different classes of peripherals: do not expect to open the terminal, card reader or printer as a file. Particularly if the S/380 hack (see below) is applied, the GCC compiler and standard libraries may be used but most software development and maintenance is done using assembler.<br />
<br />
== IBM S/370, S/390, and the S/380 "hack" ==<br />
<br />
''This section is an even sketchier outline.''<br />
<br />
As discussed elsewhere, the S/360 and S/370 architectures are limited to 24-bit addresses while the S/390 allows 31-bit addresses without, in general, breaking compatibility. There is an unofficial extension of the Hercules emulator (frowned upon by purists) that implements a non-standard "S/380" architecture and modifies the most-recent freely-available IBM mainframe operating systems (VSE nee DOS, MVS nee OS, and VM/370) to exploit this extension. Using this, there is sufficient available memory to run a large-scale compiler such as GCC ''natively'' on one of the classic IBM operating systems, with the important caveats that only one program can use this facility at a time (i.e. while a 31-bit GCC and a 24-bit make should work, two copies of the 31-bit GCC won't), and that in the case of VM one program means one program per computer rather than one program per virtualised system/login.<br />
<br />
To make use of this, you need the Hercules-380 patch from [http://mvs380.sourceforge.net/], a classic operating system such as the VM/CMS "sixpack" from [http://vm370.31bits.net/vm370sixpack-1_2.zip], and possibly the MECAFF enhancement for additional terminal sessions and the IND$FILE program. In practice, it is impossible to do any of this without joining Yahoo!, and subscribing to the Hercules-VM370, hercules-os380 and H390-VM groups.<br />
<br />
== IA-64 (Itanium, Merced, McKinley etc.) ==<br />
<br />
''Terminally sketchy.''<br />
<br />
The FPC port targeting IA-64 exists in absolutely minimal form, i.e. a few skeleton files and that's about it. Since the IA-64 architecture appears to be heading in the same direction as its predecessor the iAPX-432, it's highly questionable whether any more work will be done on this architecture. However, for completeness (and because this author wants to be able to inspect some Itanium binaries)...<br />
<br />
While a few systems turn up on eBay etc., the asking price tends to be dictated by what the seller paid a few years ago rather than by what anybody expects to pay today. There is a simulator, written by HP, called "Ski", which is now open source. See [http://www.gelato.unsw.edu.au/IA64wiki/SkiSimulator], [http://www.hpl.hp.com/research/linux/ski/download.php] plus the Sourceforge project repository.<br />
<br />
(On a fairly complete development system running Debian) get the most recent Ski sources from Sourceforge. Run autogen.sh, installing e.g. autoconf, libtool and libelf-dev if necessary. Run make, install additional libraries such as gperf, bison, flex etc. as necessary. It might be necessary to edit syscall-linux.c to comment out the reference to asm/page.h which apparently isn't needed for very recent (Linux 3.x) kernels. On success get root and run make install.<br />
<br />
Assuming the disc image is a file named /export/ia-64/sda (e.g. renamed from the downloaded sda-debian) then<br />
<br />
bski bootloader vmlinux simscsi=/export/ia-64/sd<br />
<br />
Note the dropped final letter, that parameter is used as a prefix rather than being the name of a file or directory.<br />
<br />
As with a number of other emulators described on this page, this requires an X session for the console.<br />
<br />
This writer (MarkMLl) can't get networking running, either using the instructions at [http://www.hpl.hp.com/research/linux/ski/HOWTO-ski-networking.php] or using a tun/tap solution very roughly as suggested by [http://www.gelato.unsw.edu.au/IA64wiki/SkiVirtualNetwork]. It might be necessary to try a much older host kernel, i.e. late 2.4 or early 2.6, however this is not currently being pursued due to lack of relevance.<br />
<br />
The kernel from HP is 2.4.20, the filesystem is described as "Debian Sid" but from the kernel version is probably somewhere between "Woody" (3.0) and "Sarge" (3.1). I don't know how easy it's going to be to get this up to scratch, at the very least a working network is going to be a prerequisite.<br />
<br />
----<br />
<br />
== Relative Performance ==<br />
<br />
Performance is, in general, disappointing. Using an informal "torture test" which exercises the CPU and disc access:<br />
<br />
Compaq ProLiant ML530 G2, 2.8GHz, 3Gb, 8 jobs, 390W 0m12.170 79<br />
<br />
Linksys NSLU2, 266MHz 32Mb, 1 job, 7W 6m35.014s 46<br />
<br />
Qemu ARM, 1 job, 390W 42m58.925s 16,757<br />
<br />
Qemu MIPS, 1 job, 390W 17m49.103s 6,949<br />
<br />
Qemu x86, 1 job, 390W 47m0.441s 18,330<br />
<br />
UML, 1 job, 390W 8m26.529s 3,289<br />
<br />
Hercules zSeries, 4 jobs, 390W 9m43.330s 3,790<br />
<br />
The final column in the above list is the W-Mins to complete the job. These timings are without the benefit of kernel support from kqemu (obsolete) or KVM, but the fact that Qemu's support for MIPS is significantly better than that for other architectures, and the fact that the Hercules emulator is in all cases better than Qemu, does make one wonder how efficient the code is.<br />
<br />
Compiling FPC 2.4.2 using time make NOGDB=1 OPT='-O- -gl' all :<br />
<br />
Host (x86, Linux, Debian):<br />
<br />
real 4m47.842s<br />
user 3m42.126s<br />
sys 0m33.506s<br />
<br />
Slug (32Mb, ARM, Linux, Debian):<br />
<br />
real 284m58.543s<br />
user 86m45.570s<br />
sys 20m46.500s<br />
<br />
Qemu (ARM, Linux, Debian):<br />
<br />
real 406m31.931s<br />
user 236m49.030s<br />
sys 148m58.110s<br />
<br />
Qemu (x86, Linux, Slackware):<br />
<br />
real 141m45.700s<br />
user 122m40.724s<br />
sys 17m15.670s<br />
<br />
Qemu (x86, Windows 2000):<br />
<br />
Elapsed 108m<br />
<br />
UML (x86, Linux, Slackware):<br />
<br />
real 238m41.257s<br />
user 45m54.460s<br />
sys 3m44.140s<br />
<br />
Compiling Lazarus 0.9.30 using time make LCL_PLATFORM=gtk2 bigide :<br />
<br />
Host (x86, Linux, Debian):<br />
<br />
real 2m21.072s<br />
user 2m6.452s<br />
sys 0m12.285s<br />
<br />
Slug (32Mb, ARM, Linux, Debian):<br />
<br />
real 9385m49.319s<br />
user 67m23.460s<br />
sys 430m9.870s<br />
<br />
Qemu (ARM, Linux, Debian):<br />
<br />
real 281m55.536s<br />
user 153m3.150s<br />
sys 53m27.470s<br />
<br />
Qemu (x86, Linux, Slackware):<br />
<br />
real 70m53.957s<br />
user 60m3.474s<br />
sys 8m8.801s<br />
<br />
Qemu (x86, Windows 2000, default platform):<br />
<br />
Elapsed 53m<br />
<br />
UML (x86, Linux, Slackware):<br />
<br />
real 489m40.233s<br />
user 81m43.740s<br />
sys 7m51.280s<br />
<br />
== Graphical Access using VNC etc. ==<br />
<br />
All of the above assumes that SSH is available so that shell (command line) sessions can be run over the network. Where necessary install e.g. the Debian ssh (or openssh, openssh-server etc.) package. It is also possible to run a program using a GUI over SSH by X forwarding, see the SSH client's -X option and the corresponding server configuration-file settings.<br />
<br />
There are several ways of running a program using a GUI without forwarding the X protocol over SSH:<br />
<br />
* Running Qemu or UML in an xterm.<br />
<br />
* Using Qemu's host VNC support.<br />
<br />
* Connecting to a Qemu (or UML etc.) guest using X.<br />
<br />
* Connecting to a Qemu (or UML etc.) guest using VNC.<br />
<br />
In all cases it is worth using a low-resource window manager such as FluxBox or xfwm rather than KDE or Gnome.<br />
<br />
=== Running Qemu or UML in an xterm or with host VNC support ===<br />
<br />
This depends on the build options of the guest system kernel etc. In general, display resolution and depth will be limited by the emulated hardware, the network ports are associated with the host (rather than guest) system. See the Qemu documentation for details.<br />
<br />
=== Connecting to a Qemu (or UML etc.) guest using X ===<br />
<br />
Install the Gnome Display Manager (gdm) on the guest system. This allows a desktop system to log into it using XDMCP, the desktop system determines the display resolution and depth.<br />
<br />
=== Connecting to a Qemu (or UML etc.) guest using VNC ===<br />
<br />
This method also works well for arbitrary systems, even if Qemu etc. is not being used.<br />
<br />
Install gdm and RealVNC (or, with limitations, TightVNC) on the guest system; the latter might be needed for ARM guests but RealVNC is to be preferred when available. This allows a desktop system to log into it using VNC, the guest system determines the display resolution and depth and network ports are associated with the guest (rather than host) system.<br />
<br />
In /etc/inittab, insert something like this:<br />
<br />
6:23:respawn:/sbin/getty 38400 tty6<br />
<br />
# Added in lieu of trying to get it working in inetd.conf. MarkMLl.<br />
<br />
8:23:respawn:/usr/local/vnc/vncshim-0-20<br />
# 9:23:respawn:/usr/local/vnc/vncshim-4-24<br />
<br />
# Example how to put a getty on a serial line (for a terminal)<br />
#<br />
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100<br />
<br />
Many systems limit the number of VNC servers that may be run per system (including localhost) as the side effect of a window manager XDMCP security precaution. If necessary, edit the window manager configuration file (gdm.conf, kdmrc etc.) to increase the number of sessions that each XDMCP client can request, e.g. in the case of gdm.conf:<br />
<br />
[xdmcp]<br />
Enable=true<br />
DisplaysPerHost=6<br />
<br />
Create /usr/local/vnc/vncshim-0-20 to read:<br />
<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
<br />
# This forms a shim between /etc/inittab and the VNC server, necessitated by<br />
# the facts that (a) I can't get this command working reliably in inetd.conf<br />
# and (b) lines in initab have restricted length.<br />
#<br />
# Note that the name of the file reflects the fact that it might request non-<br />
# standard combinations of VNC port and X display number. MarkMLl.<br />
<br />
# My preference is to select default linear dimensions that appear somewhere<br />
# in the list of conventional graphics modes. 1200x960 fits inside a 1280x1024<br />
# screen, even allowing that the title bar etc. will take additional space.<br />
<br />
SIZE=1200x960<br />
<br />
# The DPI setting can usefully be set to match the user's normal screen, leave<br />
# undefined (commented out) if in doubt.<br />
<br />
DPI='-dpi 96'<br />
<br />
# Each VNC server running on a host must have a distinct suffix to prevent port<br />
# and display number clashes.<br />
<br />
SUFFIX=0<br />
<br />
# Some option formats vary between RealVNC (top) and TightVNC (bottom).<br />
<br />
OPTIONS='DisconnectClients=0 -NeverShared'<br />
# OPTIONS='-dontdisconnect -nevershared'<br />
<br />
####################### CHANGE NOTHING BELOW HERE ###########################<br />
<br />
VNCPORT=570$SUFFIX<br />
XDISPLAY=:2$SUFFIX<br />
<br />
# Try to work out what this system is. Note particular care to allow spaces<br />
# in the desktop name.<br />
<br />
WHATAMI=`dirname $0`/whatami<br />
if [ -x $WHATAMI ]; then<br />
WHATAMI2=`$WHATAMI`<br />
else<br />
if [ -r $WHATAMI ]; then<br />
WHATAMI2=`cat $WHATAMI`<br />
else<br />
WHATAMI2=$$<br />
fi<br />
fi<br />
DESKTOP='-desktop '\'$WHATAMI2\'<br />
<br />
# Optional Java viewer.<br />
<br />
if [ -r `dirname $0`/classes/index.vnc ]; then<br />
JAVA="-httpd `dirname $0`/classes -httpPort 580$SUFFIX"<br />
fi<br />
<br />
# This is the only way I can get it working the way I want, i.e. with reliable<br />
# handling of spaces in the desktop name. I'm hardly proud of it.<br />
<br />
rm -f `dirname $0`/.vncshim-$SUFFIX-1$SUFFIX<br />
<br />
cat >`dirname $0`/.vncshim-$SUFFIX-1$SUFFIX <<EOT<br />
#!/bin/sh<br />
exec /usr/bin/Xvnc -geometry $SIZE $DPI -depth 16 $DESKTOP \<br />
-rfbport $VNCPORT -rfbauth /root/.vnc/passwd-$SUFFIX $JAVA \<br />
$OPTIONS -query localhost -once $XDISPLAY<br />
EOT<br />
<br />
chmod +x `dirname $0`/.vncshim-$SUFFIX-1$SUFFIX<br />
exec `dirname $0`/.vncshim-$SUFFIX-1$SUFFIX<br />
</syntaxhighlight><br />
<br />
Create /usr/local/vnc/whatami to read:<br />
<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
<br />
echo -n "`hostname`, "<br />
_WHATAMI=`uname -m`<br />
if [[ $_WHATAMI == i?86 ]]; then<br />
_WHATAMI='i586'<br />
fi<br />
if [[ $_WHATAMI == arm* ]]; then<br />
_WHATAMI='arm'<br />
fi<br />
<br />
if [ -x `dirname $0`/whatami-$_WHATAMI ]; then<br />
`dirname $0`/whatami-$_WHATAMI<br />
else<br />
uname -m<br />
fi<br />
</syntaxhighlight><br />
<br />
Additional scripts e.g. whatami-arm can query /proc/cpuinfo, which is different for each architecture. Make sure that all scripts are set +x for root.<br />
<br />
Use vncpasswd to set up password files /root/.vnc/passwd-0 etc.<br />
<br />
So far, I find that RealVNC works fine when invoked as above, but TightVNC doesn't correctly invoke the display manager.<br />
<br />
== Accessing "Unusual" Devices ==<br />
<br />
This section covers devices such as audio (i.e. used for playing .wav files) and MIDI, and USB devices which are not claimed by the host or guest kernel.<br />
<br />
=== Sound/MIDI for Qemu ===<br />
<br />
Don't expect this to be hi-fi quality, but it should be adequate for operator alerts etc.<br />
<br />
==== Identifying the Host's Hardware ====<br />
<br />
Obviously, a good starting point for this is using lspci and lsusb to determine what physical hardware is installed. The next stage is usually to consult dmesg output and to use lsmod to determine what subsystems the kernel has loaded hence what APIs are available. Graphical tools such as the KDE Info Centre can also be useful here, however identifying which API is most useful can be a bit of a black art.<br />
<br />
The current writer (MarkMLl) has a Debian "Squeeze" host with USB-connected audio and MIDI devices, with the latter connected to a Yamaha tone generator. An alternative (and more conventional) configuration would be to have an internal soundcard, with both audio and MIDI output feeding a loudspeaker.<br />
<br />
Knowing what hardware and subsystems are available, the remaining question is which subsystems Qemu can make use of. Running this command goes some way towards providing an answer:<br />
<br />
$ qemu -audio-help |grep ^Name:<br />
Name: alsa<br />
Name: oss<br />
Name: sdl<br />
Name: esd<br />
Name: pa<br />
Name: none<br />
Name: wav<br />
<br />
For reasons that are unclear ''(roughly translated: I'd like some help here)'' I've had most success with OSS, starting Qemu with a script that includes these lines:<br />
<br />
<syntaxhighlight lang="bash"><br />
export QEMU_AUDIO_DRV=oss<br />
export QEMU_OSS_DAC_DEV=/dev/dsp1<br />
export QEMU_OSS_ADC_DEV=/dev/dsp1<br />
</syntaxhighlight><br />
<br />
==== Selecting the Guest's Soundcard ====<br />
<br />
Assuming that the guest is to have both audio and MIDI, common sense would suggest that the guest operating system should see both audio and MIDI hardware implemented by Qemu. According to http://rubenerd.com/qemu-ad-lib-midi-win-31/, this implies that Qemu should be recompiled with the capability of emulating an Adlib card, which for current versions of Qemu means running something like this:<br />
<br />
<syntaxhighlight lang="bash"><br />
make clean distclean<br />
./configure --audio-card-list=ac97,es1370,sb16,adlib<br />
make<br />
</syntaxhighlight><br />
<br />
Irrespective of whether a custom Qemu is built or not, it's useful to check what devices it emulates:<br />
<br />
<syntaxhighlight lang="bash"><br />
$ qemu -soundhw ?<br />
Valid sound card names (comma separated):<br />
pcspk PC speaker<br />
sb16 Creative Sound Blaster 16<br />
ac97 Intel 82801AA AC97 Audio<br />
es1370 ENSONIQ AudioPCI ES1370<br />
</syntaxhighlight><br />
<br />
For some guest operating systems (e.g. Windows NT 4), adding Adlib emulation to Qemu is sufficient to get MIDI working with the Sound Blaster, i.e.<br />
<br />
<syntaxhighlight lang="bash">$ qemu ... -soundhw sb16,adlib ...</syntaxhighlight><br />
<br />
In this case the guest uses only the standard Sound Blaster driver, possibly ignoring MPU-401 support.<br />
<br />
For guest systems which don't benefit from this, there's little point adding something like an Adlib card if the guest operating system doesn't have a driver for it- which appears to be the case with Windows 2000. The current writer's preference is to select the ES13770, since as a straightforward PCI device it should be enumerated without difficulty by almost any guest operating system:<br />
<br />
<syntaxhighlight lang="bash">$ qemu ... -soundhw es1370 ...</syntaxhighlight><br />
<br />
Having started Qemu, it's possible to query the emulated devices:<br />
<br />
(qemu) info pci<br />
...<br />
Bus 0, device 4, function 0:<br />
Audio controller: PCI device 1274:5000<br />
IRQ 11.<br />
BAR0: I/O at 0xc200 [0xc2ff].<br />
id ""<br />
<br />
The expected result of this is that the guest operating system would see audio hardware, but not MIDI. However in the case of Windows 2000 a MIDI device is emulated, so programs which use MIDI for e.g. operator alerts will work properly.<br />
<br />
''Anybody: need help here generalising this to other guest operating systems.''<br />
<br />
=== USB for Qemu ===<br />
<br />
As an example, a Velleman K8055 board is plugged into the host. First use lsusb to gets its vid:pid identifiers:<br />
<br />
<syntaxhighlight lang="bash"><br />
$ lsusb<br />
Bus 001 Device 005: ID 10cf:5500 Velleman Components, Inc. 8055 Experiment Interface Board (address=0)<br />
</syntaxhighlight><br />
<br />
Now add these parameters to the Qemu command line:<br />
<br />
<syntaxhighlight lang="bash">qemu ... -usb -usbdevice host:10cf:5500 ...</syntaxhighlight><br />
<br />
On the guest, lsusb should show the device available for use.<br />
<br />
The Velleman board is unusual in that it has ID jumpers which set the last digit, i.e. multiple devices appear as 10cf:5500 through 10cf:5503. In cases where this facility is not available, the bus and device number can be used:<br />
<br />
<syntaxhighlight lang="bash">qemu ... -usb -usbdevice host:1.5 ...</syntaxhighlight><br />
<br />
Obviously, there's a risk here that devices will move around between invocations.<br />
<br />
=== USB for UML ===<br />
<br />
There was supposedly a patch that mapped unused USB devices on the host into the guest. I'm not sure it made it into the standard release.<br />
<br />
== QEMU User Emulation Mode in Chrooted Environment ==<br />
<br />
In previous chapters QEMU's full system emulation mode was described: a complete guest system is emulated including bios and hardware. Although this approaches a real environment as close as possible, the overhead created by emulating a complete system is considerable. QEMU's user emulation mode allows to run "guest" code directly on the "host" system. The cpu is still emulated but system calls are translated into system calls on the host system. Libraries used by the "guest" code are the "guest" libraries, not the host libraries. To run a small program created for fe. ARM with no dependencies you can simply do a <br />
$ qemu-arm program<br />
When the program has more and more dependencies, it becomes increasingly difficult to put all dependencies in locations that can be found by qemu-arm without messing up your host system. The solution that will be developed here is to create a chroot environment on the host in which all code is "guest" code. Advantage of this solution: <br />
*the chroot isolates the guest from the host <br />
*no need for vnc, ssh or any other solution to export screens. <br />
*no booting of a guest OS system.<br />
*guest "immersion" for user programs is almost complete. Only very low level and hardware related programming will notice the difference.<br />
*a spectacular speed improvement for graphics (X) related tasks (running lazarus f.e.) <br />
*hard disk resources are common to host and guest. Host can read and modify "guest" files but not the other way around.<br />
<br />
<u>Setting up the system.</u><br />
<br />
For a better comprehension of what follows, here is the directory structure used in this how-to:<br />
<br />
home<br />
qemu<br />
arm-linux-user<br />
sparc-linux-user<br />
scripts <br />
disks // here are qemu images for the different systems emulated<br />
chroot<br />
mount <br />
arm // here we'll chroot the arm environment<br />
sparc <br />
<br />
Get and build the latest qemu<br />
<br />
<syntaxhighlight lang="bash"><br />
$ cd <br />
$ git clone git://git.savannah.nongnu.org/qemu.git qemu<br />
$ cd qemu<br />
</syntaxhighlight><br />
<br />
Build all emulations (full system and user emulation mode, all processors) <br />
<syntaxhighlight lang="bash">$ ./configure --static to build </syntaxhighlight><br />
<br />
or only the user emulations needed <br />
<br />
<syntaxhighlight lang="bash">$ ./configure --static --target-list=sparc-linux-user,arm-linux-user<br />
<br />
$ make clean all<br />
</syntaxhighlight><br />
<br />
The --static option makes that qemu-arm and qemu-sparc are linked statically. Since they will be running in the chroot environment later on, they must be build without dependencies. Some distributions provide already statically linked binaries. fe qemu-arm-static on debian. Although they are not the latest and greatest, using these packages makes it somewhat easier. Building QEMU from source is really just a matter of minutes.<br />
<br />
Now we need to copy the complete guest system into chroot/arm or chroot/sparc. There are several ways of doing this but when you don't have a real arm or sparc system at hand, using a QEMU image of a full system emulation as described in previous chapters is the easiest.<br />
<br />
Mount the QEMU image.<br />
<br />
WARNING: do not mount a qemu image when the associated guest is running!<br />
<br />
Only raw QEMU images can be mounted as a loop-back device. If you have a qcow formatted image, convert it to a raw image.<br />
<br />
<syntaxhighlight lang="bash"><br />
$ qemu-img convert disks/armel_hda.img -O raw disks/armel_hda.raw<br />
<br />
$ cd chroot <br />
$ su<br />
# mount ../disks/armel_hda.raw mount -o loop,offset=32256<br />
</syntaxhighlight><br />
<br />
The offset is the start of the first partition on the ARM disk when the default disk layout was used during installation. If mount fails then the offset is probably wrong. To calculate the offset:<br />
<br />
<syntaxhighlight lang="bash"># fdisk -lu ../disks/armel_hda.raw</syntaxhighlight><br />
<br />
Find the first sector of the partition that will be mounted as root. Calculate offset as (start sector number * 512). For the default SPARC debian etch installation using a sun partition table with a /boot first partition the offset is 98703360.<br />
<br />
Check if the correct partition is mounted:<br />
<br />
<syntaxhighlight lang="bash"># ls mount</syntaxhighlight><br />
<br />
Copy the complete system<br />
<br />
<syntaxhighlight lang="bash"><br />
# cp -r mount/* arm/<br />
# umount mount<br />
</syntaxhighlight><br />
<br />
Copy the QEMU arm emulator to the arm directory<br />
<br />
<syntaxhighlight lang="bash"><br />
# cd arm<br />
# cp ../../arm-linux-user/qemu-arm usr/local/bin<br />
</syntaxhighlight><br />
<br />
Our "guest" system is complete. Since we are sharing our "host" devices and system, we need to mount a few special directories:<br />
<br />
<syntaxhighlight lang="bash"><br />
# mount --bind /proc proc<br />
# mount --bind /dev dev<br />
# mount --bind /sys sys<br />
# mount --bind /tmp tmp<br />
</syntaxhighlight><br />
<br />
Why /tmp? The /tmp directory is used by the X window system. When you don't mount tmp on the host /tmp, you will get "can't open display 0:0" errors when trying to open a window in the guest.<br />
<br />
We are going to use the host network:<br />
<br />
<syntaxhighlight lang="bash"># sudo cp /etc/resolv.conf etc</syntaxhighlight><br />
<br />
Remains one last thing: the emulator is copied into the guest but how do we tell the system that the emulator needs to kick in when a "quest" elf is detected? This is done with binfmt_misc. A configuration script is included with QEMU that registers the QEMU user mode emulators with binfmt_misc: (on my system I had to do a chmod +x on the script)<br />
<br />
<syntaxhighlight lang="bash"># ../../scripts/qemu-binfmt-conf.sh</syntaxhighlight><br />
<br />
When you look at this script at the end of the binary data you'll notice that the emulator is registered as /usr/local/bin/qemu-arm. And that is where we put it a few lines ago.<br />
<br />
Launch the system:<br />
<br />
<syntaxhighlight lang="bash"># chroot .</syntaxhighlight><br />
<br />
If all goes well:<br />
<br />
<syntaxhighlight lang="bash"><br />
# uname -m<br />
armv7l<br />
</syntaxhighlight><br />
<br />
Everything you do from here is in your "guest" system. <br />
To exit the "guest" system.<br />
<br />
<syntaxhighlight lang="bash"># exit</syntaxhighlight><br />
<br />
And unmount the special directories.<br />
<br />
<syntaxhighlight lang="bash"><br />
# umount proc<br />
# umount dev<br />
# umount sys<br />
# umount tmp<br />
</syntaxhighlight><br />
<br />
<u>Conclusion.</u><br />
<br />
The ARM emulation works very well, except for gdb. On the contrary there are still quite some problems with the SPARC emulation. There is a bug in duplicating pipes which makes the use of bash impossible. The sh shell works but several unix commands don't function correctly. What works fine is fpc and lazarus! Programs can't be launched from inside lazarus. Because of the improved graphics speed when using the user emulation mode it is still worthwhile for using lazarus. Instead of starting a shell in chroot, you start directly lazarus:<br />
<br />
<syntaxhighlight lang="bash">$ sudo chroot . /your/lazarus/dir/lazarus</syntaxhighlight><br />
<br />
To run the program compiled in lazarus, you can launch it from another "host" terminal:<br />
<br />
<syntaxhighlight lang="bash"><br />
$ cd qemu/chroot/arm<br />
$ sudo chroot . /your/program/dir/project<br />
</syntaxhighlight><br />
<br />
Here also gdb is not working.<br />
<br />
== Docker images ==<br />
<br />
Docker uses various APIs provided by the underlying operating system to isolate programs in separate namespaces.<br />
<br />
The implication of this is that every Docker container has its own process space (i.e. processes in different containers might have the same numeric PID), network space (processes in different containers can have different routing, firewall rules and so on), filesystems (except that they share kernel files and a number of crucial libraries and configuration files) and so on.<br />
<br />
Containerisation is distinct from virtualisation in that all containers which are running on the same host computer make use of the same host kernel, it is not possible for one container to use a different kernel (e.g. for development or deployment test purposes), and there is no absolute guarantee that a container taken over by malicious code cannot subvert the remainder of the system.<br />
<br />
'''''Note that there are pitfalls for the unwary. For example, having Docker installed and the Docker daemon running can break Qemu networking if this expects to have bridged access to the host interface rather than to be sitting on its own private subnet.'''''<br />
<br />
One thing that does work however, is running a 32-bit container on a 64-bit host, and in most cases the Linux kernel APIs are sufficiently backwards-compatible that the programs and libraries from an older release of a distro can run on a much more recent host. One of the cases which will be discussed here runs a container containing 32-bit Debian "Lenny" from 2008 on a host running Debian "Buster" from 2019, this combination allows e.g. compatibility with the GTK v1 widget set (no longer supported by more recent distreaux) to be tested.<br />
<br />
=== Docker fundamentals ===<br />
<br />
This is not the place for a full discussion of the care and feeding of Docker, but it's worth establishing a few basic concepts.<br />
<br />
* Host: the physical computer running e.g. Qemu (with or without KVM) or Docker.<br />
<br />
* Guest: on a virtualised system (Qemu etc.), a completely separate memory space with its own kernel.<br />
<br />
* Container: on a Docker based system, a group of application programs sharing the host kernel but largely isolated from the rest of the host system using various namespace mechanisms.<br />
<br />
Looking specifically at Docker:<br />
<br />
* Dockerfile: a succinct description of what is to go into a Docker image.<br />
<br />
* Image: the Docker analogue of a bootable filesystem, initially built with reference to a Dockerfile.<br />
<br />
* Container: an image which has been run, whether or not it is currently running.<br />
<br />
Once running, a container has an associated parameter list which specifies the main program together with any sockets etc. exposed to the host. Neither an image nor a container correspond to a single file on the host, but:<br />
<br />
* A container may be stopped and committed to an image.<br />
<br />
* An image may be saved to a single file, in which state it can be moved between hosts.<br />
<br />
* An image may be run a set of parameters different from those of the container committed to it.<br />
<br />
The result of this is that if something is installed in the context of a container (e.g. Apache is added from the operating system's main repository) the container should be stopped, committed to a new image and then run with an additional parameter specifying what sockets etc. should be exposed. There are ways around that, but that combination appears to be the easiest to manage.<br />
<br />
The Docker community has a master repository, and the docker program on a host computer may search it to locate images. However in the context of those images there appears to be no "official" way of searching the tags that allow a specific version to be pulled, hence something "messy" and subject to change like<br />
<br />
<pre><br />
$ docker search debian<br />
<br />
$ wget -q https://registry.hub.docker.com/v1/repositories/debian/tags -O - \<br />
| sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}' | grep buster<br />
<br />
$ docker pull debian:buster<br />
</pre><br />
<br />
or alternatively (for the really hard to reach bits)<br />
<br />
<pre><br />
$ docker search vicamo<br />
<br />
$ wget -q https://registry.hub.docker.com/v1/repositories/vicamo/debian/tags -O - \<br />
| sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}'<br />
<br />
...<br />
buster-i386<br />
buster-i386-sbuild<br />
buster-i386-slim<br />
...<br />
<br />
$ docker pull vicamo/debian:buster-i386-slim<br />
</pre><br />
<br />
Generally speaking, if a developer on e.g. Github says that he has a special-purpose image, some combination of the above commands will allow the required version (e.g. in the above example tagged buster-i386-slim) to be pulled.<br />
<br />
Neither a container nor an image is directly mountable e.g. by using losetup. It is possible to copy files to or from a container using the <code>docker container cp</code> command, subject to the same precautions that one would take on a running unix system.<br />
<br />
=== A 64-bit Docker container with basic utilities ===<br />
<br />
This is a basic installation of a 64-bit Debian stable release ("Buster" at the time of writing) on the same host version. This is useful in a situation where a developer wants to experiment with libraries etc. that he does not normally have installed, it should probably not be trusted to quarantine untrusted code.<br />
<br />
In the instructions below, commands on the host are run in the context of a normal user so are shown prefixed by a $ prompt, while commands run in the context of the container are run by root so shown prefixed by a # prompt.<br />
<br />
<pre><br />
$ docker pull debian:buster<br />
<br />
$ docker run --interactive --tty debian:buster<br />
<br />
# apt-get update<br />
<br />
# apt-get install dialog tasksel python3<br />
<br />
# tasksel --new-install<br />
<br />
# dpkg-reconfigure locales<br />
</pre><br />
<br />
Using tasksel, remove desktop and print server and add SSH. The author favours installing net-tools so that the <code>netstat -an</code> command can be used to check socket accessibility.<br />
<br />
<pre><br />
# apt-get install net-tools elvis-tiny<br />
</pre><br />
<br />
So far there is no provision for starting the SSH daemon. Add or edit /etc/rc.local to contain<br />
<br />
<pre><br />
#!/bin/sh<br />
<br />
rm -rf /tmp/*<br />
<br />
# For cases where a 32-bit container is running (by implication on a 64-bit host), make<br />
# sure that commands such as uname -a return consistent information to avoid breaking <br />
# the traditional ./configure && make operation.<br />
<br />
(file -L /bin/sh | grep -q 'ELF 32-bit LSB')<br />
if [ $? -eq 0 ] ; then<br />
LINUX32=linux32<br />
fi<br />
<br />
cd /etc/init.d<br />
$LINUX32 ./ssh start<br />
# $LINUX32 ./openbsd-inetd start<br />
<br />
cd<br />
exec $LINUX32 /bin/bash<br />
</pre><br />
<br />
The ID of the current container is in the prompt. Exit it and commit to a new image, then start with a parameter to expose the SSH socket:<br />
<br />
<pre><br />
# exit<br />
<br />
$ docker container commit 4efab4804fb6 debian_minimal<br />
<br />
$ docker run -it -p 65022:22 \<br />
--entrypoint=/etc/rc.local debian_minimal<br />
<br />
# groupadd -g 1000 markMLl<br />
<br />
# useradd -g markMLl -u 1000 -m -d /home/markMLl markMLl<br />
<br />
# passwd markMLl<br />
</pre><br />
<br />
Add newly created user name to sudo group (/etc/group and /etc/gshadow files). Note the container ID, if it is now stopped the parameters are preserved and it should be possible to start it in the background and connect as the above user via SSH.<br />
<br />
<pre><br />
$ docker container stop c5be7fd96866<br />
<br />
$ docker container start c5be7fd96866<br />
<br />
$ ssh localhost -p 65022<br />
</pre><br />
<br />
The above is a good starting point for a general-purpose containerised system. The section below will also show how to get a graphical program (e.g. the Lazarus IDE) running in a container.<br />
<br />
=== A 32-bit Docker container with FPC and Lazarus ===<br />
<br />
An understanding of the principles and commands described above is a prerequisite to continuing with this section.<br />
<br />
Unlike Qemu, a container will run at the host computer's full speed. Unlike User Mode Linux (UML), a 32-bit container will run on a 64-bit host. Subject to security issues, this makes Docker the preferred choice when setting up a temporary 32-bit environment to e.g. investigate libraries which would not normally be installed on the host.<br />
<br />
This section discusses installing a 32-bit Debian "Lenny" container, which allows a program to be checked with libraries etc. dating from roughly 2008.<br />
<br />
Referring to https://github.com/lpenz/docker-debian-releases/<br />
<br />
<pre><br />
$ docker pull lpenz/debian-lenny-i386<br />
<br />
$ docker image ls<br />
<br />
$ docker run --interactive --tty lpenz/debian-lenny-i386<br />
</pre><br />
<br />
Lenny authentication is broken and is not going to be fixed (short of forking the entire repository). In /etc/apt/apt.conf put<br />
<br />
<pre><br />
APT <br />
{<br />
// Options for apt-get<br />
Get <br />
{<br />
AllowUnauthenticated "true";<br />
}<br />
}<br />
</pre><br />
<br />
which should allow tasksel etc. to work. Add contrib and non-free to /etc/apt/sources.list, then<br />
<br />
<pre><br />
# apt-get update<br />
<br />
# apt-get upgrade<br />
<br />
# tasksel --new-install<br />
<br />
# dpkg-reconfigure locales<br />
<br />
# apt-get install openssh-server sudo<br />
</pre><br />
<br />
Populate /etc/rc.local as discussed above, comment out the temporary setting from /etc/apt/apt.conf<br />
<br />
Create group and user as discussed above, add user to sudo group.<br />
<br />
Add the build-essential, gdb, subversion and zip packages as basic prequisites. Add libncurses5-dev, libncursesw5-dev and libgpm-dev to allow FPC to be rebuilt, plus possibly libpango1.0-dev for the FP IDE. Install FPC v2.2.4 binary for i386 and corresponding sources, the compiler should run and be able to recompile itself.<br />
<br />
Install the libgtk1.2-dev package then Lazarus 0.9.24.1, don't attempt to run it yet. In the per-user shell startup file e.g. ~/.bashrc put the line<br />
<br />
export DISPLAY=:0<br />
<br />
then exit and commit the container as described above and restart with something like<br />
<br />
$ docker run -it -p 65022:22 -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix \<br />
--entrypoint=/etc/rc.local lenny_with_lazarus<br />
<br />
Again, details as discussed in the section above.<br />
<br />
It should now be possible to login to the container from the host over SSH, invoke e.g. /usr/local/share/lazarus/lazarus by name, and have the IDE appear on the host computer's screen.<br />
<br />
== Further Reading ==<br />
<br />
* [http://www.aurel32.net/info/debian_arm_qemu.php Debian on an emulated ARM machine]<br />
* [https://forum.lazarus.freepascal.org/index.php/topic,56098.msg420159.html#msg420159 Debian 11 on an emulated ARM/ARM64 machine]<br />
* [http://www.aurel32.net/info/debian_mips_qemu.php Debian on an emulated MIPS(EL) machine]<br />
* [http://en.wikibooks.org/wiki/QEMU/Windows_XP QEMU/Windows XP on Wikibooks]<br />
* [http://user-mode-linux.sourceforge.net/ The User-mode Linux Kernel Home Page]<br />
* [http://www.josefsipek.net/docs/s390-linux/hercules-s390.html Installing Debian under Hercules]<br />
<br />
==See also==<br />
<br />
* [[Native ARM Systems]] <br />
* [[Native MIPS Systems]]<br />
* [[Small Virtual Machines]]<br />
* [[Docker Containerization]]<br />
<br />
[[Category: Emulators]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=Qemu_and_other_emulators&diff=147103Qemu and other emulators2021-10-04T10:01:54Z<p>Seenkao: </p>
<hr />
<div>This note covers setting up Qemu on an x86-based development system running Linux. This allows native (rather than cross) development tools to be run, which can be useful:<br />
* where the target system has performance/resource issues (e.g. some ARM systems)<br />
* is not run natively due to company policy (older versions of Microsoft Windows)<br />
* is quite simply unavailable at a reasonable price (e.g. SGI MIPS systems or the Chinese MIPS-based systems).<br />
<br />
It also briefly mentions User Mode Linux for x86 and the Hercules emulator for IBM zSeries mainframes despite the fact that these are not particularly relevant to Free Pascal, and Docker containerisation. It does not consider x86-on-x86 virtualisation systems such as VMware, Microsoft Hyper-V or Oracle VirtualBox, and only considers Linux KVM as a foundation technology for Qemu.<br />
<br />
== The Host System ==<br />
<br />
In the current case, the host is a Compaq rack-mount server running at around 3GHz with several Gb RAM; be warned that performance will drop off drastically with a lower specification system. It has two internal drive cages, the first is connected to a RAID controller and is used for the host operating system and tools, the second is connected to a SCSI controller and contains 6x discs each of which is used for a different guest system.<br />
<br />
The host IP address is 192.168.1.22 and the system is named pye-dev-07, the default gateway and name server are on 192.168.1.1. Guest systems are on the 192.168.22.x subnet and are named pye-dev-07a (192.168.22.16), pye-dev-07b (192.168.22.17) and so on, they have their own gateway 192.168.22.1 which is known to the site router and firewalls.<br />
<br />
The host operating system is Debian "Squeeze", the host normally runs headless and may be accessed by SSH, X using XDMCP, or VNC. The display manager is gdm since this has a better XDMCP implementation than the alternatives, however in practice graphical login is most often handled by VNC.<br />
<br />
The following guests are implemented:<br />
<br />
; pye-dev-07a : Debian on ARM (little-endian, armel) using Qemu<br />
<br />
; pye-dev-07b : Debian on MIPS (little-endian, mipsel) using Qemu<br />
<br />
; pye-dev-07c : Slackware x86 13.37 using Qemu<br />
<br />
; pye-dev-07d : Slackware x86 13.37 using User Mode Linux<br />
<br />
; pye-dev-07e : Windows 2K using Qemu<br />
<br />
; pye-dev-07f : Debian on zSeries using the Hercules emulator<br />
<br />
; pye-dev-07g : Debian on 68k using the Aranym emulator<br />
<br />
Originally, pye-dev-07a was earmarked for big-endian ARM, but this appears to be being phased out by Debian so is probably no longer a viable target. Anybody planning to port FPC to the AVR-based Arduino?<br />
<br />
In general, multiple guests can run simultaneously although this has not been exhaustively tested recently.<br />
<br />
In the case of Linux the guest systems are each installed on an 18Gb disc, in the case of Windows a 36Gb disc is used. Each disc is assigned a label using e2label (arm, armel and so on), so that the startup script can mount it by name irrespective of which drive cage slot it's in.<br />
<br />
== Debian Guest using Qemu ==<br />
<br />
Select a suitable Debian mirror and version, for example<br />
<br />
http://ftp.de.debian.org/debian/dists/squeeze/main/...<br />
<br />
Fetch a kernel and initrd image for Debian Squeeze, as below.<br />
<br />
<u>For ARM (little-endian):</u><br />
.../main/installer-armel/current/images/versatile/netboot/vmlinux-2.6.32-5-versatile<br />
.../main/installer-armel/current/images/versatile/netboot/initrd.gz<br />
<br />
In addition for this architecture you also need:<br />
<br />
http://people.debian.org/~aurel32/qemu/armel/initrd.img-2.6.32-5-versatile<br />
<br />
<u>For MIPS (little-endian):</u><br />
.../main/installer-mipsel/current/images/malta/netboot/vmlinux-2.6.32-5-4kc-malta<br />
.../main/installer-mipsel/current/images/malta/netboot/initrd.gz<br />
<br />
Copy these to the disc reserved for the guest, e.g. /export/mipsel.<br />
<br />
Create a filesystem for Qemu, e.g.:<br />
<br />
<syntaxhighlight lang="bash"># qemu-img create -f qcow mipsel_hda.img 16G</syntaxhighlight><br />
<br />
Expect that to round up to around 17.1 Gb, if it doesn't then experiment. Start Qemu, telling it what kernel, initrd and filesystem to use:<br />
<br />
<u>For ARM (little-endian):</u><br />
<syntaxhighlight lang="bash"><br />
# qemu-system-arm -M versatilepb -kernel vmlinuz-2.6.32-5-versatile -initrd initrd.gz \<br />
-hda armel_hda.img -append root=/dev/ram<br />
</syntaxhighlight><br />
<br />
Note that the above command requires X access, e.g. ssh with the -X option.<br />
<br />
<u>For MIPS (little-endian):</u><br />
<syntaxhighlight lang="bash"><br />
# qemu-system-mipsel -M malta -kernel vmlinux-2.6.32-5-4kc-malta -initrd initrd.gz \<br />
-hda mipsel_hda.img -append "root=/dev/ram console=ttyS0" -nographic<br />
</syntaxhighlight><br />
<br />
Install the guest operating system as usual, splitting the disc into 16.5Gb for / with the remainder (around 700Mb) as swap. This will be slow, 8 or 9 hours is not implausible, so make sure that nobody's about to turn off your mains or disconnect you from the Internet.<br />
<br />
Don't worry if it tells you it's not installing a loader- it's not needed since the kernel and initrd are loaded into memory by the host.<br />
<br />
Boot the operating system and set network addresses etc. Use 192.168.22.16 or similar, with a gateway of 192.168.22.1.<br />
<br />
<u>For ARM (little-endian):</u><br />
<syntaxhighlight lang="bash"><br />
# qemu-system-arm -M versatilepb -kernel vmlinuz-2.6.32-5-versatile \<br />
-initrd initrd.img-2.6.32-5-versatile -hda armel_hda.img -append "root=/dev/sda1"<br />
</syntaxhighlight><br />
<br />
<u>For MIPS (little-endian):</u><br />
<syntaxhighlight lang="bash"><br />
# qemu-system-mipsel -M malta -kernel vmlinux-2.6.32-5-4kc-malta \<br />
-hda mipsel_hda.img -append "root=/dev/sda1 console=ttyS0" -nographic<br />
</syntaxhighlight><br />
<br />
Finally, you should be able to boot the operating system with an operational network. This relies on having /etc/qemu-ifup and /etc/qemu-ifdown files (see below), and passes additional parameters to them in shell variables. In outline:<br />
<br />
<u>For ARM (little-endian):</u><br />
<syntaxhighlight lang="bash"><br />
# qemu-system-arm -M versatilepb -m 256 -hda armel_hda.img \<br />
-kernel vmlinuz-2.6.32-5-versatile -initrd initrd.img-2.6.32-5-versatile \<br />
-append 'root=/dev/sda1 text' \<br />
-net nic,macaddr=00:16:3e:00:00:01 -net tap,ifname=tun1<br />
</syntaxhighlight><br />
<br />
<u>For MIPS (little-endian):</u><br />
<syntaxhighlight lang="bash"><br />
# qemu-system-mipsel -M malta -m 256 -hda mipsel_hda.img \<br />
-kernel vmlinux-2.6.32-5-4kc-malta -no-reboot \<br />
-append 'root=/dev/sda1 console=ttyS0' -nographic \<br />
-net nic,macaddr=00:16:3e:00:00:02 -net tap,ifname=tun2<br />
</syntaxhighlight><br />
<br />
Remember that if you change the network interface type or MAC address you will probably need to delete entries from the guest's /etc/udev/rules.d/z??_persistent-net.rules file.<br />
<br />
== Windows 2K Guest using Qemu ==<br />
<br />
Use dd to save a .iso image of the installation CD. Create a filesystem image:<br />
<br />
<syntaxhighlight lang="bash"># qemu-img create -f qcow2 win2k.img 32G</syntaxhighlight><br />
<br />
Boot using startup script as below. Note that this must specify a non-default network card, since Qemu's current (as of 2011) default is not supported by Windows 2K.<br />
<br />
''TODO: run with kernel support module.''<br />
<br />
== KVM on a Linux host ==<br />
<br />
KVM (Kernel-based Virtual Machine) is an enabling API supported on more recent x86 and x86-64 (AMD64) systems, this replaces the older KQemu kernel module which is now deprecated by both Qemu and the kernel.<br />
<br />
KVM is typically enabled by the host system BIOS. If not enabled by the BIOS it cannot be enabled by the kernel or by (a suitably privileged) application program, since the x86 architecture requires power to be cycled to change the state of this facility. The result of this is that KVM might be unavailable (no /dev/kvm device) even if it shown as supported by the CPU flags in /proc/cpuinfo.<br />
<br />
== Common Qemu startup, ifup and ifdown scripts ==<br />
<br />
There is much commonality irrespective of whether the guest is running Linux or Windows.<br />
<br />
<u>First startup script (e.g. /export/C):</u><br />
<syntaxhighlight lang="bash"><br />
#!/bin/sh<br />
<br />
mount -L mipsel<br />
cd /export/mipsel<br />
. ./C-2<br />
</syntaxhighlight><br />
<br />
<u>Second startup script for ARM (little-endian):</u><br />
<syntaxhighlight lang="bash"><br />
#!/bin/sh<br />
<br />
# Routine startup of a Qemu guest relies on (the host) running /etc/qemu-ifup<br />
# to condition ARP, forwarding etc.<br />
<br />
QEMU_ID=1<br />
QEMU='qemu-system-arm -M versatilepb'<br />
QEMU_RAM='-m 256'<br />
QEMU_HD='-hda armel_hda.img'<br />
QEMU_CD=''<br />
QEMU_BOOT="-kernel vmlinuz-2.6.32-5-versatile -append 'root=/dev/sda1 text' -initrd initrd.img-2.6.32-5-versatile"<br />
# QEMU_MONITOR='-monitor stdio -nographic'<br />
# QEMU_MONITOR='-nographic'<br />
QEMU_VGA=''<br />
VNC_ID=$(($QEMU_ID+1))<br />
# QEMU_VNC="-vnc :$VNC_ID -k en-gb"<br />
QEMU_VNC=''<br />
QEMU_NET="-net nic,macaddr=00:16:3e:00:00:0$QEMU_ID -net tap,ifname=tun$QEMU_ID"<br />
QEMU_GUEST_IP_ADDRESS=192.168.22.17<br />
QEMU_GUEST_IP_GATEWAY=192.168.22.1<br />
QEMU_HOST_GATEWAY_IF=eth1<br />
export QEMU_GUEST_IP_ADDRESS QEMU_GUEST_IP_GATEWAY QEMU_HOST_GATEWAY_IF<br />
<br />
echo \* $QEMU $QEMU_RAM $QEMU_HD $QEMU_CD $QEMU_BOOT \<br />
$QEMU_MONITOR $QEMU_VGA $QEMU_NET $QEMU_VNC<br />
<br />
screen -S QEMU_$QEMU_ID \<br />
sh -c "$QEMU $QEMU_RAM $QEMU_HD $QEMU_CD $QEMU_BOOT \<br />
$QEMU_MONITOR $QEMU_VGA $QEMU_NET $QEMU_VNC"<br />
<br />
cd ..<br />
</syntaxhighlight><br />
<br />
<u>Second startup script for MIPS (little-endian):</u><br />
<syntaxhighlight lang="bash"><br />
#!/bin/sh<br />
<br />
# Routine startup of a Qemu guest relies on (the host) running /etc/qemu-ifup<br />
# to condition ARP, forwarding etc.<br />
<br />
QEMU_ID=2<br />
QEMU='qemu-system-mipsel -M malta'<br />
QEMU_RAM='-m 256'<br />
QEMU_HD='-hda mipsel_hda.img'<br />
QEMU_CD=''<br />
QEMU_BOOT="-kernel vmlinux-2.6.32-5-4kc-malta -append 'root=/dev/sda1 console=ttyS0' -no-reboot"<br />
# QEMU_MONITOR='-monitor stdio -nographic'<br />
QEMU_MONITOR='-nographic'<br />
QEMU_VGA=''<br />
VNC_ID=$(($QEMU_ID+1))<br />
# QEMU_VNC="-vnc :$VNC_ID -k en-gb"<br />
QEMU_VNC=''<br />
QEMU_NET="-net nic,macaddr=00:16:3e:00:00:0$QEMU_ID -net tap,ifname=tun$QEMU_ID"<br />
QEMU_GUEST_IP_ADDRESS=192.168.22.18<br />
QEMU_GUEST_IP_GATEWAY=192.168.22.1<br />
QEMU_HOST_GATEWAY_IF=eth1<br />
export QEMU_GUEST_IP_ADDRESS QEMU_GUEST_IP_GATEWAY QEMU_HOST_GATEWAY_IF<br />
<br />
echo \* $QEMU $QEMU_RAM $QEMU_HD $QEMU_CD $QEMU_BOOT \<br />
$QEMU_MONITOR $QEMU_VGA $QEMU_NET $QEMU_VNC<br />
<br />
screen -S QEMU_$QEMU_ID \<br />
sh -c "$QEMU $QEMU_RAM $QEMU_HD $QEMU_CD $QEMU_BOOT \<br />
$QEMU_MONITOR $QEMU_VGA $QEMU_NET $QEMU_VNC"<br />
<br />
cd ..<br />
</syntaxhighlight><br />
<br />
<u>Second startup script for Windows:</u><br />
<syntaxhighlight lang="bash"><br />
#!/bin/sh<br />
<br />
# Routine startup of a Qemu guest relies on (the host) running /etc/qemu-ifup<br />
# to condition ARP, forwarding etc.<br />
<br />
QEMU_ID=4<br />
QEMU=qemu<br />
QEMU_RAM='-m 256'<br />
QEMU_HD='-hda win2k.img'<br />
QEMU_CD='-cdrom Windows2k-SP4.iso'<br />
QEMU_BOOT='-boot c'<br />
QEMU_MONITOR='-monitor stdio'<br />
QEMU_VGA='-vga cirrus'<br />
VNC_ID=$(($QEMU_ID+1))<br />
QEMU_VNC="-vnc :$VNC_ID -k en-gb"<br />
QEMU_NET="-net nic,macaddr=00:16:3e:00:00:0$QEMU_ID,model=rtl8139 -net tap,ifname=tun$QEMU_ID"<br />
QEMU_GUEST_IP_ADDRESS=192.168.22.20<br />
QEMU_GUEST_IP_GATEWAY=192.168.22.1<br />
QEMU_HOST_GATEWAY_IF=eth1<br />
export QEMU_GUEST_IP_ADDRESS QEMU_GUEST_IP_GATEWAY QEMU_HOST_GATEWAY_IF<br />
<br />
echo \* $QEMU $QEMU_RAM $QEMU_HD $QEMU_CD $QEMU_BOOT \<br />
$QEMU_MONITOR $QEMU_VGA $QEMU_NET $QEMU_VNC<br />
<br />
screen -S QEMU_$QEMU_ID \<br />
$QEMU $QEMU_RAM $QEMU_HD $QEMU_CD $QEMU_BOOT \<br />
$QEMU_MONITOR $QEMU_VGA $QEMU_NET $QEMU_VNC<br />
<br />
cd ..<br />
</syntaxhighlight><br />
<br />
<u>/etc/qemu-ifup (for both Linux and Windows):</u><br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
<br />
# if-up file for qemu, heavily cribbed from the command sequence embedded in<br />
# User Mode Linux. MarkMLl.<br />
<br />
echo Running /etc/qemu-ifup $1 $2...<br />
<br />
# For compatibility with UML the only parameter here is $1 which is the<br />
# interface name. I've put in a reference to $2 so we can see it if anything<br />
# changes.<br />
<br />
# I'm going to assume that qemu is always run by root. This is fairly<br />
# reasonable since it allows guest OSes to be fired up which themselves might<br />
# give access to confidential data etc. if compromised.<br />
<br />
# Here's my equivalent to the host-side UML setup for Qemu. We're hamstrung<br />
# here by the fact that the emulator is not telling us what IP address it's<br />
# trying to enable, there isn't a 1:1 correspondence between IP addresses and<br />
# interfaces since the latter depends on the order the sessions are started.<br />
#<br />
# As a hack, assume that the caller exports QEMU_GUEST_IP_ADDRESS (e.g.<br />
# 192.168.17.16), QEMU_GUEST_IP_GATEWAY (e.g. 192.168.17.1) and<br />
# QEMU_HOST_GATEWAY_IF (e.g. eth0).<br />
<br />
echo \* modprobe tun<br />
modprobe tun<br />
<br />
echo \* ifconfig $1 $QEMU_GUEST_IP_GATEWAY netmask 255.255.255.255 up<br />
ifconfig $1 $QEMU_GUEST_IP_GATEWAY netmask 255.255.255.255 up<br />
<br />
X=`cat /proc/sys/net/ipv4/ip_forward`<br />
if [ "$X" == "0" ]; then<br />
<br />
# Use either this...<br />
<br />
# echo Global forwarding is not enabled. Please refer to the administrator<br />
# echo responsible for this machine, enabling it might be a security hazard.<br />
<br />
# ...or this.<br />
<br />
echo Forcibly enabling global forwarding, note that this might be a security hazard.<br />
echo \* echo 1 \> /proc/sys/net/ipv4/ip_forward<br />
echo 1 > /proc/sys/net/ipv4/ip_forward<br />
X=`cat /proc/sys/net/ipv4/ip_forward`<br />
if [ "$X" == "0" ]; then<br />
echo Unable to enable global forwarding. Please refer to the administrator<br />
echo responsible for this machine.<br />
fi<br />
fi<br />
<br />
echo \* route add -host $QEMU_GUEST_IP_ADDRESS dev $1<br />
route add -host $QEMU_GUEST_IP_ADDRESS dev $1<br />
<br />
echo \* echo 1 \> /proc/sys/net/ipv4/conf/$1/proxy_arp<br />
echo 1 > /proc/sys/net/ipv4/conf/$1/proxy_arp<br />
X=`cat /proc/sys/net/ipv4/conf/$1/proxy_arp`<br />
if [ "$X" == "0" ]; then<br />
echo -n Retrying<br />
while [ "$X" == "0" ]; do<br />
sleep 1<br />
echo -n .<br />
echo 1 > /proc/sys/net/ipv4/conf/$1/proxy_arp<br />
X=`cat /proc/sys/net/ipv4/conf/$1/proxy_arp`<br />
done<br />
echo OK<br />
fi<br />
<br />
echo \* arp -Ds $QEMU_GUEST_IP_ADDRESS $1 pub<br />
arp -Ds $QEMU_GUEST_IP_ADDRESS $1 pub<br />
<br />
echo \* arp -Ds $QEMU_GUEST_IP_ADDRESS $QEMU_HOST_GATEWAY_IF pub<br />
arp -Ds $QEMU_GUEST_IP_ADDRESS $QEMU_HOST_GATEWAY_IF pub<br />
<br />
# Set up experimental UDP proxies. Depending on the protocol of interest<br />
# messages in one or both directions might need to be relayed.<br />
#<br />
# UDP port 79 is used for Dialarm signals, a unidirectional proxy is<br />
# adequate for this but detection of hosts changing state (i.e. being<br />
# added to or removed from the population of cooperating systems) is far<br />
# more responsive if a bidirectional proxy is available.<br />
<br />
PROXY_ID=1<br />
case "$1" in<br />
tun1)<br />
PROXY_ID=2<br />
;;<br />
tun2)<br />
PROXY_ID=3<br />
;;<br />
tun3)<br />
PROXY_ID=4<br />
;;<br />
tun4)<br />
PROXY_ID=5<br />
;;<br />
tun5)<br />
PROXY_ID=6<br />
;;<br />
tun6)<br />
PROXY_ID=7<br />
;;<br />
tun7)<br />
PROXY_ID=8<br />
;;<br />
esac<br />
<br />
# echo \* udp-broadcast-relay -f $PROXY_ID 79 $QEMU_HOST_GATEWAY_IF $1<br />
# /usr/local/src/udp-broadcast-relay/udp-broadcast-relay-0.3/udp-broadcast-relay \<br />
# -f $PROXY_ID 79 $QEMU_HOST_GATEWAY_IF $1<br />
<br />
# Alternatively use this one which is oriented towards IP addresses<br />
# rather than interfaces.<br />
<br />
# Note attempt to counteract any niceness applied to Qemu itself.<br />
<br />
ps ax | grep 'udp-proxy[ ]-z 79 ' >/dev/null 2>&1<br />
if [ $? != 0 ]; then<br />
echo \* udp-proxy -z 79 $QEMU_GUEST_IP_ADDRESS<br />
/usr/bin/nice --adjustment=20 /usr/local/src/udp-proxy/udp-proxy -z 79 $QEMU_GUEST_IP_ADDRESS<br />
else<br />
echo \* Already running udp-proxy -z 79 $QEMU_GUEST_IP_ADDRESS<br />
fi<br />
<br />
# echo \* udp-proxy -z 13264 $QEMU_GUEST_IP_ADDRESS<br />
# /usr/local/src/udp-proxy/udp-proxy -z 13264 $QEMU_GUEST_IP_ADDRESS<br />
<br />
echo .../qemu/qemu-ifup completed.<br />
</syntaxhighlight><br />
<br />
<u>/etc/qemu-ifdown (for both Linux and Windows):</u><br />
<syntaxhighlight lang="bash"><br />
#!/bin/sh<br />
<br />
echo \* route del -host $QEMU_GUEST_IP_ADDRESS dev $1<br />
route del -host $QEMU_GUEST_IP_ADDRESS dev $1<br />
<br />
echo \* ifconfig $1 down<br />
ifconfig $1 down<br />
</syntaxhighlight><br />
<br />
In actual fact, these operations were cribbed from User Mode Linux (below) where they are embedded inside a host library.<br />
<br />
== Slackware x86 Guest using User Mode Linux ==<br />
<br />
User Mode Linux runs a guest kernel as a standard program, i.e. there is no emulation or virtualisation involved. The guest kernel can be allocated either physical discs or filesystems contained in files.<br />
<br />
Put a .iso corresponding to a recent Slackware DVD in /export/uml. Unpack the initrd using zcat and cpio, save it as an ext3 image initrd_unpacked. Using dd create an empty file root_fs_slackware which will be partitioned and formatted during installation.<br />
<br />
Use the sources from e.g. a recent Slackware to compile kernel plus modules with ARCH=um using a suffix -uml. Save the kernel to /export/uml/linux, install the modules and then copy them into the initrd filesystem.<br />
<br />
Boot the UML kernel, telling it to use the initrd image and DVD iso:<br />
<br />
<syntaxhighlight lang="bash"># ./linux ubd0=initrd_unpacked ubd1=root_fs_slackware fake_ide ubd2r=slackware-13.37-install-dvd.iso rw</syntaxhighlight><br />
<br />
Run fdisk and setup as normal, you might need to tell it to install to /dev/ubd1 and use /dev/ubd2 for source. Finally, copy the modules onto the target filesystem.<br />
<br />
When complete start up like this:<br />
<br />
<syntaxhighlight lang="bash"><br />
# Routine startup of a UML guest relies on (the host) running /usr/lib/uml/uml_net<br />
# to condition ARP, forwarding etc.<br />
<br />
echo \* ./linux ubd0=initrd_unpacked ubd1=root_fs_slackware fake_ide ubd2r=slackware-13.37-install-dvd.iso \<br />
root=/dev/ubdb1 eth0=tuntap,,,192.168.1.22<br />
<br />
screen -S UML_3 \<br />
./linux ubd0=initrd_unpacked ubd1=root_fs_slackware fake_ide ubd2r=slackware-13.37-install-dvd.iso \<br />
root=/dev/ubdb1 eth0=tuntap,,,192.168.1.22<br />
<br />
cd ..<br />
</syntaxhighlight><br />
<br />
Note that this is usually run from an X session, since the multiple virtual consoles appear as separate xterms. Also see [http://wiki.freepascal.org/linux/kernel/user_mode_VM].<br />
<br />
== Debian 68k Guest using Aranym ==<br />
<br />
<syntaxhighlight lang="bash"># apt-get install aranym</syntaxhighlight><br />
<br />
I (MarkMLl) note this installs bridge-utils but instead am going to use my standard Qemu-style startup scripts, which themselves were originally based on sequences executed internally by UML; note that Hercules for zSeries (above) is the odd-one-out here since the guest uses SLIP for networking.<br />
<br />
Referring to https://wiki.debian.org/Aranym/Quick, download https://www.freewrt.org/~tg/dc11m68k.tgz and check its signature. Unpack, noting a kernel vmlinuz-2.6.39-2-atari, a filesystem image dc11.img.xz and a configuration file aranym.config.<br />
<br />
In aranym.config, change the ETH0 section to read:<br />
<br />
Type = ptp<br />
HostIP = 192.168.22.1<br />
AtariIP = 192.168.22.22<br />
Netmask = 255.255.255.0<br />
<br />
Change the startup script runaranym to read:<br />
<br />
<syntaxhighlight lang="bash"><br />
#!/bin/sh<br />
<br />
QEMU_GUEST_IP_ADDRESS=192.168.22.22<br />
QEMU_GUEST_IP_GATEWAY=192.168.22.1<br />
QEMU_HOST_GATEWAY=eth0<br />
export QEMU_GUEST_IP_ADDRESS QEMU_GUEST_IP_GATEWAY QEMU_HOST_GATEWAY<br />
<br />
/etc/qemu-ifup tap7<br />
<br />
cd "$(dirname "$0")"<br />
SDL_AUDIODRIVER=dummy; export SDL_AUDIODRIVER<br />
aranym-mmu -l -c aranym.config<br />
<br />
/etc/qemu-ifdown tap7<br />
</syntaxhighlight><br />
<br />
Uncompress the image file:<br />
<br />
<syntaxhighlight lang="bash"># unxz dc11.img.xz</syntaxhighlight><br />
<br />
Using xterm on a graphical login, run the startup script:<br />
<br />
<syntaxhighlight lang="bash"># runaranym</syntaxhighlight><br />
<br />
The result of that should be a console for the guest Debian system.<br />
<br />
On the guest console, login as root with password root, and immediately change the password to something appropriate using the passwd command. Change the hostname in /etc/hostname and /etc/hosts, the IP address etc. in /etc/network/interfaces, and the nameserver in /etc/resolv.conf. Reboot and check that the network is operational by pinging from the guest to the site router (e.g. 192.168.1.1) and then pinging the guest (192.168.22.22) from any convenient system; if this doesn't work fix it before continuing.<br />
<br />
Then as described on https://wiki.debian.org/Aranym/Quick run the three commands:<br />
<br />
<syntaxhighlight lang="bash"><br />
# dpkg-reconfigure openssh-server<br />
# apt-get update<br />
# apt-get install popularity-contest<br />
</syntaxhighlight><br />
<br />
Finally edit /root/profile to remove the reminder to run the above. It should now be possible to login using SSH, and to continue to configure and use the system like any Debian guest.<br />
<br />
== Debian zSeries Guest using Hercules, without VM ==<br />
<br />
Hercules is a commercial-grade emulator for IBM mainframes, it is available as a standard package for e.g. Debian and related Linux distributions. Once the emulator is running, enter<br />
<br />
ipl 120<br />
<br />
to boot Linux from device 120. Hopefully SSH will be operational so you won't need to interact with the console, but if you do then prefix each line that is to go to the guest operating system (i.e. rather than to the console itself) with a dot.<br />
<br />
Refer to the URL in the script below for more details.<br />
<br />
Startup:<br />
<br />
<syntaxhighlight lang="bash"><br />
#!/bin/sh<br />
<br />
# PREREQUISITE: Boot with ipl 120<br />
<br />
# Note that this makes no attempt to support IPv6.<br />
<br />
iptables -t nat -A POSTROUTING -o eth1 -s 192.168.22.0/24 -j MASQUERADE<br />
iptables -A FORWARD -s 192.168.22.0/24 -j ACCEPT<br />
iptables -A FORWARD -d 192.168.22.0/24 -j ACCEPT<br />
echo 1 > /proc/sys/net/ipv4/ip_forward<br />
echo 1 > /proc/sys/net/ipv4/conf/all/proxy_arp<br />
<br />
# http://www.josefsipek.net/docs/s390-linux/hercules-s390.html<br />
<br />
screen -S HERC_5 \<br />
hercules<br />
<br />
cd ..<br />
</syntaxhighlight><br />
<br />
Configuration:<br />
<br />
CPUSERIAL 000069 # CPU serial number<br />
CPUMODEL 9672 # CPU model number<br />
MAINSIZE 256 # Main storage size in megabytes<br />
XPNDSIZE 0 # Expanded storage size in megabytes<br />
CNSLPORT 3270 # TCP port number to which consoles connect<br />
NUMCPU 2 # Number of CPUs<br />
LOADPARM 0120.... # IPL parameter<br />
OSTAILOR LINUX # OS tailoring<br />
PANRATE SLOW # Panel refresh rate (SLOW, FAST)<br />
ARCHMODE ESAME # Architecture mode ESA/390 or ESAME<br />
<br />
# .-----------------------Device number<br />
# | .-----------------Device type<br />
# | | .---------File name and parameters<br />
# | | |<br />
# V V V<br />
#--- ---- --------------------<br />
<br />
# console<br />
001F 3270<br />
<br />
# terminal<br />
0009 3215<br />
<br />
# reader<br />
000C 3505 /export/zlinux/rdr/kernel.debian /export/zlinux/rdr/parmfile.debian /export/zlinux/rdr/initrd.debian autopad eof<br />
<br />
# printer<br />
000E 1403 /export/zlinux/prt/print00e.txt crlf<br />
<br />
# dasd<br />
0120 3390 /export/zlinux/dasd/3390.LINUX.0120<br />
0121 3390 /export/zlinux/dasd/3390.LINUX.0121<br />
<br />
# tape<br />
0581 3420<br />
<br />
# network s390 realbox<br />
# 0A00,0A01 CTCI -n /dev/net/tun -t 1500 10.1.1.2 10.1.1.1<br />
0A00,0A01 CTCI -n /dev/net/tun -t 1500 192.168.22.21 192.168.1.22<br />
<br />
Note that the guest network is configured as SLIP via a simulated CTC (Channel To Channel) device. Best not fooled with.<br />
<br />
== Debian zSeries Guest using Hercules, with VM ==<br />
<br />
This combination is unlikely to work using freely-available software, since Linux requires at least an S/390 G3 system while the most recent IBM VM available is VM/370. It might be technically possible to run a non-free VM on Hercules, but at the time of writing it is at best unclear whether this could be done legally.<br />
<br />
This means that it is not, for example, possible to run a VM host with simultaneous Linux and MUSIC/SP guests.<br />
<br />
== MUSIC/SP using Sim/390 or Hercules ==<br />
<br />
''This section is an outline only. Note that in the IBM ecosystem OS and VM are the names of specific operating systems, rather than being a generic abbreviation; in addition DOS is a '60s-era IBM operating system with no connection to Microsoft or PCs.''<br />
<br />
MUSIC/SP is a freely-available (but not open source) operating system which implements a subset of IBM's MVS API, i.e. is to some extent compatible with operating systems of the OS/360 lineage in particular OS/VS1, extended with some novel features including a filesystem with user-accessible directories. It does not provide an API compatible with Linux, and uses the EBCDIC character set.<br />
<br />
Unlike other freely-available OS-compatible operating systems (see for example [http://www.ibiblio.org/jmaynard/], [http://gunkies.org/wiki/Installing_VM/370_on_Hercules], and the section below), MUSIC/SP provides TCP/IP networking. However this requires that the IUCV (Inter User Communication Vehicle) be provided by the underlying platform and that there is a suitable network support kernel for it to talk to: these are normally made available by IBM's VM operating system (VM/SP or VM/ESA, a sufficiently-recent version of which is not freely available).<br />
<br />
Considering emulated environments, IUCV can be provided either by running a recent VM on top of Hercules, or by running the freely-available (but not open source) Sim/390 emulator on Windows. Hercules does not provide IUCV or a network support kernel directly (although as of early 2012 this might be being addressed), so while MUSIC/SP will run on Hercules it will not have TCP/IP-based networking facilities: use Sim/390 if you really need this.<br />
<br />
Regrettably, the maintainer of MUSIC/SP and Sim/390 is no longer active, and while binaries and documentation remain available for download via [http://www.canpub.com/teammpg/de/mcgweb/] the sources are not.<br />
<br />
== VM/370 using Hercules ==<br />
<br />
''This section is an outline only. Note that in the IBM ecosystem OS and VM are the names of specific operating systems, rather than being a generic abbreviation; in addition DOS is a '60s-era IBM operating system with no connection to Microsoft or PCs.''<br />
<br />
VM/370, which is freely available as the "SixPack" (currently v1.2 as of early 2013), provides a hypervisor running on the "bare metal" which can host multiple single- or multitasking operating systems such as the (provided) Conversational Monitor System (CMS) or derivatives of DOS or OS (e.g. VSE or MVS).<br />
<br />
The CMS interactive environment is a distant cousin to unix, and is probably usable by anybody who remembers MS-DOS or older operating systems; the "SixPack" includes extensive but not complete online help. There is no networking API exposed to user programs: code and data may be moved between the host computer (running Hercules) and guest sessions by mounting files simulating tape devices, by simulations of an 80-column card punch and reader, or by a simulation of a line printer.<br />
<br />
In common with other IBM operating systems of the era, the documented API is in the form of macros for an IBM-compatible assembler; other types of interface are available including diag codes for communication between CMS and VM, and virtualised hardware access using Channel Control Words (CCWs). The services provided are roughly comparable with MS-DOS v1 or CP/M, i.e. there are separate sets of macros for handling different classes of peripherals: do not expect to open the terminal, card reader or printer as a file. Particularly if the S/380 hack (see below) is applied, the GCC compiler and standard libraries may be used but most software development and maintenance is done using assembler.<br />
<br />
== IBM S/370, S/390, and the S/380 "hack" ==<br />
<br />
''This section is an even sketchier outline.''<br />
<br />
As discussed elsewhere, the S/360 and S/370 architectures are limited to 24-bit addresses while the S/390 allows 31-bit addresses without, in general, breaking compatibility. There is an unofficial extension of the Hercules emulator (frowned upon by purists) that implements a non-standard "S/380" architecture and modifies the most-recent freely-available IBM mainframe operating systems (VSE nee DOS, MVS nee OS, and VM/370) to exploit this extension. Using this, there is sufficient available memory to run a large-scale compiler such as GCC ''natively'' on one of the classic IBM operating systems, with the important caveats that only one program can use this facility at a time (i.e. while a 31-bit GCC and a 24-bit make should work, two copies of the 31-bit GCC won't), and that in the case of VM one program means one program per computer rather than one program per virtualised system/login.<br />
<br />
To make use of this, you need the Hercules-380 patch from [http://mvs380.sourceforge.net/], a classic operating system such as the VM/CMS "sixpack" from [http://vm370.31bits.net/vm370sixpack-1_2.zip], and possibly the MECAFF enhancement for additional terminal sessions and the IND$FILE program. In practice, it is impossible to do any of this without joining Yahoo!, and subscribing to the Hercules-VM370, hercules-os380 and H390-VM groups.<br />
<br />
== IA-64 (Itanium, Merced, McKinley etc.) ==<br />
<br />
''Terminally sketchy.''<br />
<br />
The FPC port targeting IA-64 exists in absolutely minimal form, i.e. a few skeleton files and that's about it. Since the IA-64 architecture appears to be heading in the same direction as its predecessor the iAPX-432, it's highly questionable whether any more work will be done on this architecture. However, for completeness (and because this author wants to be able to inspect some Itanium binaries)...<br />
<br />
While a few systems turn up on eBay etc., the asking price tends to be dictated by what the seller paid a few years ago rather than by what anybody expects to pay today. There is a simulator, written by HP, called "Ski", which is now open source. See [http://www.gelato.unsw.edu.au/IA64wiki/SkiSimulator], [http://www.hpl.hp.com/research/linux/ski/download.php] plus the Sourceforge project repository.<br />
<br />
(On a fairly complete development system running Debian) get the most recent Ski sources from Sourceforge. Run autogen.sh, installing e.g. autoconf, libtool and libelf-dev if necessary. Run make, install additional libraries such as gperf, bison, flex etc. as necessary. It might be necessary to edit syscall-linux.c to comment out the reference to asm/page.h which apparently isn't needed for very recent (Linux 3.x) kernels. On success get root and run make install.<br />
<br />
Assuming the disc image is a file named /export/ia-64/sda (e.g. renamed from the downloaded sda-debian) then<br />
<br />
bski bootloader vmlinux simscsi=/export/ia-64/sd<br />
<br />
Note the dropped final letter, that parameter is used as a prefix rather than being the name of a file or directory.<br />
<br />
As with a number of other emulators described on this page, this requires an X session for the console.<br />
<br />
This writer (MarkMLl) can't get networking running, either using the instructions at [http://www.hpl.hp.com/research/linux/ski/HOWTO-ski-networking.php] or using a tun/tap solution very roughly as suggested by [http://www.gelato.unsw.edu.au/IA64wiki/SkiVirtualNetwork]. It might be necessary to try a much older host kernel, i.e. late 2.4 or early 2.6, however this is not currently being pursued due to lack of relevance.<br />
<br />
The kernel from HP is 2.4.20, the filesystem is described as "Debian Sid" but from the kernel version is probably somewhere between "Woody" (3.0) and "Sarge" (3.1). I don't know how easy it's going to be to get this up to scratch, at the very least a working network is going to be a prerequisite.<br />
<br />
----<br />
<br />
== Relative Performance ==<br />
<br />
Performance is, in general, disappointing. Using an informal "torture test" which exercises the CPU and disc access:<br />
<br />
Compaq ProLiant ML530 G2, 2.8GHz, 3Gb, 8 jobs, 390W 0m12.170 79<br />
<br />
Linksys NSLU2, 266MHz 32Mb, 1 job, 7W 6m35.014s 46<br />
<br />
Qemu ARM, 1 job, 390W 42m58.925s 16,757<br />
<br />
Qemu MIPS, 1 job, 390W 17m49.103s 6,949<br />
<br />
Qemu x86, 1 job, 390W 47m0.441s 18,330<br />
<br />
UML, 1 job, 390W 8m26.529s 3,289<br />
<br />
Hercules zSeries, 4 jobs, 390W 9m43.330s 3,790<br />
<br />
The final column in the above list is the W-Mins to complete the job. These timings are without the benefit of kernel support from kqemu (obsolete) or KVM, but the fact that Qemu's support for MIPS is significantly better than that for other architectures, and the fact that the Hercules emulator is in all cases better than Qemu, does make one wonder how efficient the code is.<br />
<br />
Compiling FPC 2.4.2 using time make NOGDB=1 OPT='-O- -gl' all :<br />
<br />
Host (x86, Linux, Debian):<br />
<br />
real 4m47.842s<br />
user 3m42.126s<br />
sys 0m33.506s<br />
<br />
Slug (32Mb, ARM, Linux, Debian):<br />
<br />
real 284m58.543s<br />
user 86m45.570s<br />
sys 20m46.500s<br />
<br />
Qemu (ARM, Linux, Debian):<br />
<br />
real 406m31.931s<br />
user 236m49.030s<br />
sys 148m58.110s<br />
<br />
Qemu (x86, Linux, Slackware):<br />
<br />
real 141m45.700s<br />
user 122m40.724s<br />
sys 17m15.670s<br />
<br />
Qemu (x86, Windows 2000):<br />
<br />
Elapsed 108m<br />
<br />
UML (x86, Linux, Slackware):<br />
<br />
real 238m41.257s<br />
user 45m54.460s<br />
sys 3m44.140s<br />
<br />
Compiling Lazarus 0.9.30 using time make LCL_PLATFORM=gtk2 bigide :<br />
<br />
Host (x86, Linux, Debian):<br />
<br />
real 2m21.072s<br />
user 2m6.452s<br />
sys 0m12.285s<br />
<br />
Slug (32Mb, ARM, Linux, Debian):<br />
<br />
real 9385m49.319s<br />
user 67m23.460s<br />
sys 430m9.870s<br />
<br />
Qemu (ARM, Linux, Debian):<br />
<br />
real 281m55.536s<br />
user 153m3.150s<br />
sys 53m27.470s<br />
<br />
Qemu (x86, Linux, Slackware):<br />
<br />
real 70m53.957s<br />
user 60m3.474s<br />
sys 8m8.801s<br />
<br />
Qemu (x86, Windows 2000, default platform):<br />
<br />
Elapsed 53m<br />
<br />
UML (x86, Linux, Slackware):<br />
<br />
real 489m40.233s<br />
user 81m43.740s<br />
sys 7m51.280s<br />
<br />
== Graphical Access using VNC etc. ==<br />
<br />
All of the above assumes that SSH is available so that shell (command line) sessions can be run over the network. Where necessary install e.g. the Debian ssh (or openssh, openssh-server etc.) package. It is also possible to run a program using a GUI over SSH by X forwarding, see the SSH client's -X option and the corresponding server configuration-file settings.<br />
<br />
There are several ways of running a program using a GUI without forwarding the X protocol over SSH:<br />
<br />
* Running Qemu or UML in an xterm.<br />
<br />
* Using Qemu's host VNC support.<br />
<br />
* Connecting to a Qemu (or UML etc.) guest using X.<br />
<br />
* Connecting to a Qemu (or UML etc.) guest using VNC.<br />
<br />
In all cases it is worth using a low-resource window manager such as FluxBox or xfwm rather than KDE or Gnome.<br />
<br />
=== Running Qemu or UML in an xterm or with host VNC support ===<br />
<br />
This depends on the build options of the guest system kernel etc. In general, display resolution and depth will be limited by the emulated hardware, the network ports are associated with the host (rather than guest) system. See the Qemu documentation for details.<br />
<br />
=== Connecting to a Qemu (or UML etc.) guest using X ===<br />
<br />
Install the Gnome Display Manager (gdm) on the guest system. This allows a desktop system to log into it using XDMCP, the desktop system determines the display resolution and depth.<br />
<br />
=== Connecting to a Qemu (or UML etc.) guest using VNC ===<br />
<br />
This method also works well for arbitrary systems, even if Qemu etc. is not being used.<br />
<br />
Install gdm and RealVNC (or, with limitations, TightVNC) on the guest system; the latter might be needed for ARM guests but RealVNC is to be preferred when available. This allows a desktop system to log into it using VNC, the guest system determines the display resolution and depth and network ports are associated with the guest (rather than host) system.<br />
<br />
In /etc/inittab, insert something like this:<br />
<br />
6:23:respawn:/sbin/getty 38400 tty6<br />
<br />
# Added in lieu of trying to get it working in inetd.conf. MarkMLl.<br />
<br />
8:23:respawn:/usr/local/vnc/vncshim-0-20<br />
# 9:23:respawn:/usr/local/vnc/vncshim-4-24<br />
<br />
# Example how to put a getty on a serial line (for a terminal)<br />
#<br />
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100<br />
<br />
Many systems limit the number of VNC servers that may be run per system (including localhost) as the side effect of a window manager XDMCP security precaution. If necessary, edit the window manager configuration file (gdm.conf, kdmrc etc.) to increase the number of sessions that each XDMCP client can request, e.g. in the case of gdm.conf:<br />
<br />
[xdmcp]<br />
Enable=true<br />
DisplaysPerHost=6<br />
<br />
Create /usr/local/vnc/vncshim-0-20 to read:<br />
<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
<br />
# This forms a shim between /etc/inittab and the VNC server, necessitated by<br />
# the facts that (a) I can't get this command working reliably in inetd.conf<br />
# and (b) lines in initab have restricted length.<br />
#<br />
# Note that the name of the file reflects the fact that it might request non-<br />
# standard combinations of VNC port and X display number. MarkMLl.<br />
<br />
# My preference is to select default linear dimensions that appear somewhere<br />
# in the list of conventional graphics modes. 1200x960 fits inside a 1280x1024<br />
# screen, even allowing that the title bar etc. will take additional space.<br />
<br />
SIZE=1200x960<br />
<br />
# The DPI setting can usefully be set to match the user's normal screen, leave<br />
# undefined (commented out) if in doubt.<br />
<br />
DPI='-dpi 96'<br />
<br />
# Each VNC server running on a host must have a distinct suffix to prevent port<br />
# and display number clashes.<br />
<br />
SUFFIX=0<br />
<br />
# Some option formats vary between RealVNC (top) and TightVNC (bottom).<br />
<br />
OPTIONS='DisconnectClients=0 -NeverShared'<br />
# OPTIONS='-dontdisconnect -nevershared'<br />
<br />
####################### CHANGE NOTHING BELOW HERE ###########################<br />
<br />
VNCPORT=570$SUFFIX<br />
XDISPLAY=:2$SUFFIX<br />
<br />
# Try to work out what this system is. Note particular care to allow spaces<br />
# in the desktop name.<br />
<br />
WHATAMI=`dirname $0`/whatami<br />
if [ -x $WHATAMI ]; then<br />
WHATAMI2=`$WHATAMI`<br />
else<br />
if [ -r $WHATAMI ]; then<br />
WHATAMI2=`cat $WHATAMI`<br />
else<br />
WHATAMI2=$$<br />
fi<br />
fi<br />
DESKTOP='-desktop '\'$WHATAMI2\'<br />
<br />
# Optional Java viewer.<br />
<br />
if [ -r `dirname $0`/classes/index.vnc ]; then<br />
JAVA="-httpd `dirname $0`/classes -httpPort 580$SUFFIX"<br />
fi<br />
<br />
# This is the only way I can get it working the way I want, i.e. with reliable<br />
# handling of spaces in the desktop name. I'm hardly proud of it.<br />
<br />
rm -f `dirname $0`/.vncshim-$SUFFIX-1$SUFFIX<br />
<br />
cat >`dirname $0`/.vncshim-$SUFFIX-1$SUFFIX <<EOT<br />
#!/bin/sh<br />
exec /usr/bin/Xvnc -geometry $SIZE $DPI -depth 16 $DESKTOP \<br />
-rfbport $VNCPORT -rfbauth /root/.vnc/passwd-$SUFFIX $JAVA \<br />
$OPTIONS -query localhost -once $XDISPLAY<br />
EOT<br />
<br />
chmod +x `dirname $0`/.vncshim-$SUFFIX-1$SUFFIX<br />
exec `dirname $0`/.vncshim-$SUFFIX-1$SUFFIX<br />
</syntaxhighlight><br />
<br />
Create /usr/local/vnc/whatami to read:<br />
<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
<br />
echo -n "`hostname`, "<br />
_WHATAMI=`uname -m`<br />
if [[ $_WHATAMI == i?86 ]]; then<br />
_WHATAMI='i586'<br />
fi<br />
if [[ $_WHATAMI == arm* ]]; then<br />
_WHATAMI='arm'<br />
fi<br />
<br />
if [ -x `dirname $0`/whatami-$_WHATAMI ]; then<br />
`dirname $0`/whatami-$_WHATAMI<br />
else<br />
uname -m<br />
fi<br />
</syntaxhighlight><br />
<br />
Additional scripts e.g. whatami-arm can query /proc/cpuinfo, which is different for each architecture. Make sure that all scripts are set +x for root.<br />
<br />
Use vncpasswd to set up password files /root/.vnc/passwd-0 etc.<br />
<br />
So far, I find that RealVNC works fine when invoked as above, but TightVNC doesn't correctly invoke the display manager.<br />
<br />
== Accessing "Unusual" Devices ==<br />
<br />
This section covers devices such as audio (i.e. used for playing .wav files) and MIDI, and USB devices which are not claimed by the host or guest kernel.<br />
<br />
=== Sound/MIDI for Qemu ===<br />
<br />
Don't expect this to be hi-fi quality, but it should be adequate for operator alerts etc.<br />
<br />
==== Identifying the Host's Hardware ====<br />
<br />
Obviously, a good starting point for this is using lspci and lsusb to determine what physical hardware is installed. The next stage is usually to consult dmesg output and to use lsmod to determine what subsystems the kernel has loaded hence what APIs are available. Graphical tools such as the KDE Info Centre can also be useful here, however identifying which API is most useful can be a bit of a black art.<br />
<br />
The current writer (MarkMLl) has a Debian "Squeeze" host with USB-connected audio and MIDI devices, with the latter connected to a Yamaha tone generator. An alternative (and more conventional) configuration would be to have an internal soundcard, with both audio and MIDI output feeding a loudspeaker.<br />
<br />
Knowing what hardware and subsystems are available, the remaining question is which subsystems Qemu can make use of. Running this command goes some way towards providing an answer:<br />
<br />
$ qemu -audio-help |grep ^Name:<br />
Name: alsa<br />
Name: oss<br />
Name: sdl<br />
Name: esd<br />
Name: pa<br />
Name: none<br />
Name: wav<br />
<br />
For reasons that are unclear ''(roughly translated: I'd like some help here)'' I've had most success with OSS, starting Qemu with a script that includes these lines:<br />
<br />
<syntaxhighlight lang="bash"><br />
export QEMU_AUDIO_DRV=oss<br />
export QEMU_OSS_DAC_DEV=/dev/dsp1<br />
export QEMU_OSS_ADC_DEV=/dev/dsp1<br />
</syntaxhighlight><br />
<br />
==== Selecting the Guest's Soundcard ====<br />
<br />
Assuming that the guest is to have both audio and MIDI, common sense would suggest that the guest operating system should see both audio and MIDI hardware implemented by Qemu. According to http://rubenerd.com/qemu-ad-lib-midi-win-31/, this implies that Qemu should be recompiled with the capability of emulating an Adlib card, which for current versions of Qemu means running something like this:<br />
<br />
<syntaxhighlight lang="bash"><br />
make clean distclean<br />
./configure --audio-card-list=ac97,es1370,sb16,adlib<br />
make<br />
</syntaxhighlight><br />
<br />
Irrespective of whether a custom Qemu is built or not, it's useful to check what devices it emulates:<br />
<br />
<syntaxhighlight lang="bash"><br />
$ qemu -soundhw ?<br />
Valid sound card names (comma separated):<br />
pcspk PC speaker<br />
sb16 Creative Sound Blaster 16<br />
ac97 Intel 82801AA AC97 Audio<br />
es1370 ENSONIQ AudioPCI ES1370<br />
</syntaxhighlight><br />
<br />
For some guest operating systems (e.g. Windows NT 4), adding Adlib emulation to Qemu is sufficient to get MIDI working with the Sound Blaster, i.e.<br />
<br />
<syntaxhighlight lang="bash">$ qemu ... -soundhw sb16,adlib ...</syntaxhighlight><br />
<br />
In this case the guest uses only the standard Sound Blaster driver, possibly ignoring MPU-401 support.<br />
<br />
For guest systems which don't benefit from this, there's little point adding something like an Adlib card if the guest operating system doesn't have a driver for it- which appears to be the case with Windows 2000. The current writer's preference is to select the ES13770, since as a straightforward PCI device it should be enumerated without difficulty by almost any guest operating system:<br />
<br />
<syntaxhighlight lang="bash">$ qemu ... -soundhw es1370 ...</syntaxhighlight><br />
<br />
Having started Qemu, it's possible to query the emulated devices:<br />
<br />
(qemu) info pci<br />
...<br />
Bus 0, device 4, function 0:<br />
Audio controller: PCI device 1274:5000<br />
IRQ 11.<br />
BAR0: I/O at 0xc200 [0xc2ff].<br />
id ""<br />
<br />
The expected result of this is that the guest operating system would see audio hardware, but not MIDI. However in the case of Windows 2000 a MIDI device is emulated, so programs which use MIDI for e.g. operator alerts will work properly.<br />
<br />
''Anybody: need help here generalising this to other guest operating systems.''<br />
<br />
=== USB for Qemu ===<br />
<br />
As an example, a Velleman K8055 board is plugged into the host. First use lsusb to gets its vid:pid identifiers:<br />
<br />
<syntaxhighlight lang="bash"><br />
$ lsusb<br />
Bus 001 Device 005: ID 10cf:5500 Velleman Components, Inc. 8055 Experiment Interface Board (address=0)<br />
</syntaxhighlight><br />
<br />
Now add these parameters to the Qemu command line:<br />
<br />
<syntaxhighlight lang="bash">qemu ... -usb -usbdevice host:10cf:5500 ...</syntaxhighlight><br />
<br />
On the guest, lsusb should show the device available for use.<br />
<br />
The Velleman board is unusual in that it has ID jumpers which set the last digit, i.e. multiple devices appear as 10cf:5500 through 10cf:5503. In cases where this facility is not available, the bus and device number can be used:<br />
<br />
<syntaxhighlight lang="bash">qemu ... -usb -usbdevice host:1.5 ...</syntaxhighlight><br />
<br />
Obviously, there's a risk here that devices will move around between invocations.<br />
<br />
=== USB for UML ===<br />
<br />
There was supposedly a patch that mapped unused USB devices on the host into the guest. I'm not sure it made it into the standard release.<br />
<br />
== QEMU User Emulation Mode in Chrooted Environment ==<br />
<br />
In previous chapters QEMU's full system emulation mode was described: a complete guest system is emulated including bios and hardware. Although this approaches a real environment as close as possible, the overhead created by emulating a complete system is considerable. QEMU's user emulation mode allows to run "guest" code directly on the "host" system. The cpu is still emulated but system calls are translated into system calls on the host system. Libraries used by the "guest" code are the "guest" libraries, not the host libraries. To run a small program created for fe. ARM with no dependencies you can simply do a <br />
$ qemu-arm program<br />
When the program has more and more dependencies, it becomes increasingly difficult to put all dependencies in locations that can be found by qemu-arm without messing up your host system. The solution that will be developed here is to create a chroot environment on the host in which all code is "guest" code. Advantage of this solution: <br />
*the chroot isolates the guest from the host <br />
*no need for vnc, ssh or any other solution to export screens. <br />
*no booting of a guest OS system.<br />
*guest "immersion" for user programs is almost complete. Only very low level and hardware related programming will notice the difference.<br />
*a spectacular speed improvement for graphics (X) related tasks (running lazarus f.e.) <br />
*hard disk resources are common to host and guest. Host can read and modify "guest" files but not the other way around.<br />
<br />
<u>Setting up the system.</u><br />
<br />
For a better comprehension of what follows, here is the directory structure used in this how-to:<br />
<br />
home<br />
qemu<br />
arm-linux-user<br />
sparc-linux-user<br />
scripts <br />
disks // here are qemu images for the different systems emulated<br />
chroot<br />
mount <br />
arm // here we'll chroot the arm environment<br />
sparc <br />
<br />
Get and build the latest qemu<br />
<br />
<syntaxhighlight lang="bash"><br />
$ cd <br />
$ git clone git://git.savannah.nongnu.org/qemu.git qemu<br />
$ cd qemu<br />
</syntaxhighlight><br />
<br />
Build all emulations (full system and user emulation mode, all processors) <br />
<syntaxhighlight lang="bash">$ ./configure --static to build </syntaxhighlight><br />
<br />
or only the user emulations needed <br />
<br />
<syntaxhighlight lang="bash">$ ./configure --static --target-list=sparc-linux-user,arm-linux-user<br />
<br />
$ make clean all<br />
</syntaxhighlight><br />
<br />
The --static option makes that qemu-arm and qemu-sparc are linked statically. Since they will be running in the chroot environment later on, they must be build without dependencies. Some distributions provide already statically linked binaries. fe qemu-arm-static on debian. Although they are not the latest and greatest, using these packages makes it somewhat easier. Building QEMU from source is really just a matter of minutes.<br />
<br />
Now we need to copy the complete guest system into chroot/arm or chroot/sparc. There are several ways of doing this but when you don't have a real arm or sparc system at hand, using a QEMU image of a full system emulation as described in previous chapters is the easiest.<br />
<br />
Mount the QEMU image.<br />
<br />
WARNING: do not mount a qemu image when the associated guest is running!<br />
<br />
Only raw QEMU images can be mounted as a loop-back device. If you have a qcow formatted image, convert it to a raw image.<br />
<br />
<syntaxhighlight lang="bash"><br />
$ qemu-img convert disks/armel_hda.img -O raw disks/armel_hda.raw<br />
<br />
$ cd chroot <br />
$ su<br />
# mount ../disks/armel_hda.raw mount -o loop,offset=32256<br />
</syntaxhighlight><br />
<br />
The offset is the start of the first partition on the ARM disk when the default disk layout was used during installation. If mount fails then the offset is probably wrong. To calculate the offset:<br />
<br />
<syntaxhighlight lang="bash"># fdisk -lu ../disks/armel_hda.raw</syntaxhighlight><br />
<br />
Find the first sector of the partition that will be mounted as root. Calculate offset as (start sector number * 512). For the default SPARC debian etch installation using a sun partition table with a /boot first partition the offset is 98703360.<br />
<br />
Check if the correct partition is mounted:<br />
<br />
<syntaxhighlight lang="bash"># ls mount</syntaxhighlight><br />
<br />
Copy the complete system<br />
<br />
<syntaxhighlight lang="bash"><br />
# cp -r mount/* arm/<br />
# umount mount<br />
</syntaxhighlight><br />
<br />
Copy the QEMU arm emulator to the arm directory<br />
<br />
<syntaxhighlight lang="bash"><br />
# cd arm<br />
# cp ../../arm-linux-user/qemu-arm usr/local/bin<br />
</syntaxhighlight><br />
<br />
Our "guest" system is complete. Since we are sharing our "host" devices and system, we need to mount a few special directories:<br />
<br />
<syntaxhighlight lang="bash"><br />
# mount --bind /proc proc<br />
# mount --bind /dev dev<br />
# mount --bind /sys sys<br />
# mount --bind /tmp tmp<br />
</syntaxhighlight><br />
<br />
Why /tmp? The /tmp directory is used by the X window system. When you don't mount tmp on the host /tmp, you will get "can't open display 0:0" errors when trying to open a window in the guest.<br />
<br />
We are going to use the host network:<br />
<br />
<syntaxhighlight lang="bash"># sudo cp /etc/resolv.conf etc</syntaxhighlight><br />
<br />
Remains one last thing: the emulator is copied into the guest but how do we tell the system that the emulator needs to kick in when a "quest" elf is detected? This is done with binfmt_misc. A configuration script is included with QEMU that registers the QEMU user mode emulators with binfmt_misc: (on my system I had to do a chmod +x on the script)<br />
<br />
<syntaxhighlight lang="bash"># ../../scripts/qemu-binfmt-conf.sh</syntaxhighlight><br />
<br />
When you look at this script at the end of the binary data you'll notice that the emulator is registered as /usr/local/bin/qemu-arm. And that is where we put it a few lines ago.<br />
<br />
Launch the system:<br />
<br />
<syntaxhighlight lang="bash"># chroot .</syntaxhighlight><br />
<br />
If all goes well:<br />
<br />
<syntaxhighlight lang="bash"><br />
# uname -m<br />
armv7l<br />
</syntaxhighlight><br />
<br />
Everything you do from here is in your "guest" system. <br />
To exit the "guest" system.<br />
<br />
<syntaxhighlight lang="bash"># exit</syntaxhighlight><br />
<br />
And unmount the special directories.<br />
<br />
<syntaxhighlight lang="bash"><br />
# umount proc<br />
# umount dev<br />
# umount sys<br />
# umount tmp<br />
</syntaxhighlight><br />
<br />
<u>Conclusion.</u><br />
<br />
The ARM emulation works very well, except for gdb. On the contrary there are still quite some problems with the SPARC emulation. There is a bug in duplicating pipes which makes the use of bash impossible. The sh shell works but several unix commands don't function correctly. What works fine is fpc and lazarus! Programs can't be launched from inside lazarus. Because of the improved graphics speed when using the user emulation mode it is still worthwhile for using lazarus. Instead of starting a shell in chroot, you start directly lazarus:<br />
<br />
<syntaxhighlight lang="bash">$ sudo chroot . /your/lazarus/dir/lazarus</syntaxhighlight><br />
<br />
To run the program compiled in lazarus, you can launch it from another "host" terminal:<br />
<br />
<syntaxhighlight lang="bash"><br />
$ cd qemu/chroot/arm<br />
$ sudo chroot . /your/program/dir/project<br />
</syntaxhighlight><br />
<br />
Here also gdb is not working.<br />
<br />
== Docker images ==<br />
<br />
Docker uses various APIs provided by the underlying operating system to isolate programs in separate namespaces.<br />
<br />
The implication of this is that every Docker container has its own process space (i.e. processes in different containers might have the same numeric PID), network space (processes in different containers can have different routing, firewall rules and so on), filesystems (except that they share kernel files and a number of crucial libraries and configuration files) and so on.<br />
<br />
Containerisation is distinct from virtualisation in that all containers which are running on the same host computer make use of the same host kernel, it is not possible for one container to use a different kernel (e.g. for development or deployment test purposes), and there is no absolute guarantee that a container taken over by malicious code cannot subvert the remainder of the system.<br />
<br />
'''''Note that there are pitfalls for the unwary. For example, having Docker installed and the Docker daemon running can break Qemu networking if this expects to have bridged access to the host interface rather than to be sitting on its own private subnet.'''''<br />
<br />
One thing that does work however, is running a 32-bit container on a 64-bit host, and in most cases the Linux kernel APIs are sufficiently backwards-compatible that the programs and libraries from an older release of a distro can run on a much more recent host. One of the cases which will be discussed here runs a container containing 32-bit Debian "Lenny" from 2008 on a host running Debian "Buster" from 2019, this combination allows e.g. compatibility with the GTK v1 widget set (no longer supported by more recent distreaux) to be tested.<br />
<br />
=== Docker fundamentals ===<br />
<br />
This is not the place for a full discussion of the care and feeding of Docker, but it's worth establishing a few basic concepts.<br />
<br />
* Host: the physical computer running e.g. Qemu (with or without KVM) or Docker.<br />
<br />
* Guest: on a virtualised system (Qemu etc.), a completely separate memory space with its own kernel.<br />
<br />
* Container: on a Docker based system, a group of application programs sharing the host kernel but largely isolated from the rest of the host system using various namespace mechanisms.<br />
<br />
Looking specifically at Docker:<br />
<br />
* Dockerfile: a succinct description of what is to go into a Docker image.<br />
<br />
* Image: the Docker analogue of a bootable filesystem, initially built with reference to a Dockerfile.<br />
<br />
* Container: an image which has been run, whether or not it is currently running.<br />
<br />
Once running, a container has an associated parameter list which specifies the main program together with any sockets etc. exposed to the host. Neither an image nor a container correspond to a single file on the host, but:<br />
<br />
* A container may be stopped and committed to an image.<br />
<br />
* An image may be saved to a single file, in which state it can be moved between hosts.<br />
<br />
* An image may be run a set of parameters different from those of the container committed to it.<br />
<br />
The result of this is that if something is installed in the context of a container (e.g. Apache is added from the operating system's main repository) the container should be stopped, committed to a new image and then run with an additional parameter specifying what sockets etc. should be exposed. There are ways around that, but that combination appears to be the easiest to manage.<br />
<br />
The Docker community has a master repository, and the docker program on a host computer may search it to locate images. However in the context of those images there appears to be no "official" way of searching the tags that allow a specific version to be pulled, hence something "messy" and subject to change like<br />
<br />
<pre><br />
$ docker search debian<br />
<br />
$ wget -q https://registry.hub.docker.com/v1/repositories/debian/tags -O - \<br />
| sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}' | grep buster<br />
<br />
$ docker pull debian:buster<br />
</pre><br />
<br />
or alternatively (for the really hard to reach bits)<br />
<br />
<pre><br />
$ docker search vicamo<br />
<br />
$ wget -q https://registry.hub.docker.com/v1/repositories/vicamo/debian/tags -O - \<br />
| sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}'<br />
<br />
...<br />
buster-i386<br />
buster-i386-sbuild<br />
buster-i386-slim<br />
...<br />
<br />
$ docker pull vicamo/debian:buster-i386-slim<br />
</pre><br />
<br />
Generally speaking, if a developer on e.g. Github says that he has a special-purpose image, some combination of the above commands will allow the required version (e.g. in the above example tagged buster-i386-slim) to be pulled.<br />
<br />
Neither a container nor an image is directly mountable e.g. by using losetup. It is possible to copy files to or from a container using the <code>docker container cp</code> command, subject to the same precautions that one would take on a running unix system.<br />
<br />
=== A 64-bit Docker container with basic utilities ===<br />
<br />
This is a basic installation of a 64-bit Debian stable release ("Buster" at the time of writing) on the same host version. This is useful in a situation where a developer wants to experiment with libraries etc. that he does not normally have installed, it should probably not be trusted to quarantine untrusted code.<br />
<br />
In the instructions below, commands on the host are run in the context of a normal user so are shown prefixed by a $ prompt, while commands run in the context of the container are run by root so shown prefixed by a # prompt.<br />
<br />
<pre><br />
$ docker pull debian:buster<br />
<br />
$ docker run --interactive --tty debian:buster<br />
<br />
# apt-get update<br />
<br />
# apt-get install dialog tasksel python3<br />
<br />
# tasksel --new-install<br />
<br />
# dpkg-reconfigure locales<br />
</pre><br />
<br />
Using tasksel, remove desktop and print server and add SSH. The author favours installing net-tools so that the <code>netstat -an</code> command can be used to check socket accessibility.<br />
<br />
<pre><br />
# apt-get install net-tools elvis-tiny<br />
</pre><br />
<br />
So far there is no provision for starting the SSH daemon. Add or edit /etc/rc.local to contain<br />
<br />
<pre><br />
#!/bin/sh<br />
<br />
rm -rf /tmp/*<br />
<br />
# For cases where a 32-bit container is running (by implication on a 64-bit host), make<br />
# sure that commands such as uname -a return consistent information to avoid breaking <br />
# the traditional ./configure && make operation.<br />
<br />
(file -L /bin/sh | grep -q 'ELF 32-bit LSB')<br />
if [ $? -eq 0 ] ; then<br />
LINUX32=linux32<br />
fi<br />
<br />
cd /etc/init.d<br />
$LINUX32 ./ssh start<br />
# $LINUX32 ./openbsd-inetd start<br />
<br />
cd<br />
exec $LINUX32 /bin/bash<br />
</pre><br />
<br />
The ID of the current container is in the prompt. Exit it and commit to a new image, then start with a parameter to expose the SSH socket:<br />
<br />
<pre><br />
# exit<br />
<br />
$ docker container commit 4efab4804fb6 debian_minimal<br />
<br />
$ docker run -it -p 65022:22 \<br />
--entrypoint=/etc/rc.local debian_minimal<br />
<br />
# groupadd -g 1000 markMLl<br />
<br />
# useradd -g markMLl -u 1000 -m -d /home/markMLl markMLl<br />
<br />
# passwd markMLl<br />
</pre><br />
<br />
Add newly created user name to sudo group (/etc/group and /etc/gshadow files). Note the container ID, if it is now stopped the parameters are preserved and it should be possible to start it in the background and connect as the above user via SSH.<br />
<br />
<pre><br />
$ docker container stop c5be7fd96866<br />
<br />
$ docker container start c5be7fd96866<br />
<br />
$ ssh localhost -p 65022<br />
</pre><br />
<br />
The above is a good starting point for a general-purpose containerised system. The section below will also show how to get a graphical program (e.g. the Lazarus IDE) running in a container.<br />
<br />
=== A 32-bit Docker container with FPC and Lazarus ===<br />
<br />
An understanding of the principles and commands described above is a prerequisite to continuing with this section.<br />
<br />
Unlike Qemu, a container will run at the host computer's full speed. Unlike User Mode Linux (UML), a 32-bit container will run on a 64-bit host. Subject to security issues, this makes Docker the preferred choice when setting up a temporary 32-bit environment to e.g. investigate libraries which would not normally be installed on the host.<br />
<br />
This section discusses installing a 32-bit Debian "Lenny" container, which allows a program to be checked with libraries etc. dating from roughly 2008.<br />
<br />
Referring to https://github.com/lpenz/docker-debian-releases/<br />
<br />
<pre><br />
$ docker pull lpenz/debian-lenny-i386<br />
<br />
$ docker image ls<br />
<br />
$ docker run --interactive --tty lpenz/debian-lenny-i386<br />
</pre><br />
<br />
Lenny authentication is broken and is not going to be fixed (short of forking the entire repository). In /etc/apt/apt.conf put<br />
<br />
<pre><br />
APT <br />
{<br />
// Options for apt-get<br />
Get <br />
{<br />
AllowUnauthenticated "true";<br />
}<br />
}<br />
</pre><br />
<br />
which should allow tasksel etc. to work. Add contrib and non-free to /etc/apt/sources.list, then<br />
<br />
<pre><br />
# apt-get update<br />
<br />
# apt-get upgrade<br />
<br />
# tasksel --new-install<br />
<br />
# dpkg-reconfigure locales<br />
<br />
# apt-get install openssh-server sudo<br />
</pre><br />
<br />
Populate /etc/rc.local as discussed above, comment out the temporary setting from /etc/apt/apt.conf<br />
<br />
Create group and user as discussed above, add user to sudo group.<br />
<br />
Add the build-essential, gdb, subversion and zip packages as basic prequisites. Add libncurses5-dev, libncursesw5-dev and libgpm-dev to allow FPC to be rebuilt, plus possibly libpango1.0-dev for the FP IDE. Install FPC v2.2.4 binary for i386 and corresponding sources, the compiler should run and be able to recompile itself.<br />
<br />
Install the libgtk1.2-dev package then Lazarus 0.9.24.1, don't attempt to run it yet. In the per-user shell startup file e.g. ~/.bashrc put the line<br />
<br />
export DISPLAY=:0<br />
<br />
then exit and commit the container as described above and restart with something like<br />
<br />
$ docker run -it -p 65022:22 -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix \<br />
--entrypoint=/etc/rc.local lenny_with_lazarus<br />
<br />
Again, details as discussed in the section above.<br />
<br />
It should now be possible to login to the container from the host over SSH, invoke e.g. /usr/local/share/lazarus/lazarus by name, and have the IDE appear on the host computer's screen.<br />
<br />
== Further Reading ==<br />
<br />
* [http://www.aurel32.net/info/debian_arm_qemu.php Debian on an emulated ARM machine]<br />
* [https://forum.lazarus.freepascal.org/index.php/topic,56098.msg420159.html#msg420159 Debian 11 on an emulated ARM/ARM11 machine]<br />
* [http://www.aurel32.net/info/debian_mips_qemu.php Debian on an emulated MIPS(EL) machine]<br />
* [http://en.wikibooks.org/wiki/QEMU/Windows_XP QEMU/Windows XP on Wikibooks]<br />
* [http://user-mode-linux.sourceforge.net/ The User-mode Linux Kernel Home Page]<br />
* [http://www.josefsipek.net/docs/s390-linux/hercules-s390.html Installing Debian under Hercules]<br />
<br />
==See also==<br />
<br />
* [[Native ARM Systems]] <br />
* [[Native MIPS Systems]]<br />
* [[Small Virtual Machines]]<br />
* [[Docker Containerization]]<br />
<br />
[[Category: Emulators]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=Game_Engine&diff=146119Game Engine2021-08-02T12:58:58Z<p>Seenkao: </p>
<hr />
<div>{{Game_Engine}}<br />
{{Menu_Game_Development}}<br />
<br />
A '''game engine''' is a software development environment designed to create [[Games|games]]. It distinguish from [[Game framework|game libraries]] in that:<br />
* Implements the ''game loop'', resource managers and other complex subsystems as networking communications, user interfaces and configuration systems.<br />
* Implements complex data structures, such as maps, particle systems and actors.<br />
* Implements tools as editors and data managers.<br />
All these subsystems would affect in gameplay aspects as movement, scoring or even genre. You can read this [http://en.wikipedia.org/wiki/Game_engine Wikipedia page] for more information.<br />
<br />
== Game Engines ==<br />
Here's a list of game engines that are Pascal/Delphi based or have Pascal binding libraries.<br />
<br />
{| class="wikitable sortable" width="100%"<br />
! Name <br />
! Site <br />
! Usage<br />
! Notes<br />
|-<br />
| [[Castle Game Engine]] <br />
| [https://castle-engine.io/ castle-engine.io] <br />
| FPC<br />
| 2D & 3D, all platforms supported<br />
|-<br />
| Quad-Engine<br />
| [http://quad-engine.com/ quad-engine.com] <br />
| Delphi/FPC/C#/C++<br />
| v0.9.0 (Diamond) 2018-01-15<br />
|-<br />
| TERRA Game Engine <br />
| [https://github.com/Relfos/TERRA-Engine github.com/Relfos/TERRA-Engine]<br />
| Delphi/FPC/Oxygene<br />
| 2D & 3D, all platforms supported<br />
|-<br />
| [http://www.tilengine.org Tilengine]<br />
| [https://github.com/turric4n/PascalTileEngine GitHub]<br />
| FPC/Delphi OOP Pascal Wrapper and bindings<br />
| Cross-platform 2D graphics engine for creating classic/retro games with tilemaps, sprites and palettes. Last update May 2020.<br />
|-<br />
| [[nxPascal]]<br />
| [https://github.com/Zaflis/nxpascal github.com]<br />
| FPC/Delphi<br />
| For now only OpenGL is supported. No android or other mobile support yet.<br />
|-<br />
| g2mp<br />
| [https://github.com/MrDan2345/g2mp github.com]<br />
| FPC<br />
| Ideologically replaced Dan Jet X, multiplatform, editor- and code-based development <br />
|-<br />
| Andorra 2D<br />
| [http://andorra.sourceforge.net/ sourceforge.net]<br />
| Delphi<br />
| Last update 2008<br />
|-<br />
| CAST II Game Engine<br />
| [http://www.casteng.com/ http://www.casteng.com/]<br />
| Delphi<br />
| Alive? last update 2011<br />
|-<br />
| Delphi X <br />
| [http://www.micrel.cz/Dx/ www.micrel.cz/Dx]<br />
| Delphi<br />
|<br />
|-<br />
| Afterwarp<br />
| [http://www.afterwarp.net/ www.afterwarp.net]<br />
| FPC/Delphi<br />
| <br />
|-<br />
| Brtech1<br />
| [http://www.pascalgamedevelopment.com/showthread.php?13795-Brtech1 PascalGameDevelopment.com]<br />
| FPC<br />
| Not really available as an engine or library. Many videos can be found on youtube though. <br />
|-<br />
| GameMaker: Studio<br />
| [http://www.yoyogames.com/ www.yoyogames.com] <br />
| N/A <br />
| Yes, it's not really a game engine library. But it's a game engine and studio written in Delphi. Special Pascal proud. <br />
|-<br />
| MinGRo<br />
| [https://www.sf.net/p/mingro SourceForge]<br />
| FPC<br />
| Designed for old-school style games. Still work in progress. Build with [[FPC_and_Allegro|Allegro.pas]].<br />
|-<br />
| ZGameEditor<br />
| [http://www.zgameeditor.org/ www.zgameeditor.org] <br />
| FPC/Delphi<br />
| use OpenGL for graphics and a real time synthesizer for audio<br />
|-<br />
| SO Engine<br />
| [https://github.com/dimsa/ShadowEngine github.com] <br />
| Delphi/FMX<br />
| Small Crossplatform (Win, Android, iOs) indy engine with formatters, animations, intersections and etc.<br />
|-<br />
| DGLE<br />
| [https://github.com/DGLE-HQ/DGLE github.com] <br />
| Delphi/FPC/C#/C++<br />
| Powerful free open source cross-platform game engine.<br />
|-<br />
| raylib<br />
| [https://github.com/tazdij/raylib-pas raylib pascal binding] <br />
| FPC<br />
| A simple and easy-to-use raylib library<br />
|-<br />
| PGF<br />
| [https://github.com/GuvaCode/PGF The Phoenix Game Framework] <br />
| FPC/Lazarus<br />
| The Phoenix Game Framework is a set of classes for helping in the creation of 2D and 3D games in pascal.<br />
|-<br />
| ZenGL<br />
| [http://www.zengl.org ZenGL] [https://github.com/goldsmile/zengl GitHub mirror] [https://github.com/Seenkao/New-ZenGL A new version]<br />
| FPC/Lazarus/Delphi<br />
| Cross-platform game development library written in Pascal.<br />
|-<br />
| Apus Game Engine<br />
| [https://github.com/Cooler2/ApusGameEngine github.com]<br />
| FPC/Delphi<br />
| 2D (with some 3D effects) engine<br />
|-<br />
| Ray4Laz<br />
| [https://github.com/GuvaCode/Ray4Laz Ray4Laz]<br />
| FPC/Lazarus<br />
| is a simple and easy-to-use library to enjoy videogames programming<br />
|}<br />
<br />
==Physics Engines==<br />
These engines simulate the physical world (collisions, trajectories etc). Not really game engines per se, but could certainly be used in games.<br />
{| class="wikitable sortable" width="100%"<br />
! Name <br />
! Site <br />
! Usage<br />
! Notes<br />
|-<br />
| TundAx<br />
| [https://github.com/JordiCorbilla/thundax-delphi-physics-engine github.com]<br />
| FPC/Delphi<br />
| <br />
|-<br />
| Newton<br />
| [http://www.saschawillems.de/ www.saschawillems.de]<br />
| [http://www.saschawillems.de/?page_id=76 Bindings]<br />
| <br />
|-<br />
| Box2D-Delphi<br />
| [https://code.google.com/p/box2d-delphi/ code.google.com] <br />
| FPC/Delphi<br />
| This is Delphi implementation of [http://code.google.com/p/box2d/ Box2d] library<br />
|-<br />
| Kraft<br />
| [https://github.com/BeRo1985/kraft github.com]<br />
| FPC/Delphi<br />
| Pascal native physics engine by Benjamin Rosseaux. <br />
|}</div>Seenkaohttps://wiki.freepascal.org/index.php?title=Projects_using_Lazarus_-_Games&diff=145357Projects using Lazarus - Games2021-06-16T20:55:52Z<p>Seenkao: </p>
<hr />
<div>{{Sidebar-LazProjects}}<br />
<br />
== 15-puzzle ==<br />
<br />
[[15-puzzle]] is a sliding puzzle that consists of a frame of numbered square tiles in random order with one tile missing. The object of the puzzle is to place the tiles in order by making sliding moves that use the empty space. <br />
<br />
[[image:puzzle15.png]]<br />
<br />
== 2048 ==<br />
<br />
[https://app.zdechov.net/2048 2048] is a Lazarus implementation of famous block sliding puzzle [https://en.wikipedia.org/wiki/2048_(video_game) video game].<br />
<br />
[[Image:2048.png|200px]]<br />
<br />
== BigMetro ==<br />
<br />
[http://app.zdechov.net/BigMetro BigMetro] is metro building game inspired by [https://en.wikipedia.org/wiki/Mini_Metro_(video_game) MiniMetro] game. Runs on Windows, Linux and macOS (need to compile yourself for macOS).<br />
<br />
[[File:BitMetro_small.png|border|200px]]<br />
[[File:BigMetro_main.png|border|270px]]<br />
<br />
== Bomber Kat ==<br />
<br />
Commercial game developed with FPC for iOS (both arm and arm64 platforms are supported). [[ZenGL]] based. Lazarus has been used as a primary IDE. Link: [https://itunes.apple.com/app/bomber-kat/id1109783786?ls=1&mt=8 App Store]<br />
<br />
== C-evo ==<br />
<br />
[https://app.zdechov.net/c-evo C-evo] is a turn-based empire building game inspired by Civilization II game. It was [http://c-evo.org/ originally] developed using Delphi 4 but later fully porter to Lazarus.<br />
<br />
[[File:C-evo start.png|border|270px]]<br />
[[File:C-evo game.png|border|270px]]<br />
[[File:C-evo game2.jpg|border|270px]]<br />
<br />
== Castle Game Engine ==<br />
<br />
[[Castle Game Engine]] ([http://castle-engine.sourceforge.net/ project page]) is a 3D open-source game engine. The engine was developed from the beginning using Free Pascal (we have also Lazarus components) in nice and clean ObjectPascal code. We support many 3D model formats, including [http://castle-engine.sourceforge.net/vrml_x3d.php VRML/X3D], Collada, 3DS and many others. Tools and games using the engine include: <br />
* [http://castle-engine.sourceforge.net/view3dscene.php view3dscene - 3D model viewer, VRML/X3D browser], <br />
* [http://castle-engine.sourceforge.net/castle.php The Castle - FPS game in a dark fantasy world], <br />
* [http://castle-engine.sourceforge.net/darkest_before_dawn.php Darkest Before the Dawn - small scary 3D game for standalone and Android (also on Google Play)]<br />
<br />
== Common Loon Hearts ==<br />
<br />
[https://web.ncf.ca/di874/computers/hearts/hearts.html Common Loon Hearts] is the card game Hearts. It is written in Free Pascal with the Lazarus IDE for Windows and Linux. Source code is available [https://github.com/oldgizahub/hearts here].<br />
<br />
[[Image:hearts_screen.png|320px]]<br />
<br />
== DMines ==<br />
<br />
[http://dmines.sourceforge.net/ DMines] is an edition of the classic game Minesweeper with a dynamic twist, unrevealed mines can change location every set number of seconds.<br />
<br />
[[Image: DMinesExample.jpg|400px]]<br />
<br />
== Dreams of a Geisha ==<br />
<br />
Take a journey through the magical and wonderful world of Geisha. Help Ichisumi in this incredible adventure to reopen the temples of Geisha and restore a world of beauty and passion. Dive into this engaging Match 3 game with beautiful scenery and relaxing music. Overcome obstacles, collect puzzle pieces, and be prepared to solve challenging puzzles in [http://www.dreamsofageisha.com Dreams of a Geisha]!<br />
<br />
Powered by Lazarus FPC, [http://www.zengl.org/ ZenGL], [http://www.phoenixlib.net/ PhoenixLib], [http://www.lua.org/ LUA] and [http://www.codeandweb.com/texturepacker TexturePacker]. Developed by [http://www.greensaucegames.com Green Sauce Games] and Released by [http://www.bigfishgames.com Big Fish Games].<br />
<br />
Demo available for [http://www.bigfishgames.com/download-games/12814/dreams-of-a-geisha/index.html Windows], [http://www.bigfishgames.com/download-games/13045/mac/dreams-of-a-geisha/index.html Mac], [http://itunes.apple.com/us/app/dreams-of-a-geisha/id460180656?mt=8 iPhone], [http://itunes.apple.com/us/app/dreams-of-a-geisha-hd/id459801505?mt=8 iPad].<br />
<br />
[[File:Dreams of a Geisha - Screenshot 1.jpg|border|270px]]<br />
<br />
== Eschecs ==<br />
<br />
[https://github.com/rchastain/eschecs Eschecs] is an application to play chess against different artificial opponents. ''Eschecs'' uses the [[fpGUI]] Toolkit, and the [[uos]] and [[BGRABitmap]] libraries.<br />
<br />
[[Image:eschecs500f.png|300x300px]] <br />
<br />
== fpChess ==<br />
<br />
[[fpChess]] is still under construction. It should support playing via the internet as well as against a computer AI. <br />
<br />
[[Image:Fpchess.png|240px]]<br />
<br />
== Game Maker ==<br />
<br />
[http://www.yoyogames.com/gamemaker Game Maker] allows you to make computer games using easy to learn drag-and-drop actions. You can create professional looking games within very little time. You can make games with backgrounds, animated graphics, music and sound effects, and even 3D games! And when you've become more experienced, there is a built-in programming language, which gives you the full flexibility of creating games with Game Maker. What is best, is the fact that Game Maker can be used free of charge.<br />
<br />
Originally written in Delphi, Lazarus/Free Pascal was used to port it from Win32 to macOS. Available for Windows desktop, macOS, Ubuntu, Android, iOS, tvOS, fireTV, Android TV, Microsoft UWP, HTML5, PlayStation 4, and Xbox One.<br />
<br />
== Hedge Wars ==<br />
<br />
[http://www.hedgewars.org/ Hedge Wars] is a worm-like game with very nice graphics and good AI. The game features typical worms gameplay including net play. The game itself is written in FPC while the config application is C++/Qt.<br />
<br />
[[Image: HedgeWarsPage.png|320px| HedgeWars Scene]]<br />
<br />
== JavaneseChess ==<br />
<br />
[https://bitbucket.org/leledumbo/javanese-chess JavaneseChess] is a Javanese chess game implementation. Available for Desktop platforms and Android (not feature complete yet).<br />
<br />
== Juegos Iniciales ==<br />
<br />
[http://juegosenlazaruscostarricenses.com Juegos Iniciales] are a small collection of 3D tutorial games in<br />
Lazarus, SDL and Free Pascal. In 2016, there were only four games:<br />
[http://origamisiniciales.juegosenlazaruscostarricenses.com Origamis Iniciales], <br />
[http://bloquesiniciales.juegosenlazaruscostarricenses.com Bloques Iniciales], <br />
[http://nudosiniciales.juegosenlazaruscostarricenses.com Nudos Iniciales],<br />
[http://palitos-iniciales.juegosenlazaruscostarricenses.com Palitos Iniciales].<br />
<br />
== LazGobang ==<br />
<br />
[http://files.cnblogs.com/lazarus/LazGobang.rar LazGobang] is a Gobang game, powered by Lazarus and Free Pascal. <br />
<br />
== Lazarus Mazes ==<br />
<br />
The [https://github.com/eny-fpc/lazes Lazarus Mazes] program is a demonstration of how you can use Lazarus to create a maze. The maze generation is based on a [http://en.wikipedia.org/wiki/Maze_generation_algorithm#Depth-first_search depth-first backtracking] algorithm. As a bonus, a simple maze solver is also implemented that shows a route from the start of the maze to the exit.<br />
<br />
[[Image:mazedemo1.png|400px]]<br />
<br />
== LBP Level Logger ==<br />
<br />
[http://code.google.com/p/lbplevellogger/ LBP Level Logger] is a small system tray application designed to log [http://www.littlebigplanet.com/ LittleBigPlanet] level statistics from [http://lbp.me/ lbp.me] over time for graphing/visualisation. It is written in Free Pascal/Lazarus.<br />
<br />
[[File:lbplevellogger-screenshot.png]]<br />
<br />
== Lentil Wars ==<br />
<br />
[http://lwars.sourceforge.net/ Lentil Wars] is an arcade action game for Linux and Windows that is still under development. Players combat each other in multiple nicely designed levels. Lentil Wars can be played both on a single computer as well as over a network.<br />
<br />
[[Image:LentilWars.jpg|320px| Lentil Wars Scene]]<br />
<br />
== Mundo Medieval 3D MMORPG ==<br />
<br />
Featuring a virtual world of more than 1.000.000 m2, plus caves and hell sceneries, 17 NPCs, 21 kinds of monsters, including 7 bosses, 58 different items and 100 quests, this is a really large game made with Free Pascal/Lazarus. The project is 100% free software, both code and media are licensed under GPL. The project sites are [http://www.gamemundo.com/ http://www.gamemundo.com/] and [http://sourceforge.net/projects/gamemundo/ http://sourceforge.net/projects/gamemundo/].<br />
<br />
[[File:Mundo - Screenshot 1.png|border|270px]]<br />
[[File:Mundo - Screenshot 2.png|border|270px]]<br />
[[File:Mundo - Screenshot 3.png|border|270px]]<br />
<br />
== Peg Solitaire tutorial ==<br />
<br />
[[Peg Solitaire tutorial|Peg Solitaire]] serves as a game (Peg Solitaire) tutorial that aims at introducing the user to the basics of Lazarus application development. Source available.<br />
<br />
[[Image:tutpeg_solitaire.png|340px]]<br />
<br />
== Petris ==<br />
<br />
[[Petris]] is yet another Tetris clone. [https://github.com/eny-fpc/petris Source available].<br />
<br />
[[Image:petris.png|320px]]<br />
<br />
== Retro Ski Run ==<br />
<br />
[https://sourceforge.net/projects/retroskirun/ Retro Ski Run] is a simple ski game for Windows 32/64bit and Linux 32/64-bit.<br />
<br />
[[Image:ss_rsrStartScreen.jpg|border|270px]]<br />
<br />
== Robot - The Game ==<br />
<br />
[[Robot - The Game|Robot]] is a game in which you control a character through a world consisting of 5*5 rooms, each with 20*20 fields. Every field contains a special game object; this can be a wall, a bad robot who wants to kill you (because of the robots, the game is named Robot), a door (for each door, you need a special key) and so on. [https://sourceforge.net/projects/lazarus-ccr/files/Demos and examples/Robot 1.7/ Source available].<br />
<br />
[[Image:robot1.5-shot1.png|320px]]<br />
<br />
== Snake for ptcGraph ==<br />
<br />
[https://gitlab.com/rchastain/snake-ptcgraph Snake for ptcGraph] is a simple snake game based on the ptcGraph unit. Steer the snake with keyboard arrows and eat as many fruits as you can.<br />
<br />
[[Image:snake2.png|320px]]<br />
<br />
== UltraStar Deluxe ==<br />
<br />
[http://ultrastardx.sourceforge.net/ UltraStar Deluxe] is a free and open source karaoke game inspired by the Singstar™ game available on the Playstation®. It allows up to six players to sing along with music using microphones in order to score points, depending on the pitch of the voice and the rhythm of the singing. It is currently available for Windows, Linux, macOS and FreeBSD.<br />
<br />
[[Image:UltraStarDeluxeMainPage.png|400px|UltraStar Deluxe Main Page]] <br />
<br />
== ValisoaChess ==<br />
<br />
[https://sourceforge.net/projects/valisoachess/?source=directory ValisoaChess] is a chess game written in Free Pascal and Lazarus. The main goal is to create a simple yet powerful chess engine.<br />
<br />
[[Image:valisoachess.jpg|320px]]<br />
<br />
== Zen GL updated ==<br />
<br />
[https://sourceforge.net/p/zengllinux/code/ci/default/tree/ Zen GL] is a 2D game engine. Now Zen GL uses Steam Game Libraries. You can migrate your Delphi X or Image Sprite old 2D Delphi games with that Zen GL upgraded Game Engine. The Zen GL Linux packages are zgl.deb or zgl.rpm.<br />
<br />
And also an updated version of [https://github.com/Seenkao/New-ZenGL ZenGL] with support for Android and MacOS Cocoa. In Russian. Support for English is evolving. Inside there is a link to the iOS version but the new features are not included.<br />
<br />
[[Category:Lazarus]]<br />
[[Category:Historical]]<br />
[[Category:Promotion]]<br />
[[Category:Software created with Lazarus]]<br />
[[Category:Software written in Free Pascal]]<br />
[[Category:Games]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=KOL-CE/zh_TW&diff=144764KOL-CE/zh TW2021-04-29T16:36:52Z<p>Seenkao: </p>
<hr />
<div>{{KOL-CE}}<br />
==介紹==<br />
KOL-CE是由[http://f0460945.xsph.ru/rindex.htm Vladimir Kladov] 開發的元件,在其他平台上為KOL跟MCK兩組套件,現在則是將之移植到Free Pascal跟Lazarus上使用,關於它的授權,請參見: [http://www.opensource.org/licenses/wxwindows.php wxWindow函式庫授權].<br />
<br />
KOL-CE可以建立非常精簡的Win32/WinCE圖形介面程式(如果專案只包含一個空的視窗的話,建置出來的程式碼大約只占40KB而已)。<br />
<br />
MCK則是讓KOL-CE專案使用的一組Lazarus套件,KOL-CE的圖形介面就是靠MCK來達成的。<br />
<br />
原本KOL-CE只是計劃把KOL移植給[[WinCE port|WinCE]]使用而已,但後來開發的時候決定要把Win32的許多功能保留下來,並讓FPC開發WinCE應用程式能夠更順利。原本KOL是為Delphi設計的,當時在FPC上面運作並不順,而原始的MCK則是完全不能在Lazarus上面使用的。<br />
<br />
=== 基本需求 ===<br />
* Win32平台上的Free Pascal編譯器2.2.0版或更新的版本。<br />
* Win32平台上的arm-wince交叉編譯器2.2.0或更新的版本(開發[[WinCE port|WinCE]]程式時會用到).<br />
* Win32平台上的Lazarus 0.9.23版或更新的版本。<br />
<br />
=== 能支援的平台 ===<br />
* 所有32位元的Windows作業系統,從Windows 95到Vista都行。<br />
* 使用[[WinCE port|Windows CE]]為作業系統的PocketPC跟手機。<br />
<br />
== 下載 ==<br />
請從[http://sourceforge.net/project/showfiles.php?group_id=188451 這裡]下載最新版的KOL-CE<br />
<br />
您也可以從SVN下載最新出爐的KOL-CE原始碼,連結如下: https://kol-ce.svn.sourceforge.net/svnroot/kol-ce/trunk<br />
<br />
== 安裝 ==<br />
----<br />
如果您正在使用Lazarus 0.25版或更新的版本,則您就需要先加入<tt>'''DisableFakeMethods'''</tt>這個設定,重新編譯Lazarus,接著才能安裝MCK套件。 <br />
<br />
步驟如下:<br />
# 執行Lazarus.<br />
# 點選選單項目: '''Tools > Configure "Build Lazarus"...'''<br />
# 在'''Quick Build Options'''分頁上,點選'''Clean Up + Build all'''項目。<br />
# 開啟'''Advanced Build Options'''分頁,並在'''Options'''這個對話框裡面加入<tt>'''-dDisableFakeMethods'''</tt>這個設定字串。<br />
# 點選'''Build'''按鍵以重新建置Lazarus。<br />
----<br />
[[Image:MirrorKOLPackage.png|right|MCK package]]<br />
# 下載KOL-CE的原始碼,並將之放在您的硬碟裡(當然要解壓縮)。<br />
# 執行Lazarus並點選選單項目'''Components > Open package file (.lpk)''',然後尋找到'''MCK'''套件所在的目錄,並選擇<tt>'''MirrorKOLPackage.lpk'''</tt>這個檔案。<br />
# 套件視窗此時就會跳出來了,請按下'''Install'''按鍵。<br />
# Lazarus會將MCK套件進行編譯,然後重新執行Lazarus IDE。<br />
# Lazarus IDE重新出現後,KOL分頁就會在元件盤上面出現了。<br />
[[Image:KOLComponents.png||KOL 元件盤分頁]]<br />
<br />
附註: 如果您沒有在元件盤上面看到KOL分頁的話,請把該視窗的高度拉大一點即可,您會看到元件盤的分頁標籤變成兩排,KOL分頁標籤就會出現在第二排。(如上面的螢幕截圖所示)<br />
<br />
MCK套件的升級非常簡單,請直接用新版的KOL-CE原始碼把舊版的覆蓋掉,再次開啟MCK套件(<tt>'''MirrorKOLPackage.lpk'''</tt>),然後按下'''Install'''按鍵,重新編譯套件就行了。<br />
<br />
== 使用MCK ==<br />
=== 建立MCK專案 ===<br />
[[Image:MCKForm.png|right|MCK form]]<br />
# 啟動Lazarus並點選表單來新增一個應用程式專案:'''File > New...'''。<br />
# 新增專案以後不要急! 千萬不要在這個時候放任何元件上去,請先把專案存檔,點選目錄選項: '''File > Save All''',然後選擇您要存放專案檔案的目錄即可。<br />
請注意!該專案的所有檔案,都必須存放在同一個目錄裡面。您可以隨時變更表單的單元檔檔名,但請不要變更專案的名稱,就用原來的<tt>Project1.lpi</tt>。<br />
# 請拖拉一個<tt>'''TKOLProject'''</tt>元件放到表單上面。<br />
# 請設定<tt>'''ProjectDest'''</tt>這個屬性,來變更MCK專案的名稱(不用包含路徑喔)。如果您輸入了<tt>MyKOLProg</tt>,那麼您的MCK專案名稱就會自動變成<tt>MyKOLProg.lpi</tt>,而產生出來的執行檔,也會被命名為<tt>MyKOLProg.exe</tt>。<br>[[Image:KOLProjectDest.png||ProjectDest property]]<br />
# 請把<tt>'''TKOLForm'''</tt>這個元件拖放到表單上面。<br />
# 把目前的專案存起來。<br />
# 請開啟剛剛您在<tt>'''ProjectDest'''</tt>屬性內設定的專案名稱, (在剛剛的例子裡面,應該是<tt>MyKOLProg.lpi</tt>,應該可以在同一個目錄裡面找到。然後,您就可以把<tt>project1.*</tt>給刪掉了,以後不會再用到這些檔案了。<br />
# 跟您的新KOL/MCK專案熟悉一下吧。(調整參數,放TKOL相關元件,編譯,執行,偵錯等等) 祝您玩的高興啦!<br />
<br />
=== 新增一個表單 ===<br />
# 點選目錄選項: '''File > New form'''<br />
# 把新表單跟專案存放在同一個目錄裡面。(如果專案檔已經存檔了的話,沒存檔的話請先把專案檔存檔)<br />
# 把<tt>'''TKOLForm'''</tt>元件拖拉到表單上面來。<br />
# 請確認在專案的主表單上面,已經有擺放了<tt>'''TKOLApplet'''</tt>這個元件。<br />
# 如果<tt>AutoBuild</tt>這個屬性已經設定為關閉,請點選主表單上面的<tt>'''TKOLProject'''</tt>元件,並雙擊它的屬性<tt>'''Build'''</tt>就可以建置該專案了,如果您雙擊<tt>'''Build'''</tt>沒有動靜的話,請按alt+Tab將視窗的焦點移到別的視窗上面,您就會發現有所動作了。<br />
<br />
=== 撰寫程式碼 ===<br />
<br />
請別使用RTL/FCL/LCL相關的單元,由其是SysUtils, Classes, Form這些單元,您需要的函式,應該在KOL, Windows, Messages這三個單元檔裡面找到,或者是由您自行撰寫的。<br />
當您在專案內撰寫程式碼的時候,請記得要放在事件處理函式內。您也可以自行撰寫程式碼,但不要動到程式原始碼的開始部分,也就是LCL表單的宣告部分。<br />
不要更改自動產生的inc檔案,請記得,您在專案裡面寫的程式碼,必須同時相容於LCL跟KOL,當使用LCL建置的時候,宣告部分會使用LCL的相關單元檔,專案會變成Win32相容的應用程式,而使用KOL建置的時候,則會使用KOL的相關單元檔,建置出來的則是WinCE相容的應用程式。<br />
<br />
=== 重點 ===<br />
為了解決KOL跟LCL對關鍵字的衝突: <tt>LCL.Self</tt>跟<tt>KOL.@Self</tt>,所以要特別使用<tt>Form</tt>這個欄位,在LCL裡面,<tt>TKOLForm</tt>元件的<tt>Form</tt>屬性,將會回傳<tt>Self</tt>這個屬性,也就是表單本身的意思,而在KOL裡面<tt>Form: PControl</tt>則是物件的屬性之一,包含了表單元件。也因為這一點,要變更表單的屬性,就要這麼寫:<br />
Form.Caption := 'Hello!'; <br />
(原來的寫法,是寫成Caption := 'Hello!';即可,當在使用LCL對本專案進行編譯的時候,這樣是完全沒問題的,但以KOL編譯時則會出錯)<br />
但上述討論的關鍵字<tt>Form</tt>只能使用到表單這個屬性,無法使用到表單上面的控制項。您要使用子控制項跟表單的事件處理函式時,請依照原來的方式即可,例如:<br />
Button1.Caption := 'OK';<br />
Button1Click(Form);<br />
<br />
=== 在執行時期動態建立表單 ===<br />
在執行時期,同一個表單是可以建立出多個實體的,只要把表單的屬性”AutoCreate”設定成不要自動建立,然後在需要的時候再透過程式碼來建立表單即可。要動態建立表單,請使用全域函式<tt>NewForm1</tt>:<br />
TempForm1 := NewForm1( Applet );<br />
要讓這個動作能夠執行,請別在建立表單實體的時候使用單元檔裡面的全域變數來承接建立出來的表單,除非您知道您為何要那麼作。<br />
<br />
<br />
== WinCE ==<br />
====設定====<br />
[[Image:arm-wince-target.png|right|arm-wince target]]<br />
您需要在您的系統中安裝Win32版本的arm-wince交叉編譯器,以建立WinCE的應用程式,請從[http://www.freepascal.org/download.var 這裡]下載。<br />
<br />
要編譯arm-wince的應用程式,您必須先設定專案的編譯器屬性,請點選選單項目: '''Project > Compiler options...''',點選'''Code'''分頁,並把target platform改變為arm-wince,如附圖所示。<br />
<br />
'''附註:''' 在編譯您的WinCE應用程式時,IDE可能會回報以下的錯誤訊息:<br />
Compiling resource KOL-CE.rc<br />
arm-wince-windres.exe: no resources<br />
KOL.PAS(57901) Error: Error while linking<br />
KOL.PAS(57901) Fatal: There were 1 errors compiling module, stopping<br />
<br />
此時,您需要編輯Windows的環境變數'''PATH''',把Win32平台FPC的編譯器路徑加進去。<br>如果您不知道要加入哪個路徑,請點選Lazarus選單項目: '''Environment options''',然後看compiler path這個欄位的資料就是了。<br><br />
'''別變動Lazarus裡面的PATH,離開Lazarus'''.<br><br />
用滑鼠右鍵在”我的電腦”圖示上面點擊,選擇目錄裡的’’’內容’’’,再點選內容視窗裡面的'''進階'''分頁,再點選'''環境變數'''這個按鍵就可以編輯'''PATH'''這個環境變數了。<br />
<br />
====提示與註記====<br />
* 要建立大多數Pocket PC上的全螢幕應用程式,請別變更表單的位置跟大小,如果表單的大小跟位置被變動了,則該表單就會看起來像是有標題欄的對話視窗,當然也包含標題欄的關閉程式按鈕。在MCK裡面把TKOLForm元件的'''defaultSize'''跟'''defaultPosition'''這兩個屬性設定為”True”就能讓表單全螢幕顯示了。<br />
<br />
====已知的問題====<br />
* 下列兩個元件目前不支援: RichEdit, TrayIcon.<br />
* 目前只支援gsVertical, gsHorizontal 這兩種panel樣式。<br />
<br />
== 說明文件 ==<br />
* 您可以從KOL官方網站找到KOL跟MCK的官方文件跟相關資訊: http://kolmck.ru<br />
* 請務必閱讀MCK目錄裡面的'''KOLmirrorReadme.txt'''這個檔案,這是MCK的說明文件。<br />
<br />
== 實際用KOL-CE製作的應用程式 ==<br />
* [http://www.cp-lab.com/windows-mobile.html XP Mobile密碼管理員]<br />
* [http://blog.carolos.za.net/2007/05/charmed-for-pocket-pc-beta-030.html ChARMeD 反組譯程式]<br />
* [http://www.jongma.org/WMWifiRouter/ WMWifiRouter無線網路路由器]<br />
<br />
== 相關連結 ==<br />
* [http://f0460945.xsph.ru/rindex.htm KOL&MCK官方網站]<br />
* SourceForge 網站上的KOL-CE網頁 http://sourceforge.net/projects/kol-ce/<br />
* [[WinCE port/zh_TW|將WinCE移植給Free Pascal用]]<br />
* [[Windows CE Interface/zh_TW|Windows CE程式介面]]<br />
* [[Windows CE Development Notes/zh_TW|Windows CE開發筆記]]<br />
<br />
== 歷史與聯繫==<br />
請將您遇到的問題透過這個SourceForge的網址進行回報: http://sourceforge.net/projects/kol-ce/<br />
<br />
*初版正體中文翻譯,由[http://www.yzu.edu.tw/ 元智大學][http://www.infocom.yzu.edu.tw/ 資訊傳播學系]兼任講師[mailto://dennies@ms4.hinet.net 張子仁 (Dennies Chang)]製作。 - 2008/1/8 [[User:Dennies]]<br />
<br />
<br />
[[Category:zh]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=KOL-CE/zh_CN&diff=144763KOL-CE/zh CN2021-04-29T16:32:45Z<p>Seenkao: </p>
<hr />
<div>{{KOL-CE}}<br />
==介绍==<br />
KOL-CE是由[http://f0460945.xsph.ru/rindex.htm Vladimir Kladov] 开发的元件,在其他平台上为KOL跟MCK两组套件,现在则是将之移植到Free Pascal跟Lazarus上使用,关于它的授权,请参见: [http://www.opensource.org/licenses/wxwindows.php wxWindow函式库授权].<br />
<br />
KOL-CE可以建立非常精简的Win32/WinCE图形界面程序(如果项目只包含一个空的视窗的话,建置出来的程序码大约只占40KB而已)。<br />
<br />
MCK则是让KOL-CE项目使用的一组Lazarus套件,KOL-CE的图形界面就是靠MCK来达成的。<br />
<br />
原本KOL-CE只是计划把KOL移植给[[WinCE port|WinCE]]使用而已,但后来开发的时候决定要把Win32的许多功能保留下来,并让FPC开发WinCE应用程序能够更顺利。原本KOL是为Delphi设计的,当时在FPC上面运作并不顺,而原始的MCK则是完全不能在Lazarus上面使用的。<br />
<br />
=== 基本需求 ===<br />
* Win32平台上的Free Pascal编译器2.2.0版或更新的版本。<br />
* Win32平台上的arm-wince交叉编译器2.2.0或更新的版本(开发[[WinCE port|WinCE]]程序时会用到).<br />
* Win32平台上的Lazarus 0.9.23版或更新的版本。<br />
<br />
=== 能支援的平台 ===<br />
* 所有32位元的Windows作业系统,从Windows 95到Vista都行。<br />
* 使用[[WinCE port|Windows CE]]为作业系统的PocketPC跟手机。<br />
<br />
== 下载 ==<br />
请从[http://sourceforge.net/project/showfiles.php?group_id=188451 这里]下载最新版的KOL-CE<br />
<br />
您也可以从SVN下载最新出炉的KOL-CE原始码,连结如下: https://kol-ce.svn.sourceforge.net/svnroot/kol-ce/trunk<br />
<br />
== 安装 ==<br />
----<br />
如果您正在使用Lazarus 0.25版或更新的版本,则您就需要先加入<tt>'''DisableFakeMethods'''</tt>这个设定,重新编译Lazarus,接着才能安装MCK套件。<br />
<br />
'''注意:''' KOL-CE 2.80.2 及以后版本不再需要定义 <tt>DisableFakeMethods</tt> 。<br />
<br />
如果您以前使用 KOL-CE 2.80.1 或更旧版本。在安装 MCK 包之前您需要'''去掉''' <tt>DisableFakeMethods</tt> 定义并重编译Lazarus。否则'''event handlers(事件处理程序)无法工作'''!<br />
<br />
<br />
<br />
步骤如下:<br />
# 执行Lazarus.<br />
# 点选选单项目: '''Tools > Configure "Build Lazarus"...'''<br />
# 在'''Quick Build Options'''分页上,点选'''Clean Up + Build all'''项目。<br />
# 开启'''Advanced Build Options'''分页,并在'''Options'''这个对话框里面加入<tt>'''-dDisableFakeMethods'''</tt>这个设定字符串。<br />
# 点选'''Build'''按键以重新建置Lazarus。<br />
----<br />
[[Image:MirrorKOLPackage.png|right|MCK package]]<br />
# 下载KOL-CE的原始码,并将之放在您的硬盘里(当然要解压缩)。<br />
# 执行Lazarus并点选选单项目'''Components > Open package file (.lpk)''',然后寻找到'''MCK'''套件所在的目录,并选择<tt>'''MirrorKOLPackage.lpk'''</tt>这个档案。<br />
# 套件视窗此时就会跳出来了,请按下'''Install'''按键。<br />
# Lazarus会将MCK套件进行编译,然后重新执行Lazarus IDE。<br />
# Lazarus IDE重新出现后,KOL分页就会在元件盘上面出现了。<br />
[[Image:KOLComponents.png||KOL 元件盘分页]]<br />
<br />
附注: 如果您没有在元件盘上面看到KOL分页的话,请把该视窗的高度拉大一点即可,您会看到元件盘的分页标签变成两排,KOL分页标签就会出现在第二排。(如上面的荧幕截图所示)<br />
<br />
MCK套件的升级非常简单,请直接用新版的KOL-CE原始码把旧版的覆盖掉,再次开启MCK套件(<tt>'''MirrorKOLPackage.lpk'''</tt>),然后按下'''Install'''按键,重新编译套件就行了。<br />
<br />
== 使用MCK ==<br />
=== 建立MCK项目 ===<br />
[[Image:MCKForm.png|right|MCK form]]<br />
# 启动Lazarus并点选表单来新增一个应用程序项目:'''File > New...'''。<br />
# 新增项目以后不要急! 千万不要在这个时候放任何元件上去,请先把项目存档,点选目录选项: '''File > Save All''',然后选择您要存放项目档案的目录即可。<br />
请注意!该项目的所有档案,都必须存放在同一个目录里面。您可以随时变更表单的单元档档名,但请不要变更项目的名称,就用原来的<tt>Project1.lpi</tt>。<br />
# 请拖拉一个<tt>'''TKOLProject'''</tt>元件放到表单上面。<br />
# 请设定<tt>'''ProjectDest'''</tt>这个属性,来变更MCK项目的名称(不用包含路径喔)。如果您输入了<tt>MyKOLProg</tt>,那么您的MCK项目名称就会自动变成<tt>MyKOLProg.lpi</tt>,而产生出来的执行档,也会被命名为<tt>MyKOLProg.exe</tt>。<br>[[Image:KOLProjectDest.png||ProjectDest property]]<br />
# 请把<tt>'''TKOLForm'''</tt>这个元件拖放到表单上面。<br />
# 把目前的项目存起来。<br />
# 请开启刚刚您在<tt>'''ProjectDest'''</tt>属性内设定的项目名称, (在刚刚的例子里面,应该是<tt>MyKOLProg.lpi</tt>,应该可以在同一个目录里面找到。然后,您就可以把<tt>project1.*</tt>给删掉了,以后不会再用到这些档案了。<br />
# 跟您的新KOL/MCK项目熟悉一下吧。(调整参数,放TKOL相关元件,编译,执行,侦错等等) 祝您玩的高兴啦!<br />
<br />
=== 新增一个表单 ===<br />
# 点选目录选项: '''File > New form'''<br />
# 把新表单跟项目存放在同一个目录里面。(如果项目档已经存档了的话,没存档的话请先把项目档存档)<br />
# 把<tt>'''TKOLForm'''</tt>元件拖拉到表单上面来。<br />
# 请确认在项目的主表单上面,已经有摆放了<tt>'''TKOLApplet'''</tt>这个元件。<br />
# 如果<tt>AutoBuild</tt>这个属性已经设定为关闭,请点选主表单上面的<tt>'''TKOLProject'''</tt>元件,并双击它的属性<tt>'''Build'''</tt>就可以建置该项目了,如果您双击<tt>'''Build'''</tt>没有动静的话,请按alt+Tab将视窗的焦点移到别的视窗上面,您就会发现有所动作了。<br />
<br />
=== 撰写程序码 ===<br />
<br />
请别使用RTL/FCL/LCL相关的单元,由其是SysUtils, Classes, Form这些单元,您需要的函式,应该在KOL, Windows, Messages这三个单元档里面找到,或者是由您自行撰写的。<br />
当您在项目内撰写程序码的时候,请记得要放在事件处理函式内。您也可以自行撰写程序码,但不要动到程序原始码的开始部分,也就是LCL表单的宣告部分。<br />
不要更改自动产生的inc档案,请记得,您在项目里面写的程序码,必须同时兼容于LCL跟KOL,当使用LCL建置的时候,宣告部分会使用LCL的相关单元档,项目会变成Win32兼容的应用程序,而使用KOL建置的时候,则会使用KOL的相关单元档,建置出来的则是WinCE兼容的应用程序。<br />
<br />
=== 重点 ===<br />
为了解决KOL跟LCL对关键字的冲突: <tt>LCL.Self</tt>跟<tt>KOL.@Self</tt>,所以要特别使用<tt>Form</tt>这个栏位,在LCL里面,<tt>TKOLForm</tt>元件的<tt>Form</tt>属性,将会回传<tt>Self</tt>这个属性,也就是表单本身的意思,而在KOL里面<tt>Form: PControl</tt>则是物件的属性之一,包含了表单元件。也因为这一点,要变更表单的属性,就要这么写:<br />
Form.Caption := 'Hello!'; <br />
(原来的写法,是写成Caption := 'Hello!';即可,当在使用LCL对本项目进行编译的时候,这样是完全没问题的,但以KOL编译时则会出错)<br />
但上述讨论的关键字<tt>Form</tt>只能使用到表单这个属性,无法使用到表单上面的控制项。您要使用子控制项跟表单的事件处理函式时,请依照原来的方式即可,例如:<br />
Button1.Caption := 'OK';<br />
Button1Click(Form);<br />
<br />
=== 在执行时期动态建立表单 ===<br />
在执行时期,同一个表单是可以建立出多个实体的,只要把表单的属性”AutoCreate”设定成不要自动建立,然后在需要的时候再透过程序码来建立表单即可。要动态建立表单,请使用全域函式<tt>NewForm1</tt>:<br />
TempForm1 := NewForm1( Applet );<br />
要让这个动作能够执行,请别在建立表单实体的时候使用单元档里面的全域变量来承接建立出来的表单,除非您知道您为何要那么作。<br />
<br />
<br />
== WinCE ==<br />
====设定====<br />
[[Image:arm-wince-target.png|right|arm-wince target]]<br />
您需要在您的系统中安装Win32版本的arm-wince交叉编译器,以建立WinCE的应用程序,请从[http://www.freepascal.org/download.var 这里]下载。<br />
<br />
要编译arm-wince的应用程序,您必须先设定项目的编译器属性,请点选选单项目: '''Project > Compiler options...''',点选'''Code'''分页,并把target platform改变为arm-wince,如附图所示。<br />
<br />
'''附注:''' 在编译您的WinCE应用程序时,IDE可能会回报以下的错误讯息:<br />
Compiling resource KOL-CE.rc<br />
arm-wince-windres.exe: no resources<br />
KOL.PAS(57901) Error: Error while linking<br />
KOL.PAS(57901) Fatal: There were 1 errors compiling module, stopping<br />
<br />
此时,您需要编辑Windows的环境变量'''PATH''',把Win32平台FPC的编译器路径加进去。<br>如果您不知道要加入哪个路径,请点选Lazarus选单项目: '''Environment options''',然后看compiler path这个栏位的资料就是了。<br><br />
'''别变动Lazarus里面的PATH,离开Lazarus'''.<br><br />
用鼠标右键在”我的计算机”图示上面点击,选择目录里的’’’内容’’’,再点选内容视窗里面的'''进阶'''分页,再点选'''环境变量'''这个按键就可以编辑'''PATH'''这个环境变量了。<br />
<br />
====提示与注记====<br />
* 要建立大多数Pocket PC上的全荧幕应用程序,请别变更表单的位置跟大小,如果表单的大小跟位置被变动了,则该表单就会看起来象是有标题栏的对话视窗,当然也包含标题栏的关闭程序按钮。在MCK里面把TKOLForm元件的'''defaultSize'''跟'''defaultPosition'''这两个属性设定为”True”就能让表单全荧幕显示了。<br />
<br />
====已知的问题====<br />
* 下列两个元件目前不支援: RichEdit, TrayIcon.<br />
* 目前只支援gsVertical, gsHorizontal 这两种panel样式。<br />
<br />
== 说明文件 ==<br />
* 您可以从KOL官方网站找到KOL跟MCK的官方文件跟相关信息: http://kolmck.ru<br />
* 请务必阅读MCK目录里面的'''KOLmirrorReadme.txt'''这个档案,这是MCK的说明文件。<br />
<br />
== 实际用KOL-CE制作的应用程序 ==<br />
* [http://www.cp-lab.com/windows-mobile.html XP Mobile密码管理员]<br />
* [http://blog.carolos.za.net/2007/05/charmed-for-pocket-pc-beta-030.html ChARMeD 反组译程序]<br />
* [http://www.jongma.org/WMWifiRouter/ WMWifiRouter无线网络路由器]<br />
<br />
== 相关连结 ==<br />
* [http://f0460945.xsph.ru/rindex.htm KOL&MCK官方网站]<br />
* SourceForge 网站上的KOL-CE网页 http://sourceforge.net/projects/kol-ce/<br />
* [[WinCE port/zh_TW|将WinCE移植给Free Pascal用]]<br />
* [[Windows CE Interface/zh_TW|Windows CE程序界面]]<br />
* [[Windows CE Development Notes/zh_TW|Windows CE开发笔记]]<br />
<br />
== 历史与联系==<br />
请将您遇到的问题透过这个SourceForge的网址进行回报: http://sourceforge.net/projects/kol-ce/<br />
<br />
以上页面转换自[[KOL-CE/zh TW]],欢迎补充。<br />
[[Category:zh]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=KOL-CE/zh_CN&diff=144762KOL-CE/zh CN2021-04-29T16:31:22Z<p>Seenkao: </p>
<hr />
<div>{{KOL-CE}}<br />
==介绍==<br />
KOL-CE是由[http://f0460945.xsph.ru/rindex.htm Vladimir Kladov] 开发的元件,在其他平台上为KOL跟MCK两组套件,现在则是将之移植到Free Pascal跟Lazarus上使用,关于它的授权,请参见: [http://www.opensource.org/licenses/wxwindows.php wxWindow函式库授权].<br />
<br />
KOL-CE可以建立非常精简的Win32/WinCE图形界面程序(如果项目只包含一个空的视窗的话,建置出来的程序码大约只占40KB而已)。<br />
<br />
MCK则是让KOL-CE项目使用的一组Lazarus套件,KOL-CE的图形界面就是靠MCK来达成的。<br />
<br />
原本KOL-CE只是计划把KOL移植给[[WinCE port|WinCE]]使用而已,但后来开发的时候决定要把Win32的许多功能保留下来,并让FPC开发WinCE应用程序能够更顺利。原本KOL是为Delphi设计的,当时在FPC上面运作并不顺,而原始的MCK则是完全不能在Lazarus上面使用的。<br />
<br />
=== 基本需求 ===<br />
* Win32平台上的Free Pascal编译器2.2.0版或更新的版本。<br />
* Win32平台上的arm-wince交叉编译器2.2.0或更新的版本(开发[[WinCE port|WinCE]]程序时会用到).<br />
* Win32平台上的Lazarus 0.9.23版或更新的版本。<br />
<br />
=== 能支援的平台 ===<br />
* 所有32位元的Windows作业系统,从Windows 95到Vista都行。<br />
* 使用[[WinCE port|Windows CE]]为作业系统的PocketPC跟手机。<br />
<br />
== 下载 ==<br />
请从[http://sourceforge.net/project/showfiles.php?group_id=188451 这里]下载最新版的KOL-CE<br />
<br />
您也可以从SVN下载最新出炉的KOL-CE原始码,连结如下: https://kol-ce.svn.sourceforge.net/svnroot/kol-ce/trunk<br />
<br />
== 安装 ==<br />
----<br />
如果您正在使用Lazarus 0.25版或更新的版本,则您就需要先加入<tt>'''DisableFakeMethods'''</tt>这个设定,重新编译Lazarus,接着才能安装MCK套件。<br />
<br />
'''注意:''' KOL-CE 2.80.2 及以后版本不再需要定义 <tt>DisableFakeMethods</tt> 。<br />
<br />
如果您以前使用 KOL-CE 2.80.1 或更旧版本。在安装 MCK 包之前您需要'''去掉''' <tt>DisableFakeMethods</tt> 定义并重编译Lazarus。否则'''event handlers(事件处理程序)无法工作'''!<br />
<br />
<br />
<br />
步骤如下:<br />
# 执行Lazarus.<br />
# 点选选单项目: '''Tools > Configure "Build Lazarus"...'''<br />
# 在'''Quick Build Options'''分页上,点选'''Clean Up + Build all'''项目。<br />
# 开启'''Advanced Build Options'''分页,并在'''Options'''这个对话框里面加入<tt>'''-dDisableFakeMethods'''</tt>这个设定字符串。<br />
# 点选'''Build'''按键以重新建置Lazarus。<br />
----<br />
[[Image:MirrorKOLPackage.png|right|MCK package]]<br />
# 下载KOL-CE的原始码,并将之放在您的硬盘里(当然要解压缩)。<br />
# 执行Lazarus并点选选单项目'''Components > Open package file (.lpk)''',然后寻找到'''MCK'''套件所在的目录,并选择<tt>'''MirrorKOLPackage.lpk'''</tt>这个档案。<br />
# 套件视窗此时就会跳出来了,请按下'''Install'''按键。<br />
# Lazarus会将MCK套件进行编译,然后重新执行Lazarus IDE。<br />
# Lazarus IDE重新出现后,KOL分页就会在元件盘上面出现了。<br />
[[Image:KOLComponents.png||KOL 元件盘分页]]<br />
<br />
附注: 如果您没有在元件盘上面看到KOL分页的话,请把该视窗的高度拉大一点即可,您会看到元件盘的分页标签变成两排,KOL分页标签就会出现在第二排。(如上面的荧幕截图所示)<br />
<br />
MCK套件的升级非常简单,请直接用新版的KOL-CE原始码把旧版的覆盖掉,再次开启MCK套件(<tt>'''MirrorKOLPackage.lpk'''</tt>),然后按下'''Install'''按键,重新编译套件就行了。<br />
<br />
== 使用MCK ==<br />
=== 建立MCK项目 ===<br />
[[Image:MCKForm.png|right|MCK form]]<br />
# 启动Lazarus并点选表单来新增一个应用程序项目:'''File > New...'''。<br />
# 新增项目以后不要急! 千万不要在这个时候放任何元件上去,请先把项目存档,点选目录选项: '''File > Save All''',然后选择您要存放项目档案的目录即可。<br />
请注意!该项目的所有档案,都必须存放在同一个目录里面。您可以随时变更表单的单元档档名,但请不要变更项目的名称,就用原来的<tt>Project1.lpi</tt>。<br />
# 请拖拉一个<tt>'''TKOLProject'''</tt>元件放到表单上面。<br />
# 请设定<tt>'''ProjectDest'''</tt>这个属性,来变更MCK项目的名称(不用包含路径喔)。如果您输入了<tt>MyKOLProg</tt>,那么您的MCK项目名称就会自动变成<tt>MyKOLProg.lpi</tt>,而产生出来的执行档,也会被命名为<tt>MyKOLProg.exe</tt>。<br>[[Image:KOLProjectDest.png||ProjectDest property]]<br />
# 请把<tt>'''TKOLForm'''</tt>这个元件拖放到表单上面。<br />
# 把目前的项目存起来。<br />
# 请开启刚刚您在<tt>'''ProjectDest'''</tt>属性内设定的项目名称, (在刚刚的例子里面,应该是<tt>MyKOLProg.lpi</tt>,应该可以在同一个目录里面找到。然后,您就可以把<tt>project1.*</tt>给删掉了,以后不会再用到这些档案了。<br />
# 跟您的新KOL/MCK项目熟悉一下吧。(调整参数,放TKOL相关元件,编译,执行,侦错等等) 祝您玩的高兴啦!<br />
<br />
=== 新增一个表单 ===<br />
# 点选目录选项: '''File > New form'''<br />
# 把新表单跟项目存放在同一个目录里面。(如果项目档已经存档了的话,没存档的话请先把项目档存档)<br />
# 把<tt>'''TKOLForm'''</tt>元件拖拉到表单上面来。<br />
# 请确认在项目的主表单上面,已经有摆放了<tt>'''TKOLApplet'''</tt>这个元件。<br />
# 如果<tt>AutoBuild</tt>这个属性已经设定为关闭,请点选主表单上面的<tt>'''TKOLProject'''</tt>元件,并双击它的属性<tt>'''Build'''</tt>就可以建置该项目了,如果您双击<tt>'''Build'''</tt>没有动静的话,请按alt+Tab将视窗的焦点移到别的视窗上面,您就会发现有所动作了。<br />
<br />
=== 撰写程序码 ===<br />
<br />
请别使用RTL/FCL/LCL相关的单元,由其是SysUtils, Classes, Form这些单元,您需要的函式,应该在KOL, Windows, Messages这三个单元档里面找到,或者是由您自行撰写的。<br />
当您在项目内撰写程序码的时候,请记得要放在事件处理函式内。您也可以自行撰写程序码,但不要动到程序原始码的开始部分,也就是LCL表单的宣告部分。<br />
不要更改自动产生的inc档案,请记得,您在项目里面写的程序码,必须同时兼容于LCL跟KOL,当使用LCL建置的时候,宣告部分会使用LCL的相关单元档,项目会变成Win32兼容的应用程序,而使用KOL建置的时候,则会使用KOL的相关单元档,建置出来的则是WinCE兼容的应用程序。<br />
<br />
=== 重点 ===<br />
为了解决KOL跟LCL对关键字的冲突: <tt>LCL.Self</tt>跟<tt>KOL.@Self</tt>,所以要特别使用<tt>Form</tt>这个栏位,在LCL里面,<tt>TKOLForm</tt>元件的<tt>Form</tt>属性,将会回传<tt>Self</tt>这个属性,也就是表单本身的意思,而在KOL里面<tt>Form: PControl</tt>则是物件的属性之一,包含了表单元件。也因为这一点,要变更表单的属性,就要这么写:<br />
Form.Caption := 'Hello!'; <br />
(原来的写法,是写成Caption := 'Hello!';即可,当在使用LCL对本项目进行编译的时候,这样是完全没问题的,但以KOL编译时则会出错)<br />
但上述讨论的关键字<tt>Form</tt>只能使用到表单这个属性,无法使用到表单上面的控制项。您要使用子控制项跟表单的事件处理函式时,请依照原来的方式即可,例如:<br />
Button1.Caption := 'OK';<br />
Button1Click(Form);<br />
<br />
=== 在执行时期动态建立表单 ===<br />
在执行时期,同一个表单是可以建立出多个实体的,只要把表单的属性”AutoCreate”设定成不要自动建立,然后在需要的时候再透过程序码来建立表单即可。要动态建立表单,请使用全域函式<tt>NewForm1</tt>:<br />
TempForm1 := NewForm1( Applet );<br />
要让这个动作能够执行,请别在建立表单实体的时候使用单元档里面的全域变量来承接建立出来的表单,除非您知道您为何要那么作。<br />
<br />
<br />
== WinCE ==<br />
====设定====<br />
[[Image:arm-wince-target.png|right|arm-wince target]]<br />
您需要在您的系统中安装Win32版本的arm-wince交叉编译器,以建立WinCE的应用程序,请从[http://www.freepascal.org/download.var 这里]下载。<br />
<br />
要编译arm-wince的应用程序,您必须先设定项目的编译器属性,请点选选单项目: '''Project > Compiler options...''',点选'''Code'''分页,并把target platform改变为arm-wince,如附图所示。<br />
<br />
'''附注:''' 在编译您的WinCE应用程序时,IDE可能会回报以下的错误讯息:<br />
Compiling resource KOL-CE.rc<br />
arm-wince-windres.exe: no resources<br />
KOL.PAS(57901) Error: Error while linking<br />
KOL.PAS(57901) Fatal: There were 1 errors compiling module, stopping<br />
<br />
此时,您需要编辑Windows的环境变量'''PATH''',把Win32平台FPC的编译器路径加进去。<br>如果您不知道要加入哪个路径,请点选Lazarus选单项目: '''Environment options''',然后看compiler path这个栏位的资料就是了。<br><br />
'''别变动Lazarus里面的PATH,离开Lazarus'''.<br><br />
用鼠标右键在”我的计算机”图示上面点击,选择目录里的’’’内容’’’,再点选内容视窗里面的'''进阶'''分页,再点选'''环境变量'''这个按键就可以编辑'''PATH'''这个环境变量了。<br />
<br />
====提示与注记====<br />
* 要建立大多数Pocket PC上的全荧幕应用程序,请别变更表单的位置跟大小,如果表单的大小跟位置被变动了,则该表单就会看起来象是有标题栏的对话视窗,当然也包含标题栏的关闭程序按钮。在MCK里面把TKOLForm元件的'''defaultSize'''跟'''defaultPosition'''这两个属性设定为”True”就能让表单全荧幕显示了。<br />
<br />
====已知的问题====<br />
* 下列两个元件目前不支援: RichEdit, TrayIcon.<br />
* 目前只支援gsVertical, gsHorizontal 这两种panel样式。<br />
<br />
== 说明文件 ==<br />
* 您可以从KOL官方网站找到KOL跟MCK的官方文件跟相关信息: http://kolmck.ru<br />
* 请务必阅读MCK目录里面的'''KOLmirrorReadme.txt'''这个档案,这是MCK的说明文件。<br />
<br />
== 实际用KOL-CE制作的应用程序 ==<br />
* [http://www.cp-lab.com/windows-mobile.html XP Mobile密码管理员]<br />
* [http://blog.carolos.za.net/2007/05/charmed-for-pocket-pc-beta-030.html ChARMeD 反组译程序]<br />
* [http://www.jongma.org/WMWifiRouter/ WMWifiRouter无线网络路由器]<br />
<br />
== 相关连结 ==<br />
* [http://f0460945.xsph.ru/rindex.htm KOL&MCK官方网站]<br />
* SourceForge 网站上的KOL-CE网页http://sourceforge.net/projects/kol-ce/<br />
* [[WinCE port/zh_TW|将WinCE移植给Free Pascal用]]<br />
* [[Windows CE Interface/zh_TW|Windows CE程序界面]]<br />
* [[Windows CE Development Notes/zh_TW|Windows CE开发笔记]]<br />
<br />
== 历史与联系==<br />
请将您遇到的问题透过这个SourceForge的网址进行回报: http://sourceforge.net/projects/kol-ce/<br />
<br />
以上页面转换自[[KOL-CE/zh TW]],欢迎补充。<br />
[[Category:zh]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=KOL-CE/ru&diff=144761KOL-CE/ru2021-04-29T16:29:33Z<p>Seenkao: </p>
<hr />
<div>{{KOL-CE}}<br />
==Введение==<br />
KOL-CE - это [http://f0460945.xsph.ru/rindex.htm KOL&MCK] от Владимира Кладова, портированная под Free Pascal/Lazarus. KOL-CE создана Юрием Сидоровым и распространяется под [http://www.opensource.org/licenses/wxwindows.php wxWindows Library Licence].<br />
<br />
KOL-CE позволяет создавать очень компактные Win32/WinCE GUI приложения (начиная от ~40KB приложения с пустой формой).<br />
<br />
MCK это пакет, позволяющий проектировать приложения KOL-CE визуально, используя Lazarus IDE.<br />
<br />
Изначально KOL-CE планировался как KOL, портированный только для [[WinCE port|WinCE]]. Но потом было решено оставить функции Win32 и доделать его работу с FPC. Оригинальный KOL предназначалась для Delphi и работает во Free Pascal с ошибками. А оригинал MCK вообще нельзя было использовать для Lazarus.<br />
<br />
=== Требования ===<br />
* Free Pascal compiler 2.2.0 или позже для Win32.<br />
* arm-wince cross compiler 2.2.0 или позже для Win32 (for [[WinCE port|WinCE]] development).<br />
* Lazarus 0.9.26 или позже для Win32.<br />
<br />
=== Поддерживаемые платформы: ===<br />
* Все 32-битные Windows: от Windows 95 до Windows 7.<br />
* [[WinCE port|Windows CE]] для PocketPC и смартфонов.<br />
<br />
== Загрузка ==<br />
Последний релиз KOL-CE можно скачать [http://sourceforge.net/project/showfiles.php?group_id=188451 здесь].<br />
<br />
Также вы можете получить свежие исходники KOL-CE из [https://kol-ce.svn.sourceforge.net/svnroot/kol-ce/trunk SVN].<br />
<br />
== Установка ==<br />
----<br />
'''Важно:''' После KOL-CE 2.80.2 определение <tt>DisableFakeMethods</tt> больше не требуется.<br />
<br />
Если раньше вы использовали KOL-CE 2.80.1 или ранее, вам надо пересобрать Lazarus '''без''' определения <tt>DisableFakeMethods</tt> перед установкой пакета MCK. Иначе '''обработчики событий не будут работать'''!<br />
<br />
Сделаем это:<br />
# Запустить Lazarus.<br />
# Выбрать пункт '''Tools > Configure "Build Lazarus"...''' ('''Сервис > Параметры сборки Lazarus...''').<br />
# Выбрать '''Clean Up + Build all'''(Очистить всё + собрать всё) на странице '''Quick Build Options''' (простые параметры сборки).<br />
# Открыть страницу '''Advanced Build Options''' (Расширенные параметры сборки) и '''remove''' <tt>-dDisableFakeMethods</tt> из поля ввода '''Options''' .<br />
# Кликнуть по кнопке '''Build''' для пересборки Lazarus.<br />
----<br />
[[Image:MirrorKOLPackage.png|right|MCK package]]<br />
# Загрузите KOL-CE и поместите куда-нибудь рядом с Лазарусом.<br />
# Запустите Lazarus и выберите пункты меню '''Components > Load package file'''. Укажите папку '''MCK''' и выберите файл <tt>'''MirrorKOLPackage.lpk'''</tt>.<br />
# Появится окно содержимого пакета. Нажмите кнопку '''Install'''.<br />
# Лазарус скомпилирует пакет MCK перезапустится.<br />
# После этого на палитре компонентов появится вкладка KOL.<br />
[[Image:KOLComponents.png||KOL components palette]]<br />
<br />
СОВЕТ: Если вы видите не все компоненты KOL на палитре компонентов, увеличьте размер окна по вертикали. Появится вторая строка с недостающими копонентами (см. скриншот).<br />
<br />
Обновить пакет MCK очень легко. Просто перезапишите обновленные KOL-CE исходники поверх (вместо) старых, откройте пакет MCK через Lazarus и нажмите '''Install''', пакет перекомпилится, и будет вам счастье!<br />
<br />
== Особенности использования MCK ==<br />
=== Создание нового проекта ===<br />
[[Image:MCKForm.png|right|MCK form]]<br />
# Запустите Lazarus, выберите '''File > New...''' ('''Файл > Создать ...''').<br />
# Выберите '''KOL Application''' в секции '''Project''' и нежмите '''OK'''.<br />
# Будет создан новый KOL проект.<br />
# Сохраните проект под новым именем.<br />
# Продукт готов к использованию, срок годности ограничен вашей фантазией =). Можете развлекаться!<br />
<br />
=== Добавление формы ===<br />
# Выберите '''File > New...''' ('''Файл > Создать ...''').<br />
# Выберите '''KOL Form'''(иногда просто '''Form''') в секции '''File''' ('''Модуль''') и нажмите '''OK'''.<br />
# Сохраните модуль с формой под новым именем.<br />
<br />
=== Особенности написания кода ===<br />
<br />
Не используйте элементы из RTL/FCL/LCL, особенно из SysUtils, Classes, Forms и подобных им. Всё необходимое придётся искать в модулях KOL, Windows, Messages. А может быть, вы напишете что-то сами (или скопируете из других исходников).<br />
Если вы пишете в зеркальном проекте (mirror project) - Обычно поместите его в обработчики событий.<br />
Вы также можете добавлять любой код где пожелаете, но избегайте изменения первой секции объявления класса вашей зеркальной LCL формы. И не изменяйте автоматически созданные inc-файлы.<br />
Всегда помните, что код, который вы пишете в зеркальном проекте, должен быть принят и LCL, и KOL. LCL - на этапе компиляции зеркального проекта (и это необходимо, потому что иначе конвертация зеркального проекта в отражённый KOL проект будет невозможна). А KOL - на этапе компиляции написанного кода в KOL.<br />
<br />
=== Важно ===<br />
Для решения конфликта между словами <tt>LCL.Self</tt> и <tt>KOL.@Self</tt>, которые интерпретируются по-разному в KOL и LCL, добавлен специальный компонент - <tt>Form</tt>. В LCL, свойство <tt>Form</tt> типа компонент <tt>TKOLForm</tt> "возвращает" <tt>Self</tt>, То есть форму. А в KOL, <tt>Form: PControl</tt> - это поле-объект, содержащий сам объект-форму. Поэтому, вместо <br />
MainForm.caption := 'Hello!', где MainForm - ваша форма, пишите<br />
Form.Caption := 'Hello!'; <br />
(Старое обращение Caption := 'Hello!'; компилируется нормально при преобразовании зеркального проекта в KOL, однако в самом(без MCK) KOL это будет неправильно).<br />
Но через <tt>Form</tt> можно обращаться только к свойствам формы - не к дочерним компонентам. Вам доступны дочерние компоненты и обработчики событий черес саму форму. например: <br />
Button1.Caption := 'OK';<br />
Button1Click(Form);<br />
<br />
=== Run-time создание форм ===<br />
Можно создать несколько экземпляров одной и той же формы во время выполнения программы. Притом можно сделать не АвтоСоздаваемую форму, а создавать её программно, когда это необходимо. Используйте глобальную функцию <tt>NewForm1</tt> (замените Form1 на имя вашей зеркальной формы) например:<br />
NewForm1( TempForm1, Applet );<br />
Для таких созданных во время выполнения форм справедливо то же правило, что и дляавтосозданных - обращайтесь к сваойствам формы через свойство-объект <tt>Form</tt><br />
<br />
== WinCE ==<br />
====Установка====<br />
[[Image:arm-wince-target.png|right|arm-wince target]]<br />
Для начала надо установить кросскомпилятор arm-wince for Win32 для компиляции исполняемых файлов WinCE. Можно скачать [http://www.freepascal.org/download.var здесь]. Нужно скачать lazarus с кросскомпилятором в комплекте и затем установить поверх уже установленного Lazarus'a, то есть в ту же папку.<br />
<br />
Чтобы компилировать под arm-wince откройте параметры компилятора для вашего проекта, выбрав пункт меню '''Project > Compiler options...'''. Откройте вкладку '''Code''' ('''Код''') и поменяйте операционную систему на WinCE, а целевое семейство процессоров на arm.<br />
<br />
На вкладке '''Пути''' поменяйте библиотеку виджетов LCL на WinCe.<br />
<br />
'''ПРИМЕЧАНИЕ:''' Вы можете получить следующие сообщения об ошибке во время компиляции вашего KOL-CE проекта для WinCE:<br />
Compiling resource KOL-CE.rc<br />
arm-wince-windres.exe: no resources<br />
KOL.PAS(57901) Error: Error while linking<br />
KOL.PAS(57901) Fatal: There were 1 errors compiling module, stopping<br />
<br />
В таком случае вам нужно изменить переменную окружения '''PATH''' '''Windows''' и добавить путь к папке, где расположены файлы win32 FPC.<br><br />
Чтобы узнать, какой путь добавить, перейдите на'''Окружение'''>'''Параметры''' в Lazarus и посмотреть путь к компилятору.<br><br />
'''Перед изменением PATH закройте Lazarus'''.<br><br />
====Редактирование переменной окружения '''PATH'''====<br />
=====в Windows XP=====<br />
1.Правой кнопкой мыши щелкните по значку "Мой компьютер" и выберите пункт меню "Свойства". <br />
2.Перейдите на вкладку "Дополнительно". <br />
3.Нажмите кнопку "Переменные среды".<br />
4.Выберите в списке переменную path, нажмите '''изменить''' и через точку с запятой добавьте путь к папке.<br />
<br />
=====в Windows 7=====<br />
1.Нажмите пуск.<br />
2.Нажмите правой кнопкой мыши по пункту '''Компьютер'''.Выберите пункт меню свойства.<br />
3.Нажмите на '''Дополнительные параметры системы''' (список слева).<br />
4.На вкладке '''Дополнительно''' нажмите кнопку '''Переменные среды'''.<br />
5.Выберите в списке переменную path, нажмите '''изменить''' и через точку с запятой добавьте путь к папке.<br />
<br />
====Hints and notes====<br />
* Чтобы сделать полноэкранный вид, не пытайтесь изменить позицию окна и его размер. Если попытаться это сделать, форма будет выглядеть как диалог с заголовком и кнопкой закрыть. В MCK установите '''defaultSize''' и '''defaultPosition''' of TKOLForm в True для достижения цели.<br />
<br />
====Известные проблемы====<br />
* Следующие компоненты не поддерживаются: RichEdit.<br />
* Прозрачность и двойная буферизация также не поддерживаются.<br />
* Работают значения свойства gradient panel styles только gsVertical и gsHorizontal.<br />
* Горизонтальное выравнивание текста не работет в однострочном компоненте edit. Используйте memo если вам оно нужно.<br />
* Vertical text alignment does not work for panel and label.<br />
<br />
== Документация ==<br />
* Посетите официальный сайт KOL&MCK для получения документации и информации: http://kolmck.ru<br />
* Прочитайте документацию MCK в файле '''KOLmirrorReadme.txt''', лежащем в папке MCK.<br />
<br />
== Приложения, использующие KOL-CE ==<br />
* [http://www.cp-lab.com/windows-mobile.html Password Manager XP Mobile]<br />
* [http://blog.carolos.za.net/2007/05/charmed-for-pocket-pc-beta-030.html ChARMeD disassembler]<br />
* [http://www.jongma.org/WMWifiRouter/ WMWifiRouter]<br />
<br />
== См. также ==<br />
* [http://f0460945.xsph.ru/rindex.htm Официальный вебсайт KOL&MCK]<br />
* Страничку KOL-CE на SourceForge http://sourceforge.net/projects/kol-ce/<br />
* [http://wiki.lazarus.freepascal.org/WinCE_port/ru Портирование на WinCE c помощью Free Pascal]<br />
* [[Windows CE Interface]]<br />
* [[Windows CE Development Notes]]<br />
<br />
== Contacts ==<br />
Report bugs, submit patches and ask questions at project's page at SourceForge: http://sourceforge.net/projects/kol-ce/<br />
<br />
<br />
{{AutoCategory}}<br />
[[Category:Components/ru]]<br />
[[Category:WinCE/ru]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=KOL-CE/ko&diff=144760KOL-CE/ko2021-04-29T16:27:56Z<p>Seenkao: </p>
<hr />
<div>{{KOL-CE}}<br />
==소개==<br />
KOL-CE는 Vladimir Kladov가 개발한 KOL&MCK의 프리 파스칼/라자루스 포트이다(http://f0460945.xsph.ru/rindex.htm). KOL-CE는 Yury Sidorov가 개발하였으며 다음 라이선스하에 배포된다[http://www.opensource.org/licenses/wxwindows.php wxWindows Library Licence].<br />
<br />
KOL-CE는 매우 컴팩트한 Win32/WinCE GUI 응용프로그램을 생성하게 해준다.(텅 빈 폼을 가진 프로젝트의 실행 파일을 ~40KB 실행파일이 되게 해준다.)<br />
<br />
MCK는 라자루스 IDE에서 KOL-CE 프로젝트를 VISUAL 개발 가능하게 해주는 라자루스 패키지이다.<br />
<br />
초기에 KOL-CE는 [[WinCE port|WinCE]]를 위한 KOL 포트로서만 계획되었다. 그러나 이것은 나중에 Win32 기능을 하고 FPC를 부드럽게 동작하도록 결정되었다.오리지널 KOL은 델파이를 위해 만들어 졌고 FPC와는 잘 동작하지 않았다. 오리지널 MCK는 라자루스와 함께 사용될 수 없었다.<br />
<br />
===요구사항===<br />
* 프리파스칼 컴파일러 2.2.0 또는 나중의 Win32용<br />
* arm-wince 크로스 컴파일러 2.2.0 또는 나중의 Win32용([[WinCE port|WinCE] 개발을 위해)<br />
* 라자루스 0.9.26 또는 나중의 Win32용<br />
<br />
=== 지원하는 타겟 ===<br />
* 모든 32-비트 윈도우즈: 윈도우즈 95에서 Vista까지<br />
* [[WinCE port|Windows CE]]기반 포켓 PC 및 스마트폰<br />
<br />
== 다운로드==<br />
최근의 KOL-CE 배포판을 다운로드한다[http://sourceforge.net/project/showfiles.php?group_id=188451 이곳]. <br />
<br />
또한 가장 최근의 KOL-CE소스를 svn에서 다음 링크를 통해 체크할 수 있다: https://kol-ce.svn.sourceforge.net/svnroot/kol-ce/trunk<br />
<br />
== 설치 ==<br />
----<br />
'''중요:''' KOL-CE 2.80.2 <tt>DisableFakeMethods</tt> 정의는 더이상 필요치 않기 때문에.<br />
<br />
만약 KOL-CE 2.80.1 또는 옛 버전을 사용한다면, MCK 패키지를 설치하기 전에 라자루스를 <tt>DisableFakeMethods</tt> 정의 '''없이''' 리빌드 해야한다. 그렇지 않으면 '''이벤트 핸들러는 동작하지 않을 것이다'''!<br />
<br />
다음과 같이 한다:<br />
# 라자루스 실행.<br />
# '''Tools > Configure "Build Lazarus"...'''메뉴 아이템 선택<br />
# '''Quick Build Options'''페이지 상에서 '''Clean Up + Build all''' 선택<br />
# '''Advanced Build Options'''페이지를 열고 '''Options'''입력 필드에서 <tt>-dDisableFakeMethods</tt>를 '''제거한다''' .<br />
# '''Build'''버튼을 클릭하여 라자루스를 다시 빌드한다.<br />
<br />
----<br />
[[Image:MirrorKOLPackage.png|right|MCK 패키지]]<br />
# KOL-CE 소스를 다운로드하고 파일 시스템상의 임의의 폴더에 저장한다.<br />
# 라자루스를 실행하고 '''Components > Load package file'''메뉴 아이템을 선택한다. 그리고 '''MCK'''폴더를 찾아서 <tt>'''MirrorKOLPackage.lpk'''</tt> 파일을 선택한다.<br />
# 패키지 윈도우가 나타날 것이다. '''Install'''버튼을 누른다.<br />
# 라자루스는 MCK패키지를 컴파일하고 IDE는 재시작 할 것이다.<br />
# 재시작 후 KOL 탭이 컴포넌트 팔레트에 보일 것이다.<br />
[[Image:KOLComponents.png||KOL 컴포넌트 팔레트]]<br />
<br />
주의: 만약 팔레트에 모든 KOL 컴포넌트가 보이지 않는다면, 컴포넌트 팔레트의 윈도우를 수직으로 크기 변경해본다. KOL 탬에 두번째 줄의 컴포넌트가 나타날 것이다.(위의 스크린 샷에 보듯이)<br />
<br />
MCK 패키지 업그레이드는 매우 쉽다. KOL-CE 소스의 새로운 버전을 겹쳐 쓰기만 하면 된다, MCK 패키지를 열고 '''Install'''버튼을 눌러 패키지를 재 컴파일 한다.<br />
<br />
== MCK 사용==<br />
=== MCK 프로젝트 생성===<br />
[[Image:MCKForm.png|right|MCK 폼]]<br />
# 라자루스를 시작하고 '''File > New...'''메뉴아이템을 선택한다.<br />
# '''KOL Application'''을 '''Project'''섹션에서 선택하고 '''OK'''버튼을 누른다.<br />
# KOL 응용프로그램을 위한 새로운 프로젝트가 만들어 질 것이다.<br />
# 이 프로젝트를 원하는 이름으로 저장한다.<br />
# 당신의 이 새로운 KOL/MCK 프로젝트를 실행한다(파라메터 조정, TKOL 제거... 컴포넡트, 컴파일, 실행, 디버그, 등등) 즐겁게!<br />
<br />
=== 폼 추가 ===<br />
# '''File > New...'''메뉴아이템 선택<br />
# '''File''' 섹션에 있는 '''KOL Form'''을 선택하고 '''OK'''버튼을 누른다.<br />
# 새로운 폼을 원하는 이름으로 저장한다.<br />
<br />
=== 코드 작성 ===<br />
<br />
RTL/FCL/LCL에 있는 이름을 사용하지 마라. 특히 SysUtils, Classes, Forms, 등등.<br />
필요한 모든 것은 KOL, Windows, Messages에서 찾아야 한다. 그리고 아마 스스로 작성해야 할 것이다.(또는 다른 소스에서 복사해오던지).<br />
미러 프로젝트에서 코드를 작성할 때 - 종종이벤트 핸들러에 놓을 수 있다.<br />
원하는 어떤 코드라도 더할 수도 있지만, 미러 LCL 폼 클래스 선언의 첫번째 섹션을 변경하는 것은 피하는 것이 좋다. 그리고 자동-생성된 inc-파일은 변경하지 않는 것이 좋다.<br />
항상 미러 프로젝트에서 작성한 당신의 그 코드는 LCL과 KOL 양쪽에서 모두 맏아들일 수 있어야 한다는 것을 명심하라.. LCL에 의해 - 미러 프로젝트를 컴파일 하는 단계에서 (그리고 이것은 꼭 필요한데 이는 그렇지 않으면 다른 미러 프로젝트를 KOL 프로젝트로 변환하는것이 불가능 하기 때문에). KOL에 의해 - KOL 네임스페이스에서 코드를 컴파일 하는 단계에서.<br />
<br />
=== 중요 ===<br />
KOL과 LCL에서 다르게 번역되는 <tt>LCL.Self</tt> 와<tt>KOL.@Self</tt> 단어간의 충돌 문제를 해결하기 위해, 특별한 필드가 소개 되었다. <tt>Form</tt>.<br />
LCL에서, <tt>TKOLForm</tt>컴포턴트의 <tt>Form</tt> 프로퍼티는 <tt>Self</tt>를 "returns"한다. 즉, 자체의 폼 객체. <br />
그리고 KOL에서 <tt>Form: PControl</tt>는 결과적으로 폼 객체를 포함하는 오브젝트의 필드이다. 이렇기 때문에 다음과 같은 방법으로폼의 프로퍼티를 정확히 변경할 수 있다:<br />
Form.Caption := 'Hello!'; <br />
비록 이전의 Caption := 'Hello!'; 오퍼레이터 형식이, 미러 프로젝트를 KOL로 변환하는 동안 정상적으로 컴파일 하더라도, KOL 환경하에서는 틀린 방법이 될 것이다).<br />
그러나 상기에서 언급한 <tt>Form</tt>이 폼의 프로퍼티에 - 챠일드 컨트롤이 아니다- 접근할 수 있는 유일한 길이다. 차일드 컨트롤과 일반적인 방법으로 폼 이벤트 핸들러에 접근할 수 있다.<br />
예:<br />
Button1.Caption := 'OK';<br />
Button1Click(Form);<br />
<br />
=== 런타임 폼 생성 ===<br />
<br />
실행시에 동일한 폼의 몇몇 인스턴스를 생성할 수 있다. 그리고 최소한, 폼을 AutoCreate가 아니게 만들 수 있으며, 필요할 때 프로그래밍으로 만들 수 있다. 글로벌 함수 <tt>NewForm1</tt> (미러 폼 이름과 함께 Form1 를 대치) 를 사용하라, 예를 들어:<br />
NewForm1( TempForm1, Applet );<br />
이것을 가능하게 하기 위해, 대화를 통해 유니트에서 생성된 글로벌 변수에 접근하려 하지 마라, 그렇게 하는 이유를 알지 못한다면. 대신 폼 변수를 참조하라.<br />
<br />
== WinCE ==<br />
====설정====<br />
[[Image:arm-wince-target.png|right|arm-wince 타겟]]<br />
WinCE 실행파일을 컴파일 하기 위해 Win32용 arm-wince 크로스 컴파일러를 설치해야 한다.<br />
구하라. [http://www.freepascal.org/download.var 이곳].<br />
<br />
arm-wince 타겟으로 컴파일하기 위해 '''Project > Compiler options...''' 메뉴 아이템에서 프로젝트의 컴파일러 옵션을 연다. '''Code''' 탭을 열고 타겟 플랫폼을 arm-wince로 변경한다.<br />
<br />
'''주의:''' KOL-CE 프로젝트를 WinCE용으로 컴파일 하면 다음의 에러를 받을 수 있다:<br />
Compiling resource KOL-CE.rc<br />
arm-wince-windres.exe: no resources<br />
KOL.PAS(57901) Error: Error while linking<br />
KOL.PAS(57901) Fatal: There were 1 errors compiling module, stopping<br />
<br />
이런 경우 윈도우즈의 '''PATH''' 환경변수를 편집해야 하며, win32 fpc 바이너리가 위치한 폴더를 패스에 추가한다.<br><br />
어떤 경로거 추가되었는지 확인하기 위해서는 라자루스의 '''Environment options'''으로 가서 컴파일러 경로를 보라<br><br />
'''Quit Lazarus before editing PATH'''.<br><br />
'''PATH''' 변수를 편집하기 위해서는 '''내 컴퓨터''' 아이콘을 클릭하고 '''고급''' 탭으로 가서 '''환경 변수''' 버튼을 클릭한다.<br />
<br />
=== 힌트와 주의===<br />
* 대부분의 포켓 PC 프로그램이 그렇듯이 폼을 풀스크린으로 만들기 위해서는 폼의 위치와 크기를 변경할 필요가 없다. 만약 폼 크기나 위치가 변한면 폼은 켭션이 있는 다이얼로그와 닫기 버튼과 같이 보일 것이다. MCK에서 TKOLForm의 '''defaultSize'''와 '''defaultPosition'''을 True로 설정하여 폼을 풀 스크린으로 만든다.<br />
<br />
==== 알려진 사항들====<br />
* 다음 컴포넌트는 지원하지 않는다: RichEdit<br />
* 투명과 더블 버퍼링은 지원하지 않는다.<br />
* gsVertical, gsHorizontal 그래디언트 패널 스타일만 지원된다.<br />
* 수평 문자 정렬은 한줄 편집 컨트롤에서는 동작하지 않는다. 텍스트 정렬이 필요하면 메모를 사용하라.<br />
* 수직 텍스트 정렬은 패널과 레이블에서는 동작하지 않는다.<br />
<br />
== 문서==<br />
* 문서와 정보를 위해서는 공식 KOL&MCK 웹사이트를 방문하라: http://kolmck.ru<br />
* MCK 폴더 내에 있는 '''KOLmirrorReadme.txt''' 파일내의 MCK 문서를 읽어라<br />
<br />
== 실제 프로그램에서의 KOL-CE ==<br />
* [http://www.cp-lab.com/windows-mobile.html 패스워드 매니저 XP 모바일]<br />
* [http://blog.carolos.za.net/2007/05/charmed-for-pocket-pc-beta-030.html ChARMeD 디스어셈블러]<br />
* [http://www.jongma.org/WMWifiRouter/ WMWifiRouter]<br />
<br />
== 더 볼 것 ==<br />
* [http://f0460945.xsph.ru/rindex.htm 공식 KOL&MCK 웹 사이트]<br />
* 소스포지의 KOL-CE 페이지 http://sourceforge.net/projects/kol-ce/<br />
* [[WinCE port|프리 파스칼의 WinCE 포트]]<br />
* [[Windows CE Interface/ko|Windows CE 인터페이스]]<br />
* [[Windows CE Development Notes]]<br />
<br />
== 연락==<br />
버그를 보고하고, 패치를 제출하고 질문하는 것은 소스포지의 프로젝트 페이지에서 한다: http://sourceforge.net/projects/kol-ce/</div>Seenkaohttps://wiki.freepascal.org/index.php?title=KOL-CE/fr&diff=144759KOL-CE/fr2021-04-29T16:26:17Z<p>Seenkao: </p>
<hr />
<div>{{KOL-CE}}<br />
==Introduction==<br />
KOL-CE est le portage pour Free Pascal/Lazarus de KOL&MCK développé par [http://f0460945.xsph.ru/rindex.htm Vladimir Kladov]. KOL-CE est développé par Yury Sidorov et est distribué sous licence [http://www.opensource.org/licenses/wxwindows.php wxWindows Library Licence].<br />
<br />
KOL-CE permet de créer des applications Win32/WinCE très compactes (à partir de ~40Koctets pour un projet avec une fiche vide).<br />
<br />
MCK est un paquet Lazarus permettant le développement VISUEL de projet KOL-CE avec l'IDE Lazarus.<br />
<br />
Initialement, KOL-CE était planifié pour être seulement une portage de KOL pour [[WinCE port|WinCE]]. Mais, ultérieurement, il a été décidé de conserver les fonctionnalités Win32 et de le faire fonctionner avec FPC sans problème. La version original de KOL est prévue pour Delphi et ne fonctionne pas correctement avec FPC. La version originale de MCK ne peut pas être utilisée avec Lazarus.<br />
<br />
=== Configuration nécessaire ===<br />
* Free Pascal compiler 2.2.0 ou ultérieur pour Win32.<br />
* arm-wince cross compiler 2.2.0 ou ultérieur pour Win32 (pour développement [[WinCE port|WinCE]).<br />
* Lazarus 0.9.23 ou ultérieur pour Win32.<br />
<br />
=== Cibles supportées ===<br />
* Toutes versions 32bits de Windows: de Windows 95 à Vista.<br />
* Pocket PC et smartphones basés sur [[WinCE port|Windows CE]].<br />
<br />
== Téléchargement ==<br />
Télécharger la dernière version de KOL-CE [http://sourceforge.net/project/showfiles.php?group_id=188451 ici].<br />
<br />
Vous pouvez aussi obtenir les sources de KOL-CE les plus récentes via svn en utilisant ce lien : https://kol-ce.svn.sourceforge.net/svnroot/kol-ce/trunk<br />
<br />
== Installation ==<br />
----<br />
Si vous utilisez Lazarus 0.9.25 ou une version ultérieure, vous devez reconstruire Lazarus avec l'option <tt>'''DisableFakeMethods'''</tt> avant l'installation du paquet MCK.<br />
<br />
Pour cela :<br />
# Lancer Lazarus.<br />
# Choisir le menu '''Outils > Configurer "Build Lazarus"...''' menu item.<br />
# Choisir '''Clean Up + Build all''' dans l'onglet '''Options de construction rapide'''.<br />
# Ouvrir l'onglet '''Options de construction avancées''' et ajouter <tt>'''-dDisableFakeMethods'''</tt> dans le champ '''Options'''.<br />
# Cliquer sur le bouton '''Construire''' pour reconstruire Lazarus.<br />
----<br />
[[Image:MirrorKOLPackage.png|right|MCK package]]<br />
# Télécharger les sources de KOL-CE et placer les dans un répertoire de votre système de fichiers.<br />
# Lancer Lazarus et choisir le menu '''Composants > Ouvrir un fichier paquet (.lpk)'''. Se placer dans le dossier '''MCK''' et choisir le fichier <tt>'''MirrorKOLPackage.lpk'''</tt>.<br />
# La fen^tre de gestion des paquet s'ouvre. Cliquer sur le bouton '''Installer'''.<br />
# Lazarus compile alors le paquet MCK et l'IDE sera redémarrée.<br />
# Après le redémarrage, un onglet KOL apparaît dans la palette de composants.<br />
[[Image:KOLComponents.png||KOL components palette]]<br />
<br />
NOTE: Si vous n'arrivez pas à voir tous les composants KOL sur la palette, ajuster verticalement la taille de la palette de composants. Vous verrez alors la seconde ligne des composants de l'onglet KOL (comme sur la copie d'écran ci-dessus).<br />
<br />
La mise à jour du paquet MCK est aussi simple que cela. Il suffit juste d'écraser les sources KOL-CE avec la nouvelle version, d'ouvrir le paquet MCK et de cliquer sur '''Install''' pour recompiler le paquet.<br />
<br />
== Utilisation de MCK ==<br />
=== Création d'un projet MCK ===<br />
[[Image:MCKForm.png|right|MCK form]]<br />
# Lancer Lazarus et créer une nouvelle application en utilisant le menu '''Fichier > Nouveau...'''.<br />
# NE PAs placer de composant dans la fiche à ce niveau. Choisir '''Fichier > Tout enregistrer''' et sélectionner le dossier de destination pour votre projet. Noter que TOUS LES FICHIERS de votre projet DEVRONT TOUJOURS ETRE PLACES DANS LE MEME DOSSIER! Vous pouvez changer le nom de l'unité de la fiche, mais pas celui du projet. Laisser le nom du projet par défaut <tt>project1.lpi</tt><br />
# Placer le composant <tt>'''TKOLProject'''</tt> dans la fiche.<br />
# Donner un nom au projet MCK résultant en modifiant la propriété <tt>'''ProjectDest'''</tt> (le chemin NE DOIT PAS être inclus). Si vous saisissez <tt>MyKOLProg</tt>, par exemple, alors le projet MCK résultant sera nommé <tt>MyKOLProg.lpi</tt>. Le nom du fichier EXE sera (comme vous l'avez déjà deviné) <tt>MyKOLProg.exe</tt>.<br>[[Image:KOLProjectDest.png||ProjectDest property]]<br />
# Placer le composant <tt>'''TKOLForm'''</tt> dans la fiche.<br />
# Enregistrer le projet courant.<br />
# Ouvrir le projet résultant que vous avez spécifié dans la propriété <tt>'''ProjectDest'''</tt> (<tt>MyKOLProg.lpi</tt> dans notre exemple, il doit se trouver dans le même dossier). Après cela, vous povez détruire tous les fichiers <tt>project1.*</tt> - ces fichiers n'étant plus nécessaires.<br />
# Amusez vous avec votre nouveau projet KOL/MCK (ajuster les paramètres, placer des composants TKOL..., comiler, exécuter, débugguer, etc.)<br />
<br />
=== Ajout d'une fiche ===<br />
# Sélectionner le menu '''Fichier > Nouvelle fiche''' .<br />
# Enregistrer la fiche dans le MEME DOSSIER que votre projet.<br />
# Placer l'objet <tt>'''TKOLForm'''</tt> dans cette fiche.<br />
# Vérifier que vous avez bien placé le composant <tt>'''TKOLApplet'''</tt> dans la fiche principale.<br />
# Si <tt>AutoBuild</tt> est sur off: sélectionner le composant <tt>'''TKOLProject'''</tt> dans la fiche principale et double cliquer sur sa propriété <tt>'''Build'''</tt>. (Sinon, tout devrait déjà être fait, n'est ce pas?).<br />
<br />
=== Ecriture d'un code ===<br />
Ne pas utiliser d'unité des bibliothèques RTL/FCL/LCL, et plus particulièrement des unités SysUtils, Classes, Forms, etc. Tout ce que vous avez besoin, vous devriez le trouver dans les unités KOL, Windows, Messages units. Et peut être, vous pouvez écrire du code vous même (ou le copier à partir d'autres sources).<br />
Quand vous écrivez du code dans le projet miroir - on le place habituellement dans le gestionnaire d'évènements.<br />
Vous pouvez aussi ajouter du code où vous le souhaitez mais éviter de modifier la première section de la déclaration de classe de votre fiche LCL miroir. Et ne pas modifier les fichiers INC générés automatiquement.<br />
Toujours garder à l'esprit, que le code, que vous écrivez dans le projet miroir, doit être accepté aussi bien par LCL que par KOL. Par LCL - au niveau de la compilation du projet miroir (et ceci est nécessaire, parce qu'autrement la conversion du projet miroir en un projet KOL ne sera pas possible). Et par KOL - au niveau de la compilation du code écrit dans l'espace des noms de KOL.<br />
<br />
=== IMPORTANT ===<br />
Afin de résoudre les conflits entre les mots <tt>LCL.Self</tt> et <tt>KOL.@Self</tt>, qui sont interprétés différemment dans KOL et LCL, des champs spéciaux sont introduits - <tt>Form</tt>. Dans LCL, la propriété <tt>Form</tt> du composant <tt>TKOLForm</tt> "retournent" <tt>Self</tt>, i.e. l'objet fich lui-même. Et dans KOL, <tt>Form: PControl</tt> est un champ de l'objet, contenant l'objet fiche résultant. Avec cela, il est correct de modifier les propriétés de la fiche de la manière suivante : <br />
Form.Caption := 'Hello!'; <br />
(Bien que l'ancien opérateur Caption := 'Hello!'; est compilé normalement lors de la conversion du projet miroir en KOL, il est incorrect dans l'environnement KOL).<br />
Mais la discussion ci dessus <tt>Form</tt> est seulement destinée à l'accès des propriétés de la fiche - pas à ceux des contrôles enfants. Vous accéderez au contrôle des enfants et au gestionnaire d'évènements des fiches par la voie habituelle. e.g. :<br />
Button1.Caption := 'OK';<br />
Button1Click(Form);<br />
<br />
=== Création de fiches au moment de l'exécution (Run-time) ===<br />
Il est possible de créer plusieurs instances de la même fiche au moment de l'exécution. Et au moins, il est possible de faire une fiche non auto-créee, et de la créer par programmation quand cela est nécessaire. Utiliser pour cela la fonction globale <tt>NewForm1</tt> (remplacer Form1 par le nom de votre fiche miroir), par exemple:<br />
TempForm1 := NewForm1( Applet );<br />
Pour que cela soit possible, NE JAMAIS accéder à des variables globales créées dans l'unité durant la conversation, sauf si vous savez ce que vous faites. Utiliser plutôt des variables liées à la fiche.<br />
<br />
== WinCE ==<br />
====Setup====<br />
[[Image:arm-wince-target.png|right|arm-wince target]]<br />
Vous devez installer le compilateur arm-wince cross pour Win32 pour pouvoir compiler des exécutables WinCE. On peut l'obtenir [http://www.freepascal.org/download.var ici].<br />
<br />
Pour compiler vers une cible arm-wince, ouvrir les options du compilateur de votre projet en utilisant le menu '''Projet > Options du compilateur...'''. Ouvrir l'onglet '''Code''' et modifier les propriétés Plateformes cibles en arm-wince.<br />
<br />
'''NOTE:''' Vous pouvez recevoir un message d'erreur lors de la compilation d'un projet KOL-CE pour WinCE :<br />
Compiling resource KOL-CE.rc<br />
arm-wince-windres.exe: no resources<br />
KOL.PAS(57901) Error: Error while linking<br />
KOL.PAS(57901) Fatal: There were 1 errors compiling module, stopping<br />
<br />
Dans ce cas, vous devez éditer la variable d'environnement Windows '''PATH''' et ajouter le chemin pointant vers les sources binaires de fpc pour win32.<br><br />
Pour localiser ce chemin, aller dans le menu '''Configuration > Options d'environnement''' dans Lazarus et noter le chemin du compilateur.<br><br />
'''Quitter Lazarus avant d'éditer la variable PATH'''.<br><br />
Pour éditer cette variable '''PATH''', cliquer avec le bouton droit sur l'icone '''Poste de travail'''. choisir le menu Propriétés et dans l'onglet '''Avancé''' cliquer sur le bouton '''Variables d'environnement'''.<br />
<br />
====Trucs et notes====<br />
* Pour obtenir des applications plein écran sur la plupart des Pocket PC, il ne faut pas modifier la position et la taille de la fiche. En cas de modification, la fiche apparaîtrait comme une fiche dialogue avec un titre et un bouton de fermeture. dans MCK placer les propriétés '''defaultSize''' et '''defaultPosition''' de TKOLForm à True pour obtenir une application plein écran.<br />
<br />
====Problèmes connus====<br />
* Les composants suivants ne sont pas supportés : RichEdit, TrayIcon.<br />
* Seuls les styles de gradient gsVertical et gsHorizontal sont supportés.<br />
* L'alignement des textes ne fonctionne pas avec le contrôle d'édition de ligne simple. Utiliser un composant memo si vous avez besoin d'aligner le texte.<br />
<br />
== Documentation ==<br />
* Visiter le site WEB officiel de KOL&MCK pour obtenir documentations et informations : http://kolmck.ru<br />
* La documentation MCK se situe dans le fichier '''KOLmirrorReadme.txt''' dans le dossier MCK.<br />
<br />
== KOL-CE dans des applications==<br />
* [http://www.cp-lab.com/windows-mobile.html Password Manager XP Mobile]<br />
* [http://blog.carolos.za.net/2007/05/charmed-for-pocket-pc-beta-030.html ChARMeD disassembler]<br />
* [http://www.jongma.org/WMWifiRouter/ WMWifiRouter]<br />
<br />
== Voir aussi ==<br />
* [http://f0460945.xsph.ru/rindex.htm Le site officiel KOL&MCK]<br />
* La page KOL-CE sur SourceForge http://sourceforge.net/projects/kol-ce/<br />
* [[WinCE port|WinCE port of Free Pascal]]<br />
* [[Windows CE Interface]]<br />
* [[Windows CE Development Notes]]<br />
<br />
== Contacts ==<br />
Reporter des bugs, soumettre des patches et poser des questions sur la page du projet sur SourceForge: http://sourceforge.net/projects/kol-ce/</div>Seenkaohttps://wiki.freepascal.org/index.php?title=KOL-CE&diff=144758KOL-CE2021-04-29T16:24:24Z<p>Seenkao: </p>
<hr />
<div>{{KOL-CE}}<br />
<br />
==Introduction==<br />
<br />
KOL-CE is Free Pascal/Lazarus port of KOL&MCK devloped by Vladimir Kladov ([http://f0460945.xsph.ru/rindex.htm website]). KOL-CE is developed by Yury Sidorov and distributed under [http://www.opensource.org/licenses/wxwindows.php wxWindows Library Licence].<br />
<br />
KOL-CE allows to create very compact Win32/WinCE GUI applications (starting from ~40KB executable for project with empty form).<br />
<br />
MCK is Lazarus package wich allows VISUAL development of KOL-CE projects in Lazarus IDE.<br />
<br />
Initially KOL-CE was planned as KOL port for [[WinCE port|WinCE]] only. But later it was decided to keep Win32 functionality and made it work with FPC smoothly. The original MCK can not be used with Lazarus at all.<br />
The more current versions of [[KOL]] also work very well with FPC and targets both 32 and 64 bit applications, but do not include an MCK for Lazarus yet: you can use MCK from KOL-CE and recompile against the newer kol.pas version with some thought, but requires patching some of the Lazarus MCK generated sourcecode to reflect kol's current status.<br />
<br />
=== Requirements ===<br />
<br />
* Free Pascal compiler 2.2.0 or later for Win32.<br />
* arm-wince cross compiler 2.2.0 or later for Win32 (for [[WinCE port|WinCE]] development).<br />
* Lazarus 0.9.26 or later for Win32.<br />
<br />
=== Supported targets ===<br />
<br />
* All 32-bit Windows: from Windows 95 to Windows 8.1.<br />
* [[WinCE port|Windows CE]] based PocketPC and Smartphones.<br />
<br />
== Download ==<br />
<br />
Download the latest release of KOL-CE [http://sourceforge.net/project/showfiles.php?group_id=188451 here].<br />
<br />
Also you can check out the freshest KOL-CE sources from svn using this link: https://kol-ce.svn.sourceforge.net/svnroot/kol-ce/trunk<br />
<br />
== Installation ==<br />
<br />
----<br />
'''Important:''' Since KOL-CE 2.80.2 <tt>DisableFakeMethods</tt> define is not needed anymore.<br />
<br />
If you previously used KOL-CE 2.80.1 or older, you need to rebuild Lazarus '''without''' <tt>DisableFakeMethods</tt> define before installing MCK package. Otherwise '''event handlers will not work'''!<br />
<br />
To do that:<br />
# Run Lazarus.<br />
# Choose '''Tools > Configure "Build Lazarus"...''' menu item.<br />
# Choose '''Clean Up + Build all''' on '''Quick Build Options''' page.<br />
# Open '''Advanced Build Options''' page and '''remove''' <tt>-dDisableFakeMethods</tt> from '''Options''' input field.<br />
# Click '''Build''' button to rebuild Lazarus.<br />
----<br />
[[Image:MirrorKOLPackage.png|right|MCK package]]<br />
# Download KOL-CE sources and put them on some folder on your filesystem.<br />
# Run Lazarus and choose '''Components > Load package file''' menu item. Then navigate to '''MCK''' folder and choose <tt>'''MirrorKOLPackage.lpk'''</tt> file.<br />
# Package window will appear. Press '''Install''' button.<br />
# Lazarus will compile MCK package and IDE will be restarted.<br />
# After restart KOL tab will appear on components palette.<br />
[[Image:KOLComponents.png||KOL components palette]]<br />
<br />
NOTE: If you can't see all KOL components on the palette, resize window with components palette vertically. You will see the second row of components on KOL tab (as on screenshot above).<br />
<br />
MCK package upgrade is very simple as well. Just overwrite KOL-CE sources with new version, open MCK package and press '''Install''' button to recompile the package.<br />
<br />
== Using MCK ==<br />
<br />
=== Creating MCK project ===<br />
<br />
[[Image:MCKForm.png|right|MCK form]]<br />
# Start Lazarus and select '''File > New...''' menu item.<br />
# Choose '''KOL Application''' under '''Project''' section and press '''OK''' button.<br />
# New project for KOL application will be created.<br />
# Save this project with desired name.<br />
# Play with your new KOL/MCK Project (adjust parameters, drop TKOL... components, compile, run, debug, etc.) Enjoy!<br />
<br />
=== Adding a form ===<br />
<br />
# Select '''File > New...''' menu item.<br />
# Choose '''KOL Form''' under '''File''' section and press '''OK''' button.<br />
# Save new form with desired name.<br />
<br />
=== Writing code ===<br />
<br />
Do not use names from RTL/FCL/LCL, especially from SysUtils, Classes, Forms, etc. All what you need, you should find in KOL, Windows, Messages units. And may be, write by yourself (or copy from another sources).<br />
When you write code in mirror project - usually place it in event handlers.<br />
You also can add any code where you wish but avoid changing first section of your mirror LCL form class declaration. And do not change auto-generated inc-files.<br />
Always remember, that code, that you write in mirror project, must be accepted both by LCL and KOL. By LCL - at the stage of compiling mirror project (and this is necessary, because otherwise converting mirror project to reflected KOL project will not be possible). And by KOL - at the stage of compiling written code in KOL namespace.<br />
<br />
=== IMPORTANT ===<br />
<br />
To resolve conflict between words <tt>LCL.Self</tt> and <tt>KOL.@Self</tt>, which are interpreted differently in KOL and LCL, special field is introduced - <tt>Form</tt>. In LCL, <tt>Form</tt> property of <tt>TKOLForm</tt> component "returns" <tt>Self</tt>, i.e. form object itself. And in KOL, <tt>Form: PControl</tt> is a field of object, containing resulting form object. Since this, it is correctly to change form's properties in following way: <br />
Form.Caption := 'Hello!'; <br />
(Though old-style operator Caption := 'Hello!'; is compiled normally while converting mirror project to KOL, it will be wrong in KOL environment).<br />
But discussed above word <tt>Form</tt> is only to access form's properties - not its child controls. You access child controls and form event handlers by usual way. e.g.: <br />
Button1.Caption := 'OK';<br />
Button1Click(Form);<br />
<br />
=== Run-time form creation ===<br />
<br />
It is possible to create several instances of the same form at run-time. And at least, it is possible to make form not AutoCreate, and create it programmatically when needed. Use global function <tt>NewForm1</tt> (replacing Form1 with your mirror form name), for instance:<br />
NewForm1( TempForm1, Applet );<br />
To make this possible, NEVER access global variable created in the unit during conversation, unless You know why You are doing so. Refer to Form variable instead.<br />
<br />
== WinCE ==<br />
<br />
====Setup====<br />
<br />
[[Image:arm-wince-target.png|right|arm-wince target]]<br />
You need to install arm-wince cross compiler for Win32 to compile WinCE executables. Get it [http://www.freepascal.org/download.var here].<br />
<br />
To compile for arm-wince target open compiler options of your project using '''Project > Compiler options...''' menu item. Open '''Code''' tab and change target platform to arm-wince.<br />
<br />
'''NOTE:''' You can receive the following error while compiling your KOL-CE project for WinCE:<br />
Compiling resource KOL-CE.rc<br />
arm-wince-windres.exe: no resources<br />
KOL.PAS(57901) Error: Error while linking<br />
KOL.PAS(57901) Fatal: There were 1 errors compiling module, stopping<br />
<br />
In such case you need to edit Windows '''PATH''' environment variable and add path to folder where win32 fpc binaries are located.<br><br />
To find out which path to add, go to '''Environment options''' in Lazarus and see compiler path.<br><br />
'''Quit Lazarus before editing PATH'''.<br><br />
To edit '''PATH''' variable right click on '''My Computer''' icon go to '''Advanced''' tab and click '''Environment Variables''' button.<br />
<br />
====Hints and notes====<br />
<br />
* To make form fullscreen as most Pocket PC applications have, don't change the form position and size. If form size and/or position was changed the form will look like dialog with caption and close button. In MCK set '''defaultSize''' and '''defaultPosition''' of TKOLForm to True to make form fullscreen.<br />
<br />
====Known issues====<br />
<br />
* The following components are not supported: RichEdit.<br />
* Transparency and double buffering are not supported.<br />
* Only gsVertical, gsHorizontal gradient panel styles are supported.<br />
* Horizontal text alignment does not work in single line edit control. Use memo if you need text alignment.<br />
* Vertical text alignment does not work for panel and label.<br />
<br />
== Documentation ==<br />
<br />
* Visit official KOL&MCK website for documentation and information: http://kolmck.ru<br />
* Read MCK documentation in '''KOLmirrorReadme.txt''' file inside MCK folder.<br />
<br />
== KOL-CE in real-world applications ==<br />
<br />
* [http://www.cp-lab.com/windows-mobile.html Password Manager XP Mobile]<br />
* [http://blog.carolos.za.net/2007/05/charmed-for-pocket-pc-beta-030.html ChARMeD disassembler]<br />
* [http://www.jongma.org/WMWifiRouter/ WMWifiRouter]<br />
<br />
== See also ==<br />
<br />
* [[KOL| The wiki page for KOL]]<br />
* [http://f0460945.xsph.ru/rindex.htm Official KOL&MCK website]<br />
* KOL-CE page at SourceForge http://sourceforge.net/projects/kol-ce/<br />
* [[WinCE port|WinCE port of Free Pascal]]<br />
* [[Windows CE Interface]]<br />
* [[Windows CE Development Notes]]<br />
<br />
== Contacts ==<br />
<br />
Report bugs, submit patches and ask questions at project's page at SourceForge: http://sourceforge.net/projects/kol-ce/</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL&diff=144748ZenGL2021-04-27T23:30:20Z<p>Seenkao: </p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index}}<br />
<br />
== Main ==<br />
<br />
'''ZenGL''' - a cross-platform game development library, designed to provide necessary functionality for rendering 2D graphics, handling input, sound output, etc.<br />
<br />
*'''Supported OS''': GNU/Linux, Windows, macOS, iOS, Android 2.1+<br />
<br />
*'''Supported compilers''': [[Free Pascal]], [[Delphi]]<br />
<br />
*'''Graphics API''': [[OpenGL]], OpenGL ES 1.x, Direct3D 8/9<br />
<br />
*'''Sound API''': OpenAL, DirectSound<br />
<br />
*'''License''': [http://zengl.org/license.html ZenGL]<br />
<br />
The library is currently being finalized.<br />
<br />
== Links ==<br />
<br />
*[http://zengl.org/download.html Download ZenGL]<br><br />
*[https://github.com/andru-kun/zengl ZenGL Mirror on GitHub]<br />
*[http://zengl.org/extra.html Extra Downloads]<br />
*[http://zengl.org/ Homepage]<br><br />
*[http://zengl.org/wiki Wiki]<br><br />
*[http://zengl.org/forum Official forum]<br><br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/thecocce/steamwrapper ZenGL on Steam]<br />
---<br />
*[https://github.com/Seenkao/New-ZenGL A new version]<br />
<br />
== Tutorial ==<br />
<br />
'''Attention!''' All examples are contained in the downloaded version of the library. At this time, this is relevant for all versions of ZenGL.<br />
These tutorials are not fully compatible with the latest version of ZenGL.<br />
<br />
[[ZenGL Tutorial]]: This is a first tutorial for ZenGL: download, installation, source paths, compilation (statically or with so/dll/dylib) (Windows dll), and the First program 'Initialization' that comes with ZenGL.<br />
<br />
[[ZenGL Tutorial 2]]: This is the second tutorial on how to create a font and draw text in the window.<br />
<br />
== Features ==<br />
<br />
* '''Main'''<br />
o can be used as so/dll/dylib or statically compiled with your application <br />
o rendering to own or any other prepared window<br />
o logging<br />
o resource loading from files, memory and '''zip''' archives<br />
o multithreaded resource loading<br />
o easy way to add support for new resource format<br />
* '''Configuration of'''<br />
o antialiasing, screen resolution, refresh rate and vertical synchronization<br />
o aspect correction<br />
o title, position and size of window<br />
o cursor visibility in window space<br />
* '''Input'''<br />
o handling of keyboard, mouse and joystick input<br />
o handling of Unicode text input<br />
o possibility to restrict the input to the Latin alphabet<br />
* '''Textures'''<br />
o supports '''tga''', '''png''', '''jpg''' and '''pvr'''<br />
o correct work with NPOT textures<br />
o control the filter parameters<br />
o masking<br />
o ''render targets'' for rendering into texture<br />
* '''Text'''<br />
o textured Unicode font<br />
o rendering UTF-8 text<br />
o rendering text with alignment and other options like size, color and count of symbols<br />
* '''2D subsystem'''<br />
o ''batch render'' for high-speed rendering<br />
o rendering different primitives<br />
o sprite engine<br />
o rendering static and animated sprites and tiles<br />
o rendering distortion grid<br />
o rendering sprites with new texture coordinates (with the pixel dimension and the usual 0..1)<br />
o control the blend mode and color mix mode<br />
o control the color and alpha of vertices of sprites and primitives<br />
o additional sprite transformations (flipping, zooming, vertices offset)<br />
o fast clipping of invisible sprites<br />
o 2D camera with ability to zoom and rotate the scene<br />
* '''Sound'''<br />
o works through OpenAL or DirectSound; depends on configuration or OS<br />
o correct work without soundcard<br />
o supports '''wav''' and '''ogg''' as sound sample formats<br />
o playing audio files in separate thread<br />
o control volume and playback speed<br />
o moving sound sources in 3D space<br />
* '''Video'''<br />
o decoding video frames into texture<br />
o supports '''theora''' codec in '''ogv''' container<br />
* '''Math'''<br />
o basic set of additional math functions<br />
o triangulation functions<br />
o basic set of collision functions<br />
* '''Additional'''<br />
o reading and writing INI files<br />
o functions for working with files and memory<br />
<br />
== In the updated version ==<br />
<br />
'''Attention!''' Basic information in Russian! Thank you for understanding.<br />
* Corrected compilation for android for FPC 3.2.0 and higher.<br />
* Moved the main code to correct the library<br />
* Edited work with Windows 64<br />
* Fixed minor bugs<br />
* Edited some demo versions (for FPC and iOS demos were not corrected, demo versions for Lazarus and Delphi were revised)<br />
* Introduced defines<br />
** define USE_EXIT_ESCAPE - exit. Ability not to write additional code to exit the program by pressing the Escape key<br />
** USE_INIT_HANDLE definition - for using ZenGL in an already created window (LCL/VCL)<br />
* Introduced support for MacOS Cocoa<br />
<br />
[[Category:Components]]<br />
[[Category:Graphics]]<br />
[[Category:Audio]]<br />
[[Category:Multimedia]]<br />
[[Category:Video]]<br />
[[Category:Game Development]]<br />
[[Category:Games]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=KOL&diff=144747KOL2021-04-27T23:21:11Z<p>Seenkao: </p>
<hr />
<div><br />
==Introduction== <br />
[[File:kolmck.png]]<br><br />
<br><br />
The Key Objects Library - a.k.a. KOL - is an object oriented framework created by Vladimir Kladov ([http://f0460945.xsph.ru/rindex.htm website]) in 2000.<br><br />
It is the successor to the XCL library by the same author.<br><br />
The Mirror Classes Kit - a.k.a. MCK - is a set of visual components to write KOL applications in a visual design way -from within the Delphi IDE.<br><br />
The current point release is 3.23 for KOL and 3.23 for MCK.<br><br />
New versions appear with Irregular intervals, but the library is currently maintained.<br><br />
There is an svn repository for KOL and MCK at https://svn.code.sf.net/p/kolmck/code/ which is usually more up to date than the point releases.<br />
<br><br><br />
The main reason creating this library is explained through the dissatisfaction of Vladimir and others towards ever increasing codebloat.<br><br />
Nobody seemed to care anymore about *efficient* coding.<br><br />
According to KOL users there a strong correlation between Moore's law and degrading code optimizing efficiency.<br><br><br />
An MCK project designed in a Delphi IDE can be recompiled with both 32 bit and 64 bit FPC 2.7.1 or later compilers without change.<br><br />
This way you can without having to upgrade your Delphi to a recent version:<br><br />
* obtain a 64 bit version of a project.<br><br />
* obtain a unicode version of a Delphi project (5-2007) by simply defining -dUNICODE_CTRLS.<br><br />
* or both!<br><br><br />
<br> <br />
The framework centers around three basic concepts:<br><br />
* It uses - some say old school - pascal objects, not classes.<br><br />
* Most of the widgets are basically one and the same object. Polymorphism is through constructing functions.<br><br />
* It ignores the VCL/LCL, in fact it attempts to replace them.<br />
<br />
This has several '''advantages''', some of which are: <br><br />
* The size of your binary is very tiny, on average more than 20 times smaller than a VCL/LCL binary, but a factor 100 or more is not unusual.<br />
* KOL binaries (both executables and dll's) have much much faster load times and feel snappier.<br />
* KOL is very easy to extend once you understand its concepts. It is a fully object oriented framework<br />
<br />
It also has very obvious '''disadvantages''', some of which are:<br />
* KOL is a framework. It doesn't mix very well with classes and it can't be sensibly mixed with LCL/VCL code because you will loose the size advantage.<br />
* If you are not familiar with the old Object Pascal paradigm from Turbo Pascal the learning curve can be steep.<br />
* You will miss some functionality that has become common place, like RTTI, but most of these features are often codebloat and the reason why KOL exists in the first place. <br />
* Because you are often working on the same object with multiple appearances, it may be confusing that some methods or properties that you can see in the code editor do not apply.<br />
<br />
=== Requirements ===<br />
* Free Pascal compiler 2.6.4 or later for Win32<br />
* Free Pascal compiler 2.7.1 or later for Win64<br />
* [http://f0460945.xsph.ru/rindex.htm KOL 3.23 or later] for win32<br />
* The Mirror Classes Kit a.k.a. MCK for those who want to develop using a visual designer like Lazarus or Delphi.<br />
* [https://yadi.sk/d/Z0uMP31_67nJY Release preview of KOL 3.23-64] for KOL win32/64<br />
* [[KOL-CE|See the KOL CE page]] for win-ce development and requirements.<br />
* Not required, but recommended is a copy of FPC's RTL and/or Delphi's RTL sources<br />
<br />
=== Supported targets ===<br />
* All 32-bit Windows: from Windows 95 to Windows 8.1.<br />
* All 64-bit x86_64 from Windows 2000 to Windows 8.1. <br />
* [[WinCE port|Windows CE]] based PocketPC and Smartphones. More information on the [[KOL-CE|KOL CE page]]<br />
<br />
=== Example ===<br />
Let's illustrate KOL with a simple example. A form, a button and some action.<br><br />
You will notice that the code resembles that of a LCL/VCL application and basically:<br><br />
It does exactly the same!<br><br />
The main difference is the use of objects and pointer to objects instead of classes and the use of constructing functions instead of constructors.<br><br />
<br><br />
Here's the main program file:<br><br />
<syntaxhighlight lang="pascal"><br />
program koldemo;<br />
{This line makes us FPC and Delphi compatible}<br />
{$IFDEF FPC}{$MODE DELPHI}{$H+}{$ENDIF}<br />
{$APPTYPE GUI}<br />
uses<br />
Kol,<br />
koldemo1 in 'koldemo1.pas';<br />
<br />
begin<br />
NewForm1( Form1, nil);<br />
Run(Form1.form);<br />
end.<br />
</syntaxhighlight><br />
<br> <br />
And here is the main unit, again, you will notice it is very similar to LCL/VCL code:<br><br />
<syntaxhighlight lang="pascal"><br />
unit koldemo1;<br />
<br />
interface<br />
uses<br />
Windows, Messages, Kol;<br />
const<br />
cps:KolString = 'Kol project in ' + {$IFDEF FPC}'Freepascal '{$ELSE}'Delphi '{$ENDIF} +<br />
{$IFDEF WIN64}'64 bits '{$ELSE}'32 bits '{$ENDIF} +<br />
{$IFDEF UNICODE_CTRLS}'Unicode'{$ELSE}'Ansi'{$ENDIF};<br />
type<br />
<br />
PForm1=^TForm1;<br />
TForm1=object(Tobj)<br />
{Note both widgets are of the same type}<br />
Form, Button:pControl;<br />
public<br />
{The message handler for our Button}<br />
procedure ButtonClick(Sender:PObj); <br />
end;<br />
<br />
procedure NewForm1( var Result: PForm1; AParent: PControl );<br />
<br />
var<br />
Form1:pForm1;<br />
<br />
implementation<br />
<br />
procedure NewForm1( var Result: PForm1; AParent: PControl );<br />
begin<br />
New(Result,Create);<br />
with Result^ do<br />
begin<br />
{The appearance of a widget depends on its creating function}<br />
Form := NewForm(AParent,cps);<br />
Button := NewButton(Form,'&Click Me');<br />
{Attach the MessageHandler}<br />
Button.OnClick := ButtonClick;<br />
{ The applet variable is the Application object<br />
Assigning the main form to it assigns the main message loop to the form.}<br />
Applet:=Form;<br />
Form.Add2AutoFree(Result);<br />
end;<br />
end;<br />
<br />
procedure TForm1.ButtonClick(Sender: PObj);<br />
begin<br />
ShowMessage('Ouch!');<br />
end;<br />
<br />
end.<br />
</syntaxhighlight><br />
<br><br />
So what's so special about it?<br><br />
Well, for one, compile this and look at the executable size.<br><br />
A similar program, Form + Button + ShowMessage compiled with Delphi 7 is '''394 Kilobytes''' and it gets much worse for progressive newer versions of Delphi:2267 Kilobytes XE7-32, 3672 Kilobytes XE7-64<br><br />
For comparison: the KOL version compiled with D7 is '''156''' times smaller than the VCL version compiled with XE7.<br><br />
<br><br />
Compiled with PPC386 it renders an executable of 48128 bytes. Compiled like:<br><br />
ppc386 -Mdelphi -CX -XX -Xs -Os koldemo.dpr <br />
Compiled with PPCX64 for Windows it renders 65536 bytes. Compiled like:<br><br />
ppcx64 -Mdelphi -Rintel -CX -XX -Xs -Os koldemo.dpr<br />
The above examples are for an ANSI application. To compile a UNICODE application, simply add the UNICODE_CTRLS define, like:<br />
ppcx64 -Mdelphi -Rintel -dUNICODE_CTRLS -CX -XX -Xs -Os koldemo.dpr<br />
Note that especially for 64 bit, Free Pascal renders consistently smaller code than its expensive cousin.<br><br />
Also note that 32 bit Free Pascal has a slightly bigger runtime payload than its cousin. The size difference disappears when your application becomes more complex.<br />
<br />
== Tip: ==<br />
For size, KOL defaults to an ugly system font.<br />
Here are multiple ways to remedy that:<br />
<br />
<syntaxhighlight lang="pascal"><br />
{Add this code after the NewForm Function}<br />
{Release the font}<br />
Form.Font.ReleaseHandle;<br />
{Assign the default windows GUI font object}<br />
Form.Font.AssignHandle(GetStockObject(DEFAULT_GUI_FONT));<br />
</syntaxhighlight><br />
<br />
The second method is slightly more involved, but is the [http://msdn.microsoft.com/en-us/library/windows/desktop/dd144925%28v=vs.85%29.aspx |MSDN] recommended way:<br />
<br />
<syntaxhighlight lang="pascal"><br />
{Add this function}<br />
function GetGuiFont:TLogFont;<br />
var Metrics:TNonClientMetrics;<br />
begin<br />
Metrics.cbSize := SizeOf(Metrics);<br />
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, SizeOf(Metrics), @Metrics, 0);<br />
Result := Metrics.lfMessageFont;<br />
end;<br />
{And call it after the form creation}<br />
Form.Font.LogFontStruct :=GetGuiFont;<br />
</syntaxhighlight><br />
<br />
Fonts in KOL are objects of type TGraphicTool. This object can also represent pens and brushes.<br><br />
We can also create a new GraphicTool object representing the GUI font:<br />
<br />
<syntaxhighlight lang="pascal"><br />
{The KOL way to assign the GUI font}<br />
function GuiFont:PGraphicTool;<br />
var Metrics:TNonClientMetrics;<br />
begin<br />
Result := NewFont;<br />
Metrics.cbSize := SizeOf(Metrics);<br />
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, SizeOf(Metrics), @Metrics, 0);<br />
Result.LogFontStruct := Metrics.lfMessageFont;<br />
end;<br />
{We can now assign the new font to the Form's font property}<br />
Form.Font.Assign(GuiFont);<br />
</syntaxhighlight><br />
<br />
And this is the result:<br />
[[File:kolscreenshot.png]]<br />
<br />
<br />
[[Category:Tutorials]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=KOL&diff=144746KOL2021-04-27T23:18:44Z<p>Seenkao: </p>
<hr />
<div><br />
==Introduction== <br />
[[File:kolmck.png]]<br><br />
<br><br />
The Key Objects Library - a.k.a. KOL - is an object oriented framework created by Vladimir Kladov (http://f0460945.xsph.ru/rindex.htm) in 2000.<br><br />
It is the successor to the XCL library by the same author.<br><br />
The Mirror Classes Kit - a.k.a. MCK - is a set of visual components to write KOL applications in a visual design way -from within the Delphi IDE.<br><br />
The current point release is 3.23 for KOL and 3.23 for MCK.<br><br />
New versions appear with Irregular intervals, but the library is currently maintained.<br><br />
There is an svn repository for KOL and MCK at https://svn.code.sf.net/p/kolmck/code/ which is usually more up to date than the point releases.<br />
<br><br><br />
The main reason creating this library is explained through the dissatisfaction of Vladimir and others towards ever increasing codebloat.<br><br />
Nobody seemed to care anymore about *efficient* coding.<br><br />
According to KOL users there a strong correlation between Moore's law and degrading code optimizing efficiency.<br><br><br />
An MCK project designed in a Delphi IDE can be recompiled with both 32 bit and 64 bit FPC 2.7.1 or later compilers without change.<br><br />
This way you can without having to upgrade your Delphi to a recent version:<br><br />
* obtain a 64 bit version of a project.<br><br />
* obtain a unicode version of a Delphi project (5-2007) by simply defining -dUNICODE_CTRLS.<br><br />
* or both!<br><br><br />
<br> <br />
The framework centers around three basic concepts:<br><br />
* It uses - some say old school - pascal objects, not classes.<br><br />
* Most of the widgets are basically one and the same object. Polymorphism is through constructing functions.<br><br />
* It ignores the VCL/LCL, in fact it attempts to replace them.<br />
<br />
This has several '''advantages''', some of which are: <br><br />
* The size of your binary is very tiny, on average more than 20 times smaller than a VCL/LCL binary, but a factor 100 or more is not unusual.<br />
* KOL binaries (both executables and dll's) have much much faster load times and feel snappier.<br />
* KOL is very easy to extend once you understand its concepts. It is a fully object oriented framework<br />
<br />
It also has very obvious '''disadvantages''', some of which are:<br />
* KOL is a framework. It doesn't mix very well with classes and it can't be sensibly mixed with LCL/VCL code because you will loose the size advantage.<br />
* If you are not familiar with the old Object Pascal paradigm from Turbo Pascal the learning curve can be steep.<br />
* You will miss some functionality that has become common place, like RTTI, but most of these features are often codebloat and the reason why KOL exists in the first place. <br />
* Because you are often working on the same object with multiple appearances, it may be confusing that some methods or properties that you can see in the code editor do not apply.<br />
<br />
=== Requirements ===<br />
* Free Pascal compiler 2.6.4 or later for Win32<br />
* Free Pascal compiler 2.7.1 or later for Win64<br />
* [http://f0460945.xsph.ru/rindex.htm KOL 3.23 or later] for win32<br />
* The Mirror Classes Kit a.k.a. MCK for those who want to develop using a visual designer like Lazarus or Delphi.<br />
* [https://yadi.sk/d/Z0uMP31_67nJY Release preview of KOL 3.23-64] for KOL win32/64<br />
* [[KOL-CE|See the KOL CE page]] for win-ce development and requirements.<br />
* Not required, but recommended is a copy of FPC's RTL and/or Delphi's RTL sources<br />
<br />
=== Supported targets ===<br />
* All 32-bit Windows: from Windows 95 to Windows 8.1.<br />
* All 64-bit x86_64 from Windows 2000 to Windows 8.1. <br />
* [[WinCE port|Windows CE]] based PocketPC and Smartphones. More information on the [[KOL-CE|KOL CE page]]<br />
<br />
=== Example ===<br />
Let's illustrate KOL with a simple example. A form, a button and some action.<br><br />
You will notice that the code resembles that of a LCL/VCL application and basically:<br><br />
It does exactly the same!<br><br />
The main difference is the use of objects and pointer to objects instead of classes and the use of constructing functions instead of constructors.<br><br />
<br><br />
Here's the main program file:<br><br />
<syntaxhighlight lang="pascal"><br />
program koldemo;<br />
{This line makes us FPC and Delphi compatible}<br />
{$IFDEF FPC}{$MODE DELPHI}{$H+}{$ENDIF}<br />
{$APPTYPE GUI}<br />
uses<br />
Kol,<br />
koldemo1 in 'koldemo1.pas';<br />
<br />
begin<br />
NewForm1( Form1, nil);<br />
Run(Form1.form);<br />
end.<br />
</syntaxhighlight><br />
<br> <br />
And here is the main unit, again, you will notice it is very similar to LCL/VCL code:<br><br />
<syntaxhighlight lang="pascal"><br />
unit koldemo1;<br />
<br />
interface<br />
uses<br />
Windows, Messages, Kol;<br />
const<br />
cps:KolString = 'Kol project in ' + {$IFDEF FPC}'Freepascal '{$ELSE}'Delphi '{$ENDIF} +<br />
{$IFDEF WIN64}'64 bits '{$ELSE}'32 bits '{$ENDIF} +<br />
{$IFDEF UNICODE_CTRLS}'Unicode'{$ELSE}'Ansi'{$ENDIF};<br />
type<br />
<br />
PForm1=^TForm1;<br />
TForm1=object(Tobj)<br />
{Note both widgets are of the same type}<br />
Form, Button:pControl;<br />
public<br />
{The message handler for our Button}<br />
procedure ButtonClick(Sender:PObj); <br />
end;<br />
<br />
procedure NewForm1( var Result: PForm1; AParent: PControl );<br />
<br />
var<br />
Form1:pForm1;<br />
<br />
implementation<br />
<br />
procedure NewForm1( var Result: PForm1; AParent: PControl );<br />
begin<br />
New(Result,Create);<br />
with Result^ do<br />
begin<br />
{The appearance of a widget depends on its creating function}<br />
Form := NewForm(AParent,cps);<br />
Button := NewButton(Form,'&Click Me');<br />
{Attach the MessageHandler}<br />
Button.OnClick := ButtonClick;<br />
{ The applet variable is the Application object<br />
Assigning the main form to it assigns the main message loop to the form.}<br />
Applet:=Form;<br />
Form.Add2AutoFree(Result);<br />
end;<br />
end;<br />
<br />
procedure TForm1.ButtonClick(Sender: PObj);<br />
begin<br />
ShowMessage('Ouch!');<br />
end;<br />
<br />
end.<br />
</syntaxhighlight><br />
<br><br />
So what's so special about it?<br><br />
Well, for one, compile this and look at the executable size.<br><br />
A similar program, Form + Button + ShowMessage compiled with Delphi 7 is '''394 Kilobytes''' and it gets much worse for progressive newer versions of Delphi:2267 Kilobytes XE7-32, 3672 Kilobytes XE7-64<br><br />
For comparison: the KOL version compiled with D7 is '''156''' times smaller than the VCL version compiled with XE7.<br><br />
<br><br />
Compiled with PPC386 it renders an executable of 48128 bytes. Compiled like:<br><br />
ppc386 -Mdelphi -CX -XX -Xs -Os koldemo.dpr <br />
Compiled with PPCX64 for Windows it renders 65536 bytes. Compiled like:<br><br />
ppcx64 -Mdelphi -Rintel -CX -XX -Xs -Os koldemo.dpr<br />
The above examples are for an ANSI application. To compile a UNICODE application, simply add the UNICODE_CTRLS define, like:<br />
ppcx64 -Mdelphi -Rintel -dUNICODE_CTRLS -CX -XX -Xs -Os koldemo.dpr<br />
Note that especially for 64 bit, Free Pascal renders consistently smaller code than its expensive cousin.<br><br />
Also note that 32 bit Free Pascal has a slightly bigger runtime payload than its cousin. The size difference disappears when your application becomes more complex.<br />
<br />
== Tip: ==<br />
For size, KOL defaults to an ugly system font.<br />
Here are multiple ways to remedy that:<br />
<br />
<syntaxhighlight lang="pascal"><br />
{Add this code after the NewForm Function}<br />
{Release the font}<br />
Form.Font.ReleaseHandle;<br />
{Assign the default windows GUI font object}<br />
Form.Font.AssignHandle(GetStockObject(DEFAULT_GUI_FONT));<br />
</syntaxhighlight><br />
<br />
The second method is slightly more involved, but is the [http://msdn.microsoft.com/en-us/library/windows/desktop/dd144925%28v=vs.85%29.aspx |MSDN] recommended way:<br />
<br />
<syntaxhighlight lang="pascal"><br />
{Add this function}<br />
function GetGuiFont:TLogFont;<br />
var Metrics:TNonClientMetrics;<br />
begin<br />
Metrics.cbSize := SizeOf(Metrics);<br />
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, SizeOf(Metrics), @Metrics, 0);<br />
Result := Metrics.lfMessageFont;<br />
end;<br />
{And call it after the form creation}<br />
Form.Font.LogFontStruct :=GetGuiFont;<br />
</syntaxhighlight><br />
<br />
Fonts in KOL are objects of type TGraphicTool. This object can also represent pens and brushes.<br><br />
We can also create a new GraphicTool object representing the GUI font:<br />
<br />
<syntaxhighlight lang="pascal"><br />
{The KOL way to assign the GUI font}<br />
function GuiFont:PGraphicTool;<br />
var Metrics:TNonClientMetrics;<br />
begin<br />
Result := NewFont;<br />
Metrics.cbSize := SizeOf(Metrics);<br />
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, SizeOf(Metrics), @Metrics, 0);<br />
Result.LogFontStruct := Metrics.lfMessageFont;<br />
end;<br />
{We can now assign the new font to the Form's font property}<br />
Form.Font.Assign(GuiFont);<br />
</syntaxhighlight><br />
<br />
And this is the result:<br />
[[File:kolscreenshot.png]]<br />
<br />
<br />
[[Category:Tutorials]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/ru&diff=144323ZenGL/ru2021-04-06T10:03:34Z<p>Seenkao: </p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index/ru}}<br />
<br />
== О ZenGL ==<br />
<br />
'''ZenGL''' - кросс-платформенная библиотека, разработанная, чтобы обеспечить необходимый функционал для отрисовки двухмерных игр, обработки устройств ввода, воспроизведение звука и музыки.<br />
<br />
*'''Поддерживаемые ОС''': GNU/Linux(32/64), Windows(32/64), macOS(Carbon/Cocoa), iOS, Android 2.1+<br />
<br />
*'''Компиляторы''': Free Pascal, Delphi<br />
<br />
*'''Графические API''': [https://wiki.freepascal.org/OpenGL/ru OpenGL], OpenGL ES 1.x, Direct3D 8/9<br />
<br />
*'''Аудио API''': OpenAL, DirectSound<br />
<br />
*'''Лицензия''': [http://zengl.org/license.html zlib]<br />
<br />
В данное время библиотека дорабатывается.<br />
<br />
== Ссылки ==<br />
<br />
*[http://zengl.org/download.html Download ZenGL]<br />
*[http://zengl.org/extra.html Extra Downloads]<br />
*[http://zengl.org/ Домашняя страничка проекта]<br />
*[http://zengl.org/wiki Wiki]<br />
*[http://zengl.org/forum Официальный Форум]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL Новая версия]<br />
<br />
== Обучающие примеры ==<br />
<br />
'''Внимание!''' Все примеры содержатся в скачиваемой версии библиотеки (в новых версиях они могут незначительно, но критично для работы разрабатываемой программы, отличаться).<br />
<br />
[[ZenGL Tutorial]]: Первый пример для ZenGL знакомит с самой библиотекой. Рассказывается о том как скачать, установить библиотеку. Настроить компилятор (среду разработки) для компиляции проектов. Сборка проекта как статической так динамической библиотекой ZenGL. А так же рассматривается одна и программ-примеров 'Initialization', которая входит в библиотеку ZenGL.<br />
<br />
[[ZenGL Tutorial 2]]: Второй пример рассказывает о том, как создавать шрифты и выводить текст на экран.<br />
<br />
== Возможности библиотеки ==<br />
<br />
*Основные<br />
** библиотека может быть скомпилирована статически к проекту, или использоваться, как динамическая библиотека (в обновлённой версии только статическая компиляция)<br />
** рендеринг как в собственное, так и в заранее подготовленное окно (LCL, VCL)<br />
** журнал событий <br />
** загрузка ресурсов из файлов, памяти и '''zip''' архивов<br />
** многопоточная загрузка ресурсов<br />
** возможность расширить количество поддерживаемых форматов данных<br />
* Возможности настройки графики<br />
** Сглаживание (antialiasing), разрешение и частоту обновления экрана (screen resolution, refresh rate) а так же контролировать вертикальную синхронизацию (v-sync)<br />
** коррекция пропорций выводимого изображения относительно заданных размеров<br />
** управление заголовком и размером окна, наличие автоматического центрирования<br />
** управление видимостью курсора в пределах окна<br />
* Устройства ввода<br />
** обработка событий клавиатуры, мыши и джойстика<br />
** ввод Unicode символов<br />
** возможность ограничить ввод только латинской раскладкой<br />
*Вывод Текстур<br />
** поддержка форматов '''tga''', '''png''', '''jpg''' и '''pvr'''<br />
** поддержка текстур размером не кратным 2 (Non Power Of Two)<br />
** управление параметрами фильтрации<br />
** работа с масками<br />
** ''render targets'' отрисовка в текстуры<br />
*Вывод текста<br />
** реализация Unicode шрифты на основе текстур<br />
** вывод UTF-8 текста<br />
** управление отступами, размером, цветом вершин и количеством символов в тексте<br />
*2D подсистема<br />
** ''batch render'' для повышения производительности рендеринга<br />
** рендеринг основных видов примитивов<br />
** спрайтовый движок<br />
** вывод статических и анимированных спрайтов и тайлов<br />
** рендеринг трансформирующейся сетки<br />
** рендеринг спрайтов с ручным указанием текстурных координат(с пиксельной размерностью и обычным 0..1)<br />
** управление режимом блендинга и смешивания цвета<br />
** возможность назначения цвета и альфы отдельным вершинам спрайтов и примитивов<br />
** дополнительные трансформации спрайтов(зеркальное отражения, увеличение, смещение вершин)<br />
** быстрое отсечение спрайтов выходящих за пределы видимости<br />
** наличие 2D камеры с возможностью увеличения и поворота содержимого сцены<br />
* Звук<br />
** вывод звука с помощью библиотек OpenAL или DirectSound (зависит от настроек проекта и операционной системы)<br />
** возможность правильной работы, даже при отсутствии звуковой карты <br />
** поддержка форматов '''wav''' и 'ogg'''<br />
** потоковое воспроизведение аудио-файлов<br />
** контроль за громкостью звука и темпом воспроизведения<br />
** трехмерное позиционирование источника звука в пространстве<br />
* Видео<br />
** декодирование видео заставок в текстуры <br />
** поддержка кодека '''theora''' в формате '''ogv''' <br />
* Математический вычисление <br />
** базовый набор вспомогательных мат. функций<br />
** необходимый набор функций для триангуляции<br />
** простейшие функции проверки столкновений <br />
* Доплнительно<br />
** чтение и запись INI файлов<br />
** дополнительные функции для работы с файлами и памятью<br />
<br />
== В обновлённой версии ==<br />
<br />
*Корректирована компиляция под android под версию FPC 3.2.0 и выше.<br />
*Перебран основной код для коррекции работы библиотеки<br />
*Редактирована работа с Windows 64<br />
*Исправлены мелкие баги<br />
*Редактированы демо-версии (для iOS демки не правились, перебраны демо-версии для Lazarus, FPC и Delphi)<br />
*Введены DEFINE<br />
** define - USE_EXIT_ESCAPE - выход. Возможность не писать дополнительный код для выхода из программы по нажатию клавиши Escape<br />
** define - USE_INIT_HANDLE - для использования ZenGL в уже созданное окно (LCL/VCL)<br />
*Введена поддержка MacOS Cocoa<br />
*Редактирована работа с таймерами<br />
*Редактирована работа со шрифтами<br />
*Редактирована работа с LCL/VCL<br />
<br />
{{AutoCategory}}<br />
[[Category:Components/ru]]<br />
[[Category:Graphics/ru]]<br />
[[Category:Audio/ru]]<br />
[[Category:Video/ru]]<br />
[[Category:Multimedia/ru]]<br />
[[Category:Game Development/ru]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/ru&diff=144295ZenGL/ru2021-04-03T08:19:08Z<p>Seenkao: </p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index/ru}}<br />
<br />
== О ZenGL ==<br />
<br />
'''ZenGL''' - кросс-платформенная библиотека, разработанная, чтобы обеспечить необходимый функционал для отрисовки двухмерных игр, обработки устройств ввода, воспроизведение звука и музыки.<br />
<br />
*'''Поддерживаемые ОС''': GNU/Linux(32/64), Windows(32/64), macOS(Carbon/Cocoa), iOS, Android 2.1+<br />
<br />
*'''Компиляторы''': Free Pascal, Delphi<br />
<br />
*'''Графические API''': OpenGL, OpenGL ES 1.x, Direct3D 8/9<br />
<br />
*'''Аудио API''': OpenAL, DirectSound<br />
<br />
*'''Лицензия''': [http://zengl.org/license.html zlib]<br />
<br />
В данное время библиотека дорабатывается.<br />
<br />
== Ссылки ==<br />
<br />
*[http://zengl.org/download.html Download ZenGL]<br />
*[http://zengl.org/extra.html Extra Downloads]<br />
*[http://zengl.org/ Домашняя страничка проекта]<br />
*[http://zengl.org/wiki Wiki]<br />
*[http://zengl.org/forum Официальный Форум]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL Новая версия]<br />
<br />
== Обучающие примеры ==<br />
<br />
'''Внимание!''' Все примеры содержатся в скачиваемой версии библиотеки (в новых версиях они могут незначительно, но критично для работы разрабатываемой программы, отличаться).<br />
<br />
[[ZenGL Tutorial]]: Первый пример для ZenGL знакомит с самой библиотекой. Рассказывается о том как скачать, установить библиотеку. Настроить компилятор (среду разработки) для компиляции проектов. Сборка проекта как статической так динамической библиотекой ZenGL. А так же рассматривается одна и программ-примеров 'Initialization', которая входит в библиотеку ZenGL.<br />
<br />
[[ZenGL Tutorial 2]]: Второй пример рассказывает о том, как создавать шрифты и выводить текст на экран.<br />
<br />
== Возможности библиотеки ==<br />
<br />
*Основные<br />
** библиотека может быть скомпилирована статически к проекту, или использоваться, как динамическая библиотека (в обновлённой версии только статическая компиляция)<br />
** рендеринг как в собственное, так и в заранее подготовленное окно (LCL, VCL)<br />
** журнал событий <br />
** загрузка ресурсов из файлов, памяти и '''zip''' архивов<br />
** многопоточная загрузка ресурсов<br />
** возможность расширить количество поддерживаемых форматов данных<br />
* Возможности настройки графики<br />
** Сглаживание (antialiasing), разрешение и частоту обновления экрана (screen resolution, refresh rate) а так же контролировать вертикальную синхронизацию (v-sync)<br />
** коррекция пропорций выводимого изображения относительно заданных размеров<br />
** управление заголовком и размером окна, наличие автоматического центрирования<br />
** управление видимостью курсора в пределах окна<br />
* Устройства ввода<br />
** обработка событий клавиатуры, мыши и джойстика<br />
** ввод Unicode символов<br />
** возможность ограничить ввод только латинской раскладкой<br />
*Вывод Текстур<br />
** поддержка форматов '''tga''', '''png''', '''jpg''' и '''pvr'''<br />
** поддержка текстур размером не кратным 2 (Non Power Of Two)<br />
** управление параметрами фильтрации<br />
** работа с масками<br />
** ''render targets'' отрисовка в текстуры<br />
*Вывод текста<br />
** реализация Unicode шрифты на основе текстур<br />
** вывод UTF-8 текста<br />
** управление отступами, размером, цветом вершин и количеством символов в тексте<br />
*2D подсистема<br />
** ''batch render'' для повышения производительности рендеринга<br />
** рендеринг основных видов примитивов<br />
** спрайтовый движок<br />
** вывод статических и анимированных спрайтов и тайлов<br />
** рендеринг трансформирующейся сетки<br />
** рендеринг спрайтов с ручным указанием текстурных координат(с пиксельной размерностью и обычным 0..1)<br />
** управление режимом блендинга и смешивания цвета<br />
** возможность назначения цвета и альфы отдельным вершинам спрайтов и примитивов<br />
** дополнительные трансформации спрайтов(зеркальное отражения, увеличение, смещение вершин)<br />
** быстрое отсечение спрайтов выходящих за пределы видимости<br />
** наличие 2D камеры с возможностью увеличения и поворота содержимого сцены<br />
* Звук<br />
** вывод звука с помощью библиотек OpenAL или DirectSound (зависит от настроек проекта и операционной системы)<br />
** возможность правильной работы, даже при отсутствии звуковой карты <br />
** поддержка форматов '''wav''' и 'ogg'''<br />
** потоковое воспроизведение аудио-файлов<br />
** контроль за громкостью звука и темпом воспроизведения<br />
** трехмерное позиционирование источника звука в пространстве<br />
* Видео<br />
** декодирование видео заставок в текстуры <br />
** поддержка кодека '''theora''' в формате '''ogv''' <br />
* Математический вычисление <br />
** базовый набор вспомогательных мат. функций<br />
** необходимый набор функций для триангуляции<br />
** простейшие функции проверки столкновений <br />
* Доплнительно<br />
** чтение и запись INI файлов<br />
** дополнительные функции для работы с файлами и памятью<br />
<br />
== В обновлённой версии ==<br />
<br />
*Корректирована компиляция под android под версию FPC 3.2.0 и выше.<br />
*Перебран основной код для коррекции работы библиотеки<br />
*Редактирована работа с Windows 64<br />
*Исправлены мелкие баги<br />
*Редактированы демо-версии (для iOS демки не правились, перебраны демо-версии для Lazarus, FPC и Delphi)<br />
*Введены DEFINE<br />
** define - USE_EXIT_ESCAPE - выход. Возможность не писать дополнительный код для выхода из программы по нажатию клавиши Escape<br />
** define - USE_INIT_HANDLE - для использования ZenGL в уже созданное окно (LCL/VCL)<br />
*Введена поддержка MacOS Cocoa<br />
*Редактирована работа с таймерами<br />
*Редактирована работа со шрифтами<br />
*Редактирована работа с LCL/VCL<br />
<br />
{{AutoCategory}}<br />
[[Category:Components/ru]]<br />
[[Category:Graphics/ru]]<br />
[[Category:Audio/ru]]<br />
[[Category:Video/ru]]<br />
[[Category:Multimedia/ru]]<br />
[[Category:Game Development/ru]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/fr&diff=144294ZenGL/fr2021-04-03T08:18:28Z<p>Seenkao: </p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index/fr}}<br />
<br />
== L'essentiel ==<br />
ZenGL - bibliothèque de développement de jeu multi plate-forme, conçue pour fournir les fonctionnalités nécessaire pour le rendu des graphiques 2D, traitement des entrées, sortie sonores, etc.<br />
<br />
'''OS supportés''': GNU/Linux, Windows, macOS, iOS, Android 2.1+<br/><br />
'''Compilateurs supportés''': FreePascal, Delphi<br/><br />
'''API Graphique''': OpenGL, OpenGL ES 1.x, Direct3D 8/9<br/><br />
'''API de son''': OpenAL, DirectSound<br/><br />
'''Licence''': [http://zengl.org/license.html zlib]<br />
<br />
La bibliothèque est en cours de finalisation.<br />
<br />
== Liens ==<br />
<br />
*[http://zengl.org/download.html Télécharger ZenGL]<br />
*[http://zengl.org/extra.html Téléchargement d'Extras]<br />
*[http://zengl.org/ Page d'accueil]<br />
*[http://zengl.org/wiki Wiki]<br />
*[http://zengl.org/forum Forum officiel]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL Une nouvelle version]<br />
<br />
== Tutoriel ==<br />
<br />
'''Attention!''' Tous les exemples sont contenus dans la version téléchargée de la bibliothèque (dans les nouvelles versions, ils peuvent différer légèrement, mais critiques pour le travail du programme développé).<br />
<br />
[[ZenGL Tutorial/fr|Tutoriel ZenGL]] : C'est le premier tutoriel pour ZenGL : téléchargement, installation, chemins des sources, compilation (statiquement ou avec so/dll/dylib) (Windows dll), et le premier programme 'Initialization' qui vient avec ZenGL.<br/><br />
[[ZenGL Tutorial 2/fr|Tutoriel ZenGL 2]] : C'est le second tutoriel sur comment créer une fonte et dessiner du texte dans la fenêtre.<br />
<br />
== Caractéristiques ==<br />
<br />
* '''Principal'''<br />
o peut être utilisé comme so/dll/dylib ou statiquement compilé avec votre application<br />
o rendu en propre ("to own") ou vers toute autre fenêtre préparée<br />
o enregistrement ("logging")<br />
o chargement de ressource depuis des fichiers, la mémoire et archives '''zip'''<br />
o chargement de ressource multi-threadé<br />
o ajout facilité du support de nouveau format de ressource<br />
* '''Configuration'''<br />
o anticrénelage ("antialiasing"), résolution d'écran, taux de rafraichissement et synchronisation verticale<br />
o correction d'aspect<br />
o titre, position et taille de la fenêtre<br />
o visibilité du curseur dans l'espace de la fenêtre<br />
* '''Entrée'''<br />
o traitement du clavier, de la souris et de l'entrée joystick<br />
o traitement de l'entrée de texte Unicode<br />
o possibilité de restreindre l'entrée à l'alphabet latin<br />
* '''Textures'''<br />
o supporte '''tga''', '''png''', '''jpg''' et '''pvr'''<br />
o fonctionnement correct avec les [https://www.opengl.org/wiki/NPOT_Texture textures NPOT] (non puissance de 2)<br />
o contrôle des paramètres de filtre<br />
o masquage<br />
o ''cibles de rendu''("render targets") pour le rendu en texture<br />
* '''Texte'''<br />
o font Unicode texturée<br />
o rendu de texte UTF-8<br />
o rendu de texte avec alignement et autres options comme la taille, la couleur et le compte de symbole ("count of symbols")<br />
* '''sous-système 2D'''<br />
o ''rendu différé'' ("batch render") pour le rendu à haute vitesse<br />
o rendu de différentes primitives<br />
o moteur de lutin ("sprite")<br />
o rendu de lutins et tuiles ("tiles") statiques et animé.<br />
o rendu de grille de distortion<br />
o rendu des lutins avec de nouvelles coordonnées de textures (avec la dimension de pixel et l'habituel 0..1)<br />
o contrôle du mode de mélange et du mode mix de couleurs ("color mix mode")<br />
o contrôle de la couleur et de l'alpha des sommets des lutins et primitives<br />
o transformations supplémentaires de lutin (flipping, zoom ("zooming"), décalage de sommets ("vertices offset"))<br />
o découpage ("clipping") rapide des lutins invisibles<br />
o caméra 2D avec possibilité de zoom et de rotation de la scène<br />
* '''Son'''<br />
o fonctionne à travers OpenAL ou DirectSound; selon la configuration et le système d'exploitation<br />
o marche correctement avec la carte son<br />
o supporte '''wav''' et '''ogg''' comme formats des échantillons sonores<br />
o lecture des fichiers audio dans un thread séparé<br />
o contrôle du volume et de la vitesse de lecture<br />
o déplacement des sources sonores dans l'espace 3D<br />
* '''Vidéo'''<br />
o décodage des trames vidéo dans la texture<br />
o supporte le codec '''theora''' dans un conteneur '''ogv'''<br />
* '''Maths'''<br />
o ensemble de base de fonctions mathématiques supplémentaires<br />
o fonctions de triangulation<br />
o ensemble de base de fonctions de collision<br />
* '''Supplément'''<br />
o lecture et écriture de fichier INI<br />
o fonctions pour travailler avec les fichiers et la mémoire<br />
<br/><br />
<br />
== Dans la nouvelle version ==<br />
<br />
* Correction de la compilation pour Android pour FPC 3.2.0 et supérieur.<br />
* Déplacement du code principal pour corriger la bibliothèque<br />
* Travail édité avec Windows 64<br />
* Correction de bugs mineurs<br />
* Versions de démonstration éditées (pour iOS, les démos n'ont pas été corrigées, les versions de démonstration pour Lazarus, FPC et Delphi ont été révisées)<br />
* Introduit par DEFINE<br />
** define - USE_EXIT_ESCAPE - quitter. Possibilité de ne pas écrire de code supplémentaire pour quitter le programme en appuyant sur la touche Échap<br />
** define - USE_INIT_HANDLE - pour utiliser ZenGL dans une fenêtre déjà créée (LCL/VCL)<br />
* Prise en charge introduite pour macOS Cocoa<br />
* Changé: travailler avec des minuteries, travailler avec des polices, travailler avec LCL/VCL</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/es&diff=144292ZenGL/es2021-04-03T08:05:12Z<p>Seenkao: </p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index/es}}<br />
<br />
== Principal ==<br />
ZenGL - librería de desarrollo de juegos multi-platforma, diseñado para proporcionar la funcionalidad necesaria para la generación de gráficos 2D, manejo de la entrada, de la salida, del sonido, etc<br />
<br />
'''SO Soportados''': GNU/Linux, Windows, macOS<br><br />
'''Compiladores soportados''': FreePascal, Delphi<br><br />
'''API de Gráficos''': OpenGL, Direct3D 8/9<br><br />
'''API de Sonido''': OpenAL, DirectSound<br><br />
'''Licencia''': GNU LGPL version 3<br />
<br />
''*'' Disponible en versión [http://code.google.com/p/zengl/source/checkout svn]<br />
<br />
Actualmente se está finalizando la biblioteca.<br />
<br />
== Enlaces ==<br />
<br />
*[http://zengl.org/download.html Descargar ZenGL]<br><br />
*[http://zengl.org/extra.html Descargar Extras]<br />
*[http://zengl.org/ Página Principal]<br><br />
*[http://zengl.org/wiki Wiki]<br><br />
*[http://zengl.org/forum Foro Oficial]<br><br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL Una nueva version]<br />
<br />
== Tutorial ==<br />
<br />
'''¡Atención!''' Todos los ejemplos están contenidos en la versión descargada de la biblioteca (en las nuevas versiones pueden diferir levemente, pero son fundamentales para el trabajo del programa desarrollado).<br />
<br />
[[ZenGL Tutorial/es]]: Este es un primer tutorial para ZenGL: descarga, instalación, rutas del código fuente, compilación (estática o con so/dll/dylib) (Windows dll), y el primer programa 'Inicialización' que viene con ZenGL.<br />
<br />
[[ZenGL Tutorial 2/es]]: Este es el segundo tutorial que muestra como crear una fuente y dibujar texto en la ventana.<br />
<br />
== Caracteristicas ==<br />
<br />
* '''Principal'''<br />
o puede ser usado como so/dll/dylib o estáticamente compilado con tu aplicación<br />
o renderizar para la propia o alguna otra ventana preparada<br />
o logging<br />
o carga de recursos desde archivos y memoria<br />
o forma fácil para agregar soporte para nuevos formatos de recursos<br />
* '''Configurción de'''<br />
o antialiasing, resolución de pantalla, tasa de refresco y sincronización vertical<br />
o corrección del aspecto<br />
o título, posición y tamaño de la ventana<br />
o visibilidad del cursor en el espacio de la ventana<br />
* '''Entrada'''<br />
o manejar entrada del teclado, ratón y mando<br />
o manejar entrada de texto Unicode<br />
o posibilidad de restringir la entrada al alfabeto Latín<br />
* '''Texturas'''<br />
o soporta '''tga''', '''png''' y '''jpg'''<br />
o trabaja correctamente con texturas NPOT<br />
o controla los parámetros de filtros<br />
o máscaras<br />
o ''objetivos de renderizado'' para renderizar en textura<br />
* '''Texto'''<br />
o fuente-Unicode texturizada<br />
o renderizar texto UTF-8 o ANSI<br />
o renderizar texto con alineamiento y otras opciones como tamaño, color y conteo de símbolos<br />
* '''Subsistema-2D'''<br />
o ''renderizado en lote'' para renderizado de alta velocidad<br />
o renderizar diferentes primitivas<br />
o motor de sprites<br />
o renderizar sprites y azulejos estáticos y animados<br />
o renderizar grilla de distorsión<br />
o renderizar sprites con coordenadas de nueva textura (con la dimensión del píxel y el usual 0..1)<br />
o controlar el modo de mezcla y mezcla de color<br />
o controlar el color y opacidad de los vertices de sprites y primitivas<br />
o transformaciones adicionales de sprite (girado, zoom, desplazamiento de vértices)<br />
o recorte rápido de sprites invisibles<br />
o camara 2d con la capacidad de zoom y rotar la escena<br />
* '''Sonido'''<br />
o trabaja a través de OpenAL o DirectSound, dependiendo de la configuración o el SO<br />
o trabaja correctamente sin placa de sonido<br />
o soporta '''wav''' y '''ogg''' como muestras de sonido<br />
o reproducir archivos de audio en hilos separados<br />
o controlar el volumen y velocidad de reproducción<br />
o mover fuentes de sonido en un espacio 3D<br />
* '''Matemática'''<br />
o set básico de funciones matemáticas adicionales<br />
o funciones de triangulación<br />
o set básico de funciones de colisión<br />
* '''Adicional'''<br />
o leer y escribir archivos ini<br />
o funciones para trabajar con archivos y memoria<br />
<br />
== En la nueva versión ==<br />
<br />
* Compilación corregida para Android para FPC 3.2.0 y superior.<br />
* Se movió el código principal para corregir la biblioteca.<br />
* Trabajo fijo con Windows 64<br />
* Corregidos errores menores<br />
* Versiones de demostración editadas (para iOS, las demostraciones no se corrigieron, se revisaron las versiones de demostración para Lazarus, FPC y Delphi)<br />
* Introducido por DEFINE<br />
** define - USE_EXIT_ESCAPE - salir. Posibilidad de no escribir código adicional para salir del programa presionando la tecla Escape<br />
** define - USE_INIT_HANDLE - para usar ZenGL en una ventana ya creada (LCL/VCL)<br />
* Soporte introducido para macOS Cocoa<br />
* Cambiado: trabajar con temporizadores, trabajando con fuentes, trabajar con LCL/VCL.<br />
<br />
[[Category:Components/es]]<br />
[[Category:Graphics/es]]<br />
[[category:Español]][[category:Castellano]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/de&diff=144290ZenGL/de2021-04-03T07:54:39Z<p>Seenkao: </p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index}}<br />
<br />
== Allgemein ==<br />
ZenGL ist eine plattformübergreifende Game-Library und wurde entworfen, um notwendige Funktionen wie 2D-Grafiken, Ein- und Ausgabebehandlung, Sound, etc. bereitzustellen.<br />
<br />
'''Unterstützte Betriebssysteme''': GNU/Linux, Windows, macOS, iOS*, Android 2.1+*<br><br />
'''Unterstützte Compiler''': FreePascal, Delphi<br><br />
'''Graphik API''': OpenGL, OpenGL ES 1.x*, Direct3D 8/9<br><br />
'''Sound API''': OpenAL, DirectSound<br><br />
'''Lizenz''': [http://zengl.org/license.html Details]<br />
<br />
''*'' - Nur in der [http://code.google.com/p/zengl/source/checkout svn]-Version<br />
<br />
Die Bibliothek wird zu diesem Zeitpunkt weiterentwickelt.<br />
<br />
== Links ==<br />
<br />
*[http://zengl.org/download.html Download ZenGL]<br><br />
*[http://zengl.org/extra.html Extra Downloads]<br />
*[http://zengl.org/ Homepage]<br><br />
*[http://zengl.org/wiki Wiki]<br><br />
*[http://zengl.org/forum Offizielles Forum (englisch)]<br><br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL eine neue Version]<br />
<br />
== Tutorial ==<br />
<br />
'''Beachtung!''' Alle Beispiele sind in der heruntergeladenen Version der Bibliothek enthalten (in neuen Versionen können sie geringfügig abweichen, dies kann für die Arbeit des entwickelten Programms von entscheidender Bedeutung sein).<br />
<br />
[[ZenGL Tutorial]]: Das ist das erste ZenGL Tutorial: Download, Installation, Quellpfade, Kompilieren (statisch oder mit so/dll/dylib) (Windows dll), und das erste Programm "Initialisation", das im ZenGL Paket enthalten ist.<br />
<br />
[[ZenGL Tutorial 2]]: Im zweiten Tutorial wird gezeigt, wie man einen Font erstellt und diesen auf ein ZenGL Fenster zeichnet.<br />
<br />
== Features ==<br />
<br />
* '''Allgemein'''<br />
o so/dll/dylib oder statisches Kompilieren von ZenGL gemeinsam mit der Applikation<br />
o Rendern in ein eigenes oder bereitgestelltes Fenster<br />
o Logging<br />
o Laden von Resourcen aus Dateien oder aus dem Speicher<br />
o Eine einfache Möglichkeit, Unterstützung für weitere Resourcen hinzuzufügen.<br />
* '''Einstellen von'''<br />
o Antialiasing, Bildschirmauflösung, Bildwiederholrate und Vertikaler Synchronisation<br />
o Aspect Correction<br />
o Titel, Position und Größe des Fensters<br />
o Sichtbarkeit des Cursors im Fenster<br />
* '''Eingabe'''<br />
o Keyboard, Maus und Joystick<br />
o Behandeln von Unicode Texteingabe<br />
o Möglichkeit, die Eingabe auf den ASCII Zeichensatz zu beschränken<br />
* '''Texturen'''<br />
o Unterstützung für '''tga''', '''png''' und '''jpg'''<br />
o Arbeitet korrekt mit NPOT Texturen<br />
o Kontrolle aller Filterparameter<br />
o Masking<br />
o ''Render Targets'', um auf Texturen zu rendern.<br />
* '''Text'''<br />
o texturierter Unicode-Font<br />
o Rendern von UTF-8 oder ANSI Text<br />
o Rendern von Text mit Ausrichtungen und anderen Optionen, wie Größe, Farbe, Anzahl der Zeichen<br />
* '''2D-Subsystem'''<br />
o ''batch render'' für High-Speed-Rendering<br />
o Rendern von verschiedenen "Primitives"<br />
o Sprite Engine<br />
o Rendern von statischen und animierten Sprites und Tiles (Kacheln)<br />
o rendering distortion grid<br />
o rendering sprites with new texture coordinates(with the pixel dimension and the usual 0..1)<br />
o control the blend mode and color mix mode<br />
o control the color and alpha of vertices of sprites and primitives<br />
o additional sprite transformations(flipping, zooming, vertices offset)<br />
o fast clipping of invisible sprites<br />
o 2D Kamera mit den Möglichkeiten zum Zoomen und Drehen. <br />
* '''Sound'''<br />
o arbeitet mit OpenAL oder DirectSound, basierend auf der Konfiguration des Betriebssystems<br />
o correct work without soundcard<br />
o unterstützt '''wav''' und '''ogg''' als Sounddateien<br />
o Abspielen von Audiodateien in einem separaten Thread<br />
o Kontrolle über Lautspärke und Abspielgeschwindigkeit<br />
o moving sound sources in 3D space<br />
* '''Math'''<br />
o Ein Satz zusätzlicher mathematischer Funktionen<br />
o triangulation functions<br />
o Kollisionsfunktionen<br />
* '''Zusätzlich'''<br />
o Lesen und Schreiben von INI-Files<br />
o Funktionen um mit Dateien im Speicher zu arbeiten<br />
<br />
== In der neuen Version ==<br />
<br />
*Die Kompilierung für Android für FPC 3.2.0 und höher wurde korrigiert.<br />
*Der Hauptcode wurde verschoben, um die Bibliothek zu korrigieren<br />
*Bearbeitete Arbeit mit Windows 64<br />
*Kleinere Fehler behoben<br />
*Bearbeitete Demoversionen (für iOS wurden Demos nicht korrigiert, Demoversionen für Lazarus, FPC und Delphi wurden überarbeitet)<br />
*Eingeführt von DEFINE<br />
**define - USE_EXIT_ESCAPE - exit. Jetzt müssen Sie keinen zusätzlichen Code schreiben, um das Programm durch Drücken der Escape-Taste zubeenden<br />
**define - USE_INIT_HANDLE - um ZenGL in einem bereits erstellten Fenster (LCL/VCL) zu verwenden<br />
*Unterstützung für macOS Cocoa eingeführt<br />
*Bearbeitete Arbeit mit Timern<br />
*Bearbeitete Arbeit mit Schriftarten<br />
*Bearbeitete Arbeit mit LCL/VCL<br />
<br />
[[Category:Components/de]]<br />
[[Category:Graphics/de]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/de&diff=144289ZenGL/de2021-04-03T07:42:00Z<p>Seenkao: </p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index}}<br />
<br />
== Allgemein ==<br />
ZenGL ist eine plattformübergreifende Game-Library und wurde entworfen, um notwendige Funktionen wie 2D-Grafiken, Ein- und Ausgabebehandlung, Sound, etc. bereitzustellen.<br />
<br />
'''Unterstützte Betriebssysteme''': GNU/Linux, Windows, macOS, iOS*, Android 2.1+*<br><br />
'''Unterstützte Compiler''': FreePascal, Delphi<br><br />
'''Graphik API''': OpenGL, OpenGL ES 1.x*, Direct3D 8/9<br><br />
'''Sound API''': OpenAL, DirectSound<br><br />
'''Lizenz''': [http://zengl.org/license.html Details]<br />
<br />
''*'' - Nur in der [http://code.google.com/p/zengl/source/checkout svn]-Version<br />
<br />
Die Bibliothek wird zu diesem Zeitpunkt weiterentwickelt.<br />
<br />
== Links ==<br />
<br />
*[http://zengl.org/download.html Download ZenGL]<br><br />
*[http://zengl.org/extra.html Extra Downloads]<br />
*[http://zengl.org/ Homepage]<br><br />
*[http://zengl.org/wiki Wiki]<br><br />
*[http://zengl.org/forum Offizielles Forum (englisch)]<br><br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL eine neue Version]<br />
<br />
== Tutorial ==<br />
<br />
'''Beachtung!''' Alle Beispiele sind in der heruntergeladenen Version der Bibliothek enthalten (in neuen Versionen können sie geringfügig abweichen, dies kann für die Arbeit des entwickelten Programms von entscheidender Bedeutung sein).<br />
<br />
[[ZenGL Tutorial]]: Das ist das erste ZenGL Tutorial: Download, Installation, Quellpfade, Kompilieren (statisch oder mit so/dll/dylib) (Windows dll), und das erste Programm "Initialisation", das im ZenGL Paket enthalten ist.<br />
<br />
[[ZenGL Tutorial 2]]: Im zweiten Tutorial wird gezeigt, wie man einen Font erstellt und diesen auf ein ZenGL Fenster zeichnet.<br />
<br />
== Features ==<br />
<br />
* '''Allgemein'''<br />
o so/dll/dylib oder statisches Kompilieren von ZenGL gemeinsam mit der Applikation<br />
o Rendern in ein eigenes oder bereitgestelltes Fenster<br />
o Logging<br />
o Laden von Resourcen aus Dateien oder aus dem Speicher<br />
o Eine einfache Möglichkeit, Unterstützung für weitere Resourcen hinzuzufügen.<br />
* '''Einstellen von'''<br />
o Antialiasing, Bildschirmauflösung, Bildwiederholrate und Vertikaler Synchronisation<br />
o Aspect Correction<br />
o Titel, Position und Größe des Fensters<br />
o Sichtbarkeit des Cursors im Fenster<br />
* '''Eingabe'''<br />
o Keyboard, Maus und Joystick<br />
o Behandeln von Unicode Texteingabe<br />
o Möglichkeit, die Eingabe auf den ASCII Zeichensatz zu beschränken<br />
* '''Texturen'''<br />
o Unterstützung für '''tga''', '''png''' und '''jpg'''<br />
o Arbeitet korrekt mit NPOT Texturen<br />
o Kontrolle aller Filterparameter<br />
o Masking<br />
o ''Render Targets'', um auf Texturen zu rendern.<br />
* '''Text'''<br />
o texturierter Unicode-Font<br />
o Rendern von UTF-8 oder ANSI Text<br />
o Rendern von Text mit Ausrichtungen und anderen Optionen, wie Größe, Farbe, Anzahl der Zeichen<br />
* '''2D-Subsystem'''<br />
o ''batch render'' für High-Speed-Rendering<br />
o Rendern von verschiedenen "Primitives"<br />
o Sprite Engine<br />
o Rendern von statischen und animierten Sprites und Tiles (Kacheln)<br />
o rendering distortion grid<br />
o rendering sprites with new texture coordinates(with the pixel dimension and the usual 0..1)<br />
o control the blend mode and color mix mode<br />
o control the color and alpha of vertices of sprites and primitives<br />
o additional sprite transformations(flipping, zooming, vertices offset)<br />
o fast clipping of invisible sprites<br />
o 2D Kamera mit den Möglichkeiten zum Zoomen und Drehen. <br />
* '''Sound'''<br />
o arbeitet mit OpenAL oder DirectSound, basierend auf der Konfiguration des Betriebssystems<br />
o correct work without soundcard<br />
o unterstützt '''wav''' und '''ogg''' als Sounddateien<br />
o Abspielen von Audiodateien in einem separaten Thread<br />
o Kontrolle über Lautspärke und Abspielgeschwindigkeit<br />
o moving sound sources in 3D space<br />
* '''Math'''<br />
o Ein Satz zusätzlicher mathematischer Funktionen<br />
o triangulation functions<br />
o Kollisionsfunktionen<br />
* '''Zusätzlich'''<br />
o Lesen und Schreiben von INI-Files<br />
o Funktionen um mit Dateien im Speicher zu arbeiten<br />
<br />
== In der neuen Version ==<br />
<br />
*Die Kompilierung für Android für FPC 3.2.0 und höher wurde korrigiert.<br />
*Der Hauptcode wurde verschoben, um die Bibliothek zu korrigieren<br />
*Bearbeitete Arbeit mit Windows 64<br />
*Kleinere Fehler behoben<br />
*Bearbeitete Demoversionen (für iOS wurden Demos nicht korrigiert, Demoversionen für Lazarus, FPC und Delphi wurden überarbeitet)<br />
*Eingeführt von DEFINE<br />
**define - USE_EXIT_ESCAPE - exit. Jetzt müssen Sie keinen zusätzlichen Code schreiben, um das Programm durch Drücken der Escape-Taste zubeenden<br />
**definiere - USE_INIT_HANDLE - um ZenGL in einem bereits erstellten Fenster (LCL/VCL) zu verwenden<br />
*Unterstützung für macOS Cocoa eingeführt<br />
*Bearbeitete Arbeit mit Timern<br />
*Bearbeitete Arbeit mit Schriftarten<br />
*Bearbeitete Arbeit mit LCL/VCL<br />
<br />
[[Category:Components/de]]<br />
[[Category:Graphics/de]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/ru&diff=144288ZenGL/ru2021-04-03T07:17:30Z<p>Seenkao: </p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index/ru}}<br />
<br />
== О ZenGL ==<br />
<br />
'''ZenGL''' - кросс-платформенная библиотека, разработанная, чтобы обеспечить необходимый функционал для отрисовки двухмерных игр, обработки устройств ввода, воспроизведение звука и музыки.<br />
<br />
*'''Поддерживаемые ОС''': GNU/Linux(32/64), Windows(32/64), macOS(Carbon/Cocoa), iOS, Android 2.1+<br />
<br />
*'''Компиляторы''': Free Pascal, Delphi<br />
<br />
*'''Графические API''': OpenGL, OpenGL ES 1.x, Direct3D 8/9<br />
<br />
*'''Аудио API''': OpenAL, DirectSound<br />
<br />
*'''Лицензия''': [http://zengl.org/license.html zlib]<br />
<br />
В данное время библиотека дорабатывается.<br />
<br />
== Ссылки ==<br />
<br />
*[http://zengl.org/download.html Download ZenGL]<br />
*[http://zengl.org/extra.html Extra Downloads]<br />
*[http://zengl.org/ Домашняя страничка проекта]<br />
*[http://zengl.org/wiki Wiki]<br />
*[http://zengl.org/forum Официальный Форум]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL Новая версия]<br />
<br />
== Обучающие примеры ==<br />
<br />
'''Внимание!''' Все примеры содержатся в скачиваемой версии библиотеки (в новых версиях они могут незначительно, но критично для работы разрабатываемой программы, отличаться).<br />
<br />
[[ZenGL Tutorial]]: Первый пример для ZenGL знакомит с самой библиотекой. Рассказывается о том как скачать, установить библиотеку. Настроить компилятор (среду разработки) для компиляции проектов. Сборка проекта как статической так динамической библиотекой ZenGL. А так же рассматривается одна и программ-примеров 'Initialization', которая входит в библиотеку ZenGL.<br />
<br />
[[ZenGL Tutorial 2]]: Второй пример рассказывает о том, как создавать шрифты и выводить текст на экран.<br />
<br />
== Возможности библиотеки ==<br />
<br />
*Основные<br />
** библиотека может быть скомпилирована статически к проекту, или использоваться, как динамическая библиотека (в обновлённой версии только статическая компиляция)<br />
** рендеринг как в собственное, так и в заранее подготовленное окно (LCL, VCL)<br />
** журнал событий <br />
** загрузка ресурсов из файлов, памяти и '''zip''' архивов<br />
** многопоточная загрузка ресурсов<br />
** возможность расширить количество поддерживаемых форматов данных<br />
* Возможности настройки графики<br />
** Сглаживание (antialiasing), разрешение и частоту обновления экрана (screen resolution, refresh rate) а так же контролировать вертикальную синхронизацию (v-sync)<br />
** коррекция пропорций выводимого изображения относительно заданных размеров<br />
** управление заголовком и размером окна, наличие автоматического центрирования<br />
** управление видимостью курсора в пределах окна<br />
* Устройства ввода<br />
** обработка событий клавиатуры, мыши и джойстика<br />
** ввод Unicode символов<br />
** возможность ограничить ввод только латинской раскладкой<br />
*Вывод Текстур<br />
** поддержка форматов '''tga''', '''png''', '''jpg''' и '''pvr'''<br />
** поддержка текстур размером не кратным 2 (Non Power Of Two)<br />
** управление параметрами фильтрации<br />
** работа с масками<br />
** ''render targets'' отрисовка в текстуры<br />
*Вывод текста<br />
** реализация Unicode шрифты на основе текстур<br />
** вывод UTF-8 текста<br />
** управление отступами, размером, цветом вершин и количеством символов в тексте<br />
*2D подсистема<br />
** ''batch render'' для повышения производительности рендеринга<br />
** рендеринг основных видов примитивов<br />
** спрайтовый движок<br />
** вывод статических и анимированных спрайтов и тайлов<br />
** рендеринг трансформирующейся сетки<br />
** рендеринг спрайтов с ручным указанием текстурных координат(с пиксельной размерностью и обычным 0..1)<br />
** управление режимом блендинга и смешивания цвета<br />
** возможность назначения цвета и альфы отдельным вершинам спрайтов и примитивов<br />
** дополнительные трансформации спрайтов(зеркальное отражения, увеличение, смещение вершин)<br />
** быстрое отсечение спрайтов выходящих за пределы видимости<br />
** наличие 2D камеры с возможностью увеличения и поворота содержимого сцены<br />
* Звук<br />
** вывод звука с помощью библиотек OpenAL или DirectSound (зависит от настроек проекта и операционной системы)<br />
** возможность правильной работы, даже при отсутствии звуковой карты <br />
** поддержка форматов '''wav''' и 'ogg'''<br />
** потоковое воспроизведение аудио-файлов<br />
** контроль за громкостью звука и темпом воспроизведения<br />
** трехмерное позиционирование источника звука в пространстве<br />
* Видео<br />
** декодирование видео заставок в текстуры <br />
** поддержка кодека '''theora''' в формате '''ogv''' <br />
* Математический вычисление <br />
** базовый набор вспомогательных мат. функций<br />
** необходимый набор функций для триангуляции<br />
** простейшие функции проверки столкновений <br />
* Доплнительно<br />
** чтение и запись INI файлов<br />
** дополнительные функции для работы с файлами и памятью<br />
<br />
== В обновлённой версии ==<br />
<br />
*Корректирована компиляция под android под версию FPC 3.2.0 и выше.<br />
*Перебран основной код для коррекции работы библиотеки<br />
*Редактирована работа с Windows 64<br />
*Исправлены мелкие баги<br />
*Редактированы некоторые демо-версии (для FPC и iOS демки не правились, перебраны демо-версии для Lazarus и Delphi)<br />
*Введены дефайны<br />
** дефайн USE_EXIT_ESCAPE - выход. Возможность не писать дополнительный код для выхода из программы по нажатию клавиши Escape<br />
** дефайн USE_INIT_HANDLE - для использования ZenGL в уже созданное окно (LCL/VCL)<br />
*Введена поддержка MacOS Cocoa<br />
<br />
{{AutoCategory}}<br />
[[Category:Components/ru]]<br />
[[Category:Graphics/ru]]<br />
[[Category:Audio/ru]]<br />
[[Category:Video/ru]]<br />
[[Category:Multimedia/ru]]<br />
[[Category:Game Development/ru]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/ru&diff=143859ZenGL/ru2021-03-08T20:15:55Z<p>Seenkao: </p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index/ru}}<br />
<br />
== О ZenGL ==<br />
<br />
'''ZenGL''' - кросс-платформенная библиотека, разработанная, чтобы обеспечить необходимый функционал для отрисовки двухмерных игр, обработки устройств ввода, воспроизведение звука и музыки.<br />
<br />
*'''Поддерживаемые ОС''': GNU/Linux(32/64), Windows(32/64), macOS(Carbon/Cocoa), iOS, Android 2.1+<br />
<br />
*'''Компиляторы''': Free Pascal, Delphi<br />
<br />
*'''Графические API''': OpenGL, OpenGL ES 1.x, Direct3D 8/9<br />
<br />
*'''Аудио API''': OpenAL, DirectSound<br />
<br />
*'''Лицензия''': [http://zengl.org/license.html zlib]<br />
<br />
В данное время библиотека дорабатывается.<br />
<br />
== Ссылки ==<br />
<br />
*[http://zengl.org/download.html Download ZenGL]<br />
*[http://zengl.org/extra.html Extra Downloads]<br />
*[http://zengl.org/ Домашняя страничка проекта]<br />
*[http://zengl.org/wiki Wiki]<br />
*[http://zengl.org/forum Официальный Форум]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL Новая версия]<br />
<br />
== Обучающие примеры ==<br />
<br />
'''Внимание!''' Все примеры содержатся в скачиваемой версии библиотеки. На данное время это актуально для всех версий ZenGL.<br />
<br />
[[ZenGL Tutorial]]: Первый пример для ZenGL знакомит с самой библиотекой. Рассказывается о том как скачать, установить библиотеку. Настроить компилятор (среду разработки) для компиляции проектов. Сборка проекта как статической так динамической библиотекой ZenGL. А так же рассматривается одна и программ-примеров 'Initialization', которая входит в библиотеку ZenGL.<br />
<br />
[[ZenGL Tutorial 2]]: Второй пример рассказывает о том, как создавать шрифты и выводить текст на экран.<br />
<br />
== Возможности библиотеки ==<br />
<br />
*Основные<br />
** библиотека может быть скомпилирована статически к проекту, или использоваться, как динамическая библиотека (в обновлённой версии только статическая компиляция)<br />
** рендеринг как в собственное, так и в заранее подготовленное окно (LCL, VCL)<br />
** журнал событий <br />
** загрузка ресурсов из файлов, памяти и '''zip''' архивов<br />
** многопоточная загрузка ресурсов<br />
** возможность расширить количество поддерживаемых форматов данных<br />
* Возможности настройки графики<br />
** Сглаживание (antialiasing), разрешение и частоту обновления экрана (screen resolution, refresh rate) а так же контролировать вертикальную синхронизацию (v-sync)<br />
** коррекция пропорций выводимого изображения относительно заданных размеров<br />
** управление заголовком и размером окна, наличие автоматического центрирования<br />
** управление видимостью курсора в пределах окна<br />
* Устройства ввода<br />
** обработка событий клавиатуры, мыши и джойстика<br />
** ввод Unicode символов<br />
** возможность ограничить ввод только латинской раскладкой<br />
*Вывод Текстур<br />
** поддержка форматов '''tga''', '''png''', '''jpg''' и '''pvr'''<br />
** поддержка текстур размером не кратным 2 (Non Power Of Two)<br />
** управление параметрами фильтрации<br />
** работа с масками<br />
** ''render targets'' отрисовка в текстуры<br />
*Вывод текста<br />
** реализация Unicode шрифты на основе текстур<br />
** вывод UTF-8 текста<br />
** управление отступами, размером, цветом вершин и количеством символов в тексте<br />
*2D подсистема<br />
** ''batch render'' для повышения производительности рендеринга<br />
** рендеринг основных видов примитивов<br />
** спрайтовый движок<br />
** вывод статических и анимированных спрайтов и тайлов<br />
** рендеринг трансформирующейся сетки<br />
** рендеринг спрайтов с ручным указанием текстурных координат(с пиксельной размерностью и обычным 0..1)<br />
** управление режимом блендинга и смешивания цвета<br />
** возможность назначения цвета и альфы отдельным вершинам спрайтов и примитивов<br />
** дополнительные трансформации спрайтов(зеркальное отражения, увеличение, смещение вершин)<br />
** быстрое отсечение спрайтов выходящих за пределы видимости<br />
** наличие 2D камеры с возможностью увеличения и поворота содержимого сцены<br />
* Звук<br />
** вывод звука с помощью библиотек OpenAL или DirectSound (зависит от настроек проекта и операционной системы)<br />
** возможность правильной работы, даже при отсутствии звуковой карты <br />
** поддержка форматов '''wav''' и 'ogg'''<br />
** потоковое воспроизведение аудио-файлов<br />
** контроль за громкостью звука и темпом воспроизведения<br />
** трехмерное позиционирование источника звука в пространстве<br />
* Видео<br />
** декодирование видео заставок в текстуры <br />
** поддержка кодека '''theora''' в формате '''ogv''' <br />
* Математический вычисление <br />
** базовый набор вспомогательных мат. функций<br />
** необходимый набор функций для триангуляции<br />
** простейшие функции проверки столкновений <br />
* Доплнительно<br />
** чтение и запись INI файлов<br />
** дополнительные функции для работы с файлами и памятью<br />
<br />
== В обновлённой версии ==<br />
<br />
*Корректирована компиляция под android под версию FPC 3.2.0 и выше.<br />
*Перебран основной код для коррекции работы библиотеки<br />
*Редактирована работа с Windows 64<br />
*Исправлены мелкие баги<br />
*Редактированы некоторые демо-версии (для FPC и iOS демки не правились, перебраны демо-версии для Lazarus и Delphi)<br />
*Введены дефайны<br />
** дефайн USE_EXIT_ESCAPE - выход. Возможность не писать дополнительный код для выхода из программы по нажатию клавиши Escape<br />
** дефайн USE_INIT_HANDLE - для использования ZenGL в уже созданное окно (LCL/VCL)<br />
*Введена поддержка MacOS Cocoa<br />
<br />
{{AutoCategory}}<br />
[[Category:Components/ru]]<br />
[[Category:Graphics/ru]]<br />
[[Category:Audio/ru]]<br />
[[Category:Video/ru]]<br />
[[Category:Multimedia/ru]]<br />
[[Category:Game Development/ru]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL&diff=143858ZenGL2021-03-08T20:14:43Z<p>Seenkao: </p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index}}<br />
<br />
== Main ==<br />
<br />
'''ZenGL''' - a cross-platform game development library, designed to provide necessary functionality for rendering 2D graphics, handling input, sound output, etc.<br />
<br />
*'''Supported OS''': GNU/Linux, Windows, macOS, iOS, Android 2.1+<br />
<br />
*'''Supported compilers''': Free Pascal, Delphi<br />
<br />
*'''Graphics API''': OpenGL, OpenGL ES 1.x, Direct3D 8/9<br />
<br />
*'''Sound API''': OpenAL, DirectSound<br />
<br />
*'''License''': [http://zengl.org/license.html zlib]<br />
<br />
The library is currently being finalized.<br />
<br />
== Links ==<br />
<br />
*[http://zengl.org/download.html Download ZenGL]<br><br />
*[https://github.com/andru-kun/zengl ZenGL Mirror on GitHub]<br />
*[http://zengl.org/extra.html Extra Downloads]<br />
*[http://zengl.org/ Homepage]<br><br />
*[http://zengl.org/wiki Wiki]<br><br />
*[http://zengl.org/forum Official forum]<br><br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/thecocce/steamwrapper ZenGL on Steam]<br />
---<br />
*[https://github.com/Seenkao/New-ZenGL A new version]<br />
<br />
== Tutorial ==<br />
<br />
'''Attention!''' All examples are contained in the downloaded version of the library. At this time, this is relevant for all versions of ZenGL.<br />
These tutorials are not fully compatible with the latest version of ZenGL.<br />
<br />
[[ZenGL Tutorial]]: This is a first tutorial for ZenGL: download, installation, source paths, compilation (statically or with so/dll/dylib) (Windows dll), and the First program 'Initialization' that comes with ZenGL.<br />
<br />
[[ZenGL Tutorial 2]]: This is the second tutorial on how to create a font and draw text in the window.<br />
<br />
== Features ==<br />
<br />
* '''Main'''<br />
o can be used as so/dll/dylib or statically compiled with your application <br />
o rendering to own or any other prepared window<br />
o logging<br />
o resource loading from files, memory and '''zip''' archives<br />
o multithreaded resource loading<br />
o easy way to add support for new resource format<br />
* '''Configuration of'''<br />
o antialiasing, screen resolution, refresh rate and vertical synchronization<br />
o aspect correction<br />
o title, position and size of window<br />
o cursor visibility in window space<br />
* '''Input'''<br />
o handling of keyboard, mouse and joystick input<br />
o handling of Unicode text input<br />
o possibility to restrict the input to the Latin alphabet<br />
* '''Textures'''<br />
o supports '''tga''', '''png''', '''jpg''' and '''pvr'''<br />
o correct work with NPOT textures<br />
o control the filter parameters<br />
o masking<br />
o ''render targets'' for rendering into texture<br />
* '''Text'''<br />
o textured Unicode font<br />
o rendering UTF-8 text<br />
o rendering text with alignment and other options like size, color and count of symbols<br />
* '''2D subsystem'''<br />
o ''batch render'' for high-speed rendering<br />
o rendering different primitives<br />
o sprite engine<br />
o rendering static and animated sprites and tiles<br />
o rendering distortion grid<br />
o rendering sprites with new texture coordinates (with the pixel dimension and the usual 0..1)<br />
o control the blend mode and color mix mode<br />
o control the color and alpha of vertices of sprites and primitives<br />
o additional sprite transformations (flipping, zooming, vertices offset)<br />
o fast clipping of invisible sprites<br />
o 2D camera with ability to zoom and rotate the scene<br />
* '''Sound'''<br />
o works through OpenAL or DirectSound; depends on configuration or OS<br />
o correct work without soundcard<br />
o supports '''wav''' and '''ogg''' as sound sample formats<br />
o playing audio files in separate thread<br />
o control volume and playback speed<br />
o moving sound sources in 3D space<br />
* '''Video'''<br />
o decoding video frames into texture<br />
o supports '''theora''' codec in '''ogv''' container<br />
* '''Math'''<br />
o basic set of additional math functions<br />
o triangulation functions<br />
o basic set of collision functions<br />
* '''Additional'''<br />
o reading and writing INI files<br />
o functions for working with files and memory<br />
<br />
== In the updated version ==<br />
<br />
'''Attention!''' Basic information in Russian! Thank you for understanding.<br />
* Corrected compilation for android for FPC 3.2.0 and higher.<br />
* Moved the main code to correct the library<br />
* Edited work with Windows 64<br />
* Fixed minor bugs<br />
* Edited some demo versions (for FPC and iOS demos were not corrected, demo versions for Lazarus and Delphi were revised)<br />
* Introduced defines<br />
** define USE_EXIT_ESCAPE - exit. Ability not to write additional code to exit the program by pressing the Escape key<br />
** USE_INIT_HANDLE definition - for using ZenGL in an already created window (LCL/VCL)<br />
* Introduced support for MacOS Cocoa<br />
<br />
[[Category:Components]]<br />
[[Category:Graphics]]<br />
[[Category:Audio]]<br />
[[Category:Multimedia]]<br />
[[Category:Video]]<br />
[[Category:Game Development]]<br />
[[Category:Games]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL&diff=143857ZenGL2021-03-08T20:09:01Z<p>Seenkao: </p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index}}<br />
<br />
== Main ==<br />
<br />
ZenGL - a cross-platform game development library, designed to provide necessary functionality for rendering 2D graphics, handling input, sound output, etc.<br />
<br />
'''Supported OS''': GNU/Linux, Windows, macOS, iOS, Android 2.1+<br />
<br />
'''Supported compilers''': Free Pascal, Delphi<br />
<br />
'''Graphics API''': OpenGL, OpenGL ES 1.x, Direct3D 8/9<br />
<br />
'''Sound API''': OpenAL, DirectSound<br />
<br />
'''License''': [http://zengl.org/license.html zlib]<br />
<br />
The library is currently being finalized.<br />
<br />
== Links ==<br />
<br />
*[http://zengl.org/download.html Download ZenGL]<br><br />
*[https://github.com/andru-kun/zengl ZenGL Mirror on GitHub]<br />
*[http://zengl.org/extra.html Extra Downloads]<br />
*[http://zengl.org/ Homepage]<br><br />
*[http://zengl.org/wiki Wiki]<br><br />
*[http://zengl.org/forum Official forum]<br><br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/thecocce/steamwrapper ZenGL on Steam]<br />
---<br />
*[https://github.com/Seenkao/New-ZenGL A new version]<br />
<br />
== Tutorial ==<br />
<br />
'''Warning!''' All examples are contained in the downloaded version of the library. At this time, this is relevant for all versions of ZenGL.<br />
These tutorials are not fully compatible with the latest version of ZenGL.<br />
<br />
[[ZenGL Tutorial]]: This is a first tutorial for ZenGL: download, installation, source paths, compilation (statically or with so/dll/dylib) (Windows dll), and the First program 'Initialization' that comes with ZenGL.<br />
<br />
[[ZenGL Tutorial 2]]: This is the second tutorial on how to create a font and draw text in the window.<br />
<br />
== Features ==<br />
<br />
* '''Main'''<br />
o can be used as so/dll/dylib or statically compiled with your application <br />
o rendering to own or any other prepared window<br />
o logging<br />
o resource loading from files, memory and '''zip''' archives<br />
o multithreaded resource loading<br />
o easy way to add support for new resource format<br />
* '''Configuration of'''<br />
o antialiasing, screen resolution, refresh rate and vertical synchronization<br />
o aspect correction<br />
o title, position and size of window<br />
o cursor visibility in window space<br />
* '''Input'''<br />
o handling of keyboard, mouse and joystick input<br />
o handling of Unicode text input<br />
o possibility to restrict the input to the Latin alphabet<br />
* '''Textures'''<br />
o supports '''tga''', '''png''', '''jpg''' and '''pvr'''<br />
o correct work with NPOT textures<br />
o control the filter parameters<br />
o masking<br />
o ''render targets'' for rendering into texture<br />
* '''Text'''<br />
o textured Unicode font<br />
o rendering UTF-8 text<br />
o rendering text with alignment and other options like size, color and count of symbols<br />
* '''2D subsystem'''<br />
o ''batch render'' for high-speed rendering<br />
o rendering different primitives<br />
o sprite engine<br />
o rendering static and animated sprites and tiles<br />
o rendering distortion grid<br />
o rendering sprites with new texture coordinates (with the pixel dimension and the usual 0..1)<br />
o control the blend mode and color mix mode<br />
o control the color and alpha of vertices of sprites and primitives<br />
o additional sprite transformations (flipping, zooming, vertices offset)<br />
o fast clipping of invisible sprites<br />
o 2D camera with ability to zoom and rotate the scene<br />
* '''Sound'''<br />
o works through OpenAL or DirectSound; depends on configuration or OS<br />
o correct work without soundcard<br />
o supports '''wav''' and '''ogg''' as sound sample formats<br />
o playing audio files in separate thread<br />
o control volume and playback speed<br />
o moving sound sources in 3D space<br />
* '''Video'''<br />
o decoding video frames into texture<br />
o supports '''theora''' codec in '''ogv''' container<br />
* '''Math'''<br />
o basic set of additional math functions<br />
o triangulation functions<br />
o basic set of collision functions<br />
* '''Additional'''<br />
o reading and writing INI files<br />
o functions for working with files and memory<br />
<br />
== In the updated version ==<br />
<br />
* Corrected compilation for android for FPC 3.2.0 and higher.<br />
* Moved the main code to correct the library<br />
* Edited work with Windows 64<br />
* Fixed minor bugs<br />
* Edited some demo versions (for FPC and iOS demos were not corrected, demo versions for Lazarus and Delphi were revised)<br />
* Introduced defines<br />
** define USE_EXIT_ESCAPE - exit. Ability not to write additional code to exit the program by pressing the Escape key<br />
** USE_INIT_HANDLE definition - for using ZenGL in an already created window (LCL/VCL)<br />
* Introduced support for MacOS Cocoa<br />
<br />
[[Category:Components]]<br />
[[Category:Graphics]]<br />
[[Category:Audio]]<br />
[[Category:Multimedia]]<br />
[[Category:Video]]<br />
[[Category:Game Development]]<br />
[[Category:Games]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/ru&diff=140850ZenGL/ru2020-10-31T00:04:46Z<p>Seenkao: </p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index/ru}}<br />
<br />
<br />
ZenGL - кросс-платформенная библиотека, разработанная, чтобы обеспечить необходимый функционал для отрисовки двухмерных игр, обработки устройств ввода, воспроизведение звука и музыки.<br />
<br />
'''Поддерживаемые ОС''': GNU/Linux(32/64), Windows(32/64), macOS(Carbon), iOS, Android 2.1+<br />
<br />
'''Компиляторы''': Free Pascal, Delphi<br />
<br />
'''Графические API''': OpenGL, OpenGL ES 1.x, Direct3D 8/9<br />
<br />
'''Аудио API''': OpenAL, DirectSound<br />
<br />
'''Лицензия''': [http://zengl.org/license.html zlib]<br />
<br />
В данное время библиотека дорабатывается.<br />
<br />
== Ссылки ==<br />
<br />
*[http://zengl.org/download.html Download ZenGL]<br />
*[http://zengl.org/extra.html Extra Downloads]<br />
*[http://zengl.org/ Домашняя страничка проекта]<br />
*[http://zengl.org/wiki Wiki]<br />
*[http://zengl.org/forum Официальный Форум]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
*[https://github.com/Seenkao/New-ZenGL Новая версия]<br />
<br />
== Обучающие примеры ==<br />
<br />
'''Внимание!''' Все примеры содержатся в скачиваемой версии библиотеки. На данное время это актуально для всех версий ZenGL.<br />
<br />
[[ZenGL Tutorial]]: Первый пример для ZenGL знакомит с самой библиотекой. Рассказывается о том как скачать, установить библиотеку. Настроить компилятор (среду разработки) для компиляции проектов. Сборка проекта как статической так динамической библиотекой ZenGL. А так же рассматривается одна и программ-примеров 'Initialization', которая входит в библиотеку ZenGL.<br />
<br />
[[ZenGL Tutorial 2]]: Второй пример рассказывает о том, как создавать шрифты и выводить текст на экран.<br />
<br />
== Возможности библиотеки ==<br />
<br />
*Основные<br />
** библиотека может быть скомпилирована статически к проекту, или использоваться, как динамическая библиотека (в обновлённой версии только статическая компиляция)<br />
** рендеринг как в собственное, так и в заранее подготовленное окно (LCL, VCL)<br />
** журнал событий <br />
** загрузка ресурсов из файлов, памяти и '''zip''' архивов<br />
** многопоточная загрузка ресурсов<br />
** возможность расширить количество поддерживаемых форматов данных<br />
* Возможности настройки графики<br />
** Сглаживание (antialiasing), разрешение и частоту обновления экрана (screen resolution, refresh rate) а так же контролировать вертикальную синхронизацию (v-sync)<br />
** коррекция пропорций выводимого изображения относительно заданных размеров<br />
** управление заголовком и размером окна, наличие автоматического центрирования<br />
** управление видимостью курсора в пределах окна<br />
* Устройства ввода<br />
** обработка событий клавиатуры, мыши и джойстика<br />
** ввод Unicode символов<br />
** возможность ограничить ввод только латинской раскладкой<br />
*Вывод Текстур<br />
** поддержка форматов '''tga''', '''png''', '''jpg''' и '''pvr'''<br />
** поддержка текстур размером не кратным 2 (Non Power Of Two)<br />
** управление параметрами фильтрации<br />
** работа с масками<br />
** ''render targets'' отрисовка в текстуры<br />
*Вывод текста<br />
** реализация Unicode шрифты на основе текстур<br />
** вывод UTF-8 текста<br />
** управление отступами, размером, цветом вершин и количеством символов в тексте<br />
*2D подсистема<br />
** ''batch render'' для повышения производительности рендеринга<br />
** рендеринг основных видов примитивов<br />
** спрайтовый движок<br />
** вывод статических и анимированных спрайтов и тайлов<br />
** рендеринг трансформирующейся сетки<br />
** рендеринг спрайтов с ручным указанием текстурных координат(с пиксельной размерностью и обычным 0..1)<br />
** управление режимом блендинга и смешивания цвета<br />
** возможность назначения цвета и альфы отдельным вершинам спрайтов и примитивов<br />
** дополнительные трансформации спрайтов(зеркальное отражения, увеличение, смещение вершин)<br />
** быстрое отсечение спрайтов выходящих за пределы видимости<br />
** наличие 2D камеры с возможностью увеличения и поворота содержимого сцены<br />
* Звук<br />
** вывод звука с помощью библиотек OpenAL или DirectSound (зависит от настроек проекта и операционной системы)<br />
** возможность правильной работы, даже при отсутствии звуковой карты <br />
** поддержка форматов '''wav''' и 'ogg'''<br />
** потоковое воспроизведение аудио-файлов<br />
** контроль за громкостью звука и темпом воспроизведения<br />
** трехмерное позиционирование источника звука в пространстве<br />
* Видео<br />
** декодирование видео заставок в текстуры <br />
** поддержка кодека '''theora''' в формате '''ogv''' <br />
* Математический вычисление <br />
** базовый набор вспомогательных мат. функций<br />
** необходимый набор функций для триангуляции<br />
** простейшие функции проверки столкновений <br />
* Доплнительно<br />
** чтение и запись INI файлов<br />
** дополнительные функции для работы с файлами и памятью<br />
<br />
== В обновлённой версии ==<br />
<br />
*Корректирована компиляция под android под версию FPC 3.2.0 и выше.<br />
*Перебран основной код для коррекции работы библиотеки<br />
*Редактирована работа с Windows 64<br />
*Исправлены мелкие баги<br />
*Редактированы некоторые демо-версии (для FPC и iOS демки не правились, перебраны демо-версии для Lazarus и Delphi)<br />
*Введены дефайны<br />
** дефайн USE_EXIT_ESCAPE - выход. Возможность не писать дополнительный код для выхода из программы по нажатию клавиши Escape<br />
** дефайн USE_INIT_HANDLE - для использования ZenGL в уже созданное окно (LCL, VCL)<br />
<br />
{{AutoCategory}}<br />
[[Category:Components/ru]]<br />
[[Category:Graphics/ru]]<br />
[[Category:Audio/ru]]<br />
[[Category:Video/ru]]<br />
[[Category:Multimedia/ru]]<br />
[[Category:Game Development/ru]]</div>Seenkaohttps://wiki.freepascal.org/index.php?title=ZenGL/ru&diff=140848ZenGL/ru2020-10-30T23:13:54Z<p>Seenkao: </p>
<hr />
<div>{{ZenGL}}<br />
<br />
{{ZenGL Tutorial Index/ru}}<br />
<br />
<br />
ZenGL - кросс-платформенная библиотека, разработанная, чтобы обеспечить необходимый функционал для отрисовки двухмерных игр, обработки устройств ввода, воспроизведение звука и музыки.<br />
<br />
'''Поддерживаемые ОС''': GNU/Linux(32/64), Windows(32/64), macOS(Carbon), iOS, Android 2.1+<br />
<br />
'''Компиляторы''': FreePascal, Delphi<br />
<br />
'''Графические API''': OpenGL, OpenGL ES 1.x, Direct3D 8/9<br />
<br />
'''Аудио API''': OpenAL, DirectSound<br />
<br />
'''Лицензия''': [http://zengl.org/license.html zlib]<br />
<br />
== Ссылки ==<br />
<br />
*[http://zengl.org/download.html Download ZenGL]<br />
*[http://zengl.org/extra.html Extra Downloads]<br />
*[http://zengl.org/ Домашняя страничка проекта]<br />
*[http://zengl.org/wiki Wiki]<br />
*[http://zengl.org/forum Официальный Форум]<br />
*[http://code.google.com/p/zengl/issues/list Bugtracker]<br />
<br />
== Обучающие примеры ==<br />
<br />
[[ZenGL Tutorial]]: Первый пример для ZenGL знакомит с самой библиотекой. Рассказывается о том как скачать, установить библиотеку. Настроить компилятор (среду разработки) для компиляции проектов. Сборка проекта как статической так динамической библиотекой ZenGL. А так же рассматривается одна и программ-примеров 'Initialization', которая входит в библиотеку ZenGL.<br />
<br />
[[ZenGL Tutorial 2]]: Второй пример рассказывает о том, как создавать шрифты и выводить текст на экран.<br />
<br />
== Возможности библиотеки ==<br />
<br />
*Основные<br />
** библиотека может быть скомпилирована статически к проекту, или использоваться, как динамическая библиотека<br />
** вывод графики в окно, созданное самой библиотекой, так и внешним кодом<br />
** журнал событий <br />
** загрузка ресурсов из файлов, памяти и '''zip''' архивов<br />
** многопоточная загрузка ресурсов<br />
** лёгки способ добавления новых форматов ресурсов<br />
* Возможности настройки графики<br />
** Сглаживание (antialiasing), разрешение и частоту обновления экрана (screen resolution, refresh rate) а так же контролировать вертикальную синхронизацию (v-sync)<br />
** aspect correction<br />
** изменять заголовок, позицию и размер окна <br />
** коcursor visibility in window space<br />
* Устройства ввода<br />
** чтение данных от клавиатуры, мышки и джойстика<br />
** ввод Unicode символов<br />
** возможность ограничить ввод только латинской раскладки<br />
*Вывод Текстур<br />
** поддержка форматов '''tga''', '''png''', '''jpg''' и '''pvr'''<br />
** поддержка текстур размером не кратным 2 (Non Power Of Two)<br />
** control the filter parameters<br />
** masking<br />
** ''render targets'' отрисовка в текстуры<br />
*Вывод текста<br />
** реализация Unicode шрифты на основе текстур<br />
** вывод UTF-8 текста<br />
** rendering text with alignment and other options like size, color and count of symbols<br />
*2D подсистему<br />
** ''batch render'' for high-speed rendering<br />
** отрисовка различных видов примитивов<br />
** спрайтовый движок<br />
** вывод статических и анимированных спрайтов и тайлов<br />
** rendering distortion grid<br />
** rendering sprites with new texture coordinates (with the pixel dimension and the usual 0..1)<br />
** control the blend mode and color mix mode<br />
** control the color and alpha of vertices of sprites and primitives<br />
** additional sprite transformations (flipping, zooming, vertices offset)<br />
** fast clipping of invisible sprites<br />
** 2D camera with ability to zoom and rotate the scene<br />
* Звук<br />
** вывод звука с помощью библиотек OpenAL или DirectSound (зависит от настроек проекта и операционной системы)<br />
** возможность правильной работы, даже при отсутствии звуковой карты <br />
** поддержка форматов '''wav''' и 'ogg'''<br />
** воспроизведение файлов во вспомогательных потоках<br />
** контроль за громкостью звука и темпом воспроизведения<br />
** перемещение источников звука в 3D пространстве<br />
* Видео<br />
** декодирование видео заставок в текстуры <br />
** поддержка кодека '''theora''' в формате '''ogv''' <br />
* Математический вычисление <br />
** дополнительные математические функции<br />
** тригонометрические функции<br />
** простейшие функции проверки столкновений <br />
* И ещё!<br />
** чтение и запись INI файлов<br />
** дополнительные функции для работы с файлами и памятью<br />
<br />
{{AutoCategory}}<br />
[[Category:Components/ru]]<br />
[[Category:Graphics/ru]]<br />
[[Category:Audio/ru]]<br />
[[Category:Video/ru]]<br />
[[Category:Multimedia/ru]]<br />
[[Category:Game Development/ru]]</div>Seenkao