... just wondering about graphics libraries -- what to use? How to install?
You can do it the hard way or you can choose to do it the easy way. I know some users are 'alergic' to use Lazarus. If you do not want use Lazarus IDE, you can skip all this post.
Short answer:Use Lazarus
Long answer:Instal Lazarus. There, when you start a new application project, Lazarus will automatically configure all the basic things you need to do simple graphics. The easiest is
TCanvas (and TBitmap). It is in the
Graphics unit, which will be added into your uses clauses by the IDE automatically, so you can start doing graphics right away.
Sooner or later you will know TCanvas is slow, not suitable for real graphics projects or games. For serious usage, you should consider the others:
https://wiki.freepascal.org/Graphics_librarieshttps://wiki.freepascal.org/Developing_with_Graphics#See_alsoBGRABitmap is very feature-rich, it has properly written tutorials. It has a few 3D features, which are hardware accelerated as far as I know. But most of the other functions are as slow as TCanvas/TBitmap.
For general purpose non-3D graphics, I recommend
Graphics32. It is many times faster, this is the quote from Wikipedia:
Graphics32 provides fast operations for pixels and graphic primitives and is almost a hundred times faster in per-pixel and about 2–5 times faster in drawing lines access than the standard components by Embarcadero which are wrappers for the Windows GDI. Additionally, it provides alpha blending, anti-aliasing as well as filters for resampling and deforming bitmaps.
Do you want to write games? If yes, you really should consider these:
https://wiki.freepascal.org/Game_EngineFor game programming, I recommend
Castle Game Engine and
ZenGL. I ever tried Castle Game Engine, it is actively developed and the support is good. ZenGL is not actively developed anymore but the maintainer can be found here in this forum.
GLScene is an interesting project. Unfortunately it has some minor issues on Linux because the main development is on Windows.
If performance is important and you like doing something challenging, try
OpenGL or
DirectX. You will get the maximum performance the hardware can offer.
I really recommend using Lazarus. Because Lazarus has
Online Package Manager, which will help you install other packages easily. Some beginners have problem installing third party packages or libraries. Using Online Package Manager, you can do it easily:
Lazarus main menu >
Packages >
Online Package ManagerAlso after Lazarus default installation, you will get plenty of graphics related components:
TCanvas,
TBitmap,
TPicture,
TJPEGImage,
TPortableNetworkGraphic,
TFont, TShape,
TPaintBox,
TOpenGLControl (not enabled by default). All the recently mentioned graphics components won't work by simply putting their unit names on the uses clause, if you use FPC only. Here, you need Lazarus to do the 'magic' for you.
You still can do graphics using FPC without Lazarus, but you're doing it the hard way.