Skip to content
  • English
  • Polski
Digital Karabela
Digital Karabela
Primary Navigation Menu
Menu
  • Home
  • Products
  • DevBlog
  • Castle Engine
  • About

For some time I’ve been watching the Castle Game Engine development. This is a game engine written in ObjectPascal language. I have worked many years in this language so I have a certain sentiment. Object Pascal has simple, clear syntax and very short compile times. This features should be very helpful in game development.

Unfortunately I ran into a minor problem. Closing a window of each example stops execution and throws exception. It was weird so I decided to investigate. I tested on many computers with different operating systems.

Linux problem (Nvidia)

It turned out that the problem only occurs on Linux computers with Nvidia graphics cards (I tested GTX 1060, GTX 650, GT 710). On the Intel or AMD cards, everything was fine. Changing the drivers from version 390 to 396 or 430 did not help.

Subsequent tests showed that the problem also concerns examples of using OpenGL in Lazarus (eg openglcontrol_demo) which meant that the error is not in the engine!

The problem was in used Free Pascal compiler version. For testing, I used the compiler in version 3.0.4. As of 18/05/2019, the compilation from the fixes_3_0 branch did not work. The problem disappeared after updating the compiler to the version from the fixes_3_2 branch. So if you plan to write a game or application for Linux that uses OpenGL. Use the unpublished version 3.2. You can read more about fixes_3_2 branch here.

How to update the compiler

It’s best to use the fpcupdeluxe program, which automates the process to a few clicks.

Dependencies

Your operating system must have subversion installed, and GTK2, GtkGLExt libraries with developer packages (-dev). In debian/ubuntu based systems, you can do this:

sudo apt install subversion libgtk2.0-dev libgtkglext1-dev

No pascal compiler is needed in your OS, fpcupdeluxe will download all needed files. If you already have the fpc compiler installed, you can safely remove it (including the Lazarus).

Folders

After using the fpcupdeluxe utility, it will create several configuration files next to the executable file, so it is worth copying it to a folder. Personally, I prefer the fpc folder in the home directory. The fpcupdeluxe program allows you to install many different compiler/lazarus versions side by side. Each such version is installed as a separate subfolder. We can easily have a stable version and fixes next to each other, eg:

  • ~/fpc/stable – stable versions of FPC and Lazarus
  • ~/fpc/fixes32 – FPC from fixes_3_2 branch and stable version of Lazarus

Installing FPC and Lazarus

After running fpcupdeluxe, the following window will appear:

fcupdeluxe window
fcupdeluxe window

In the window, select the installation folder (eg /home/user/fpc/fixes32), the version of the compiler (fixes3.2) and lazarus (stable). Next click “Install/update FPC + Laz”.

After installation, the Lazarus_name_of_folder icon will appear on the desktop (in our case it’s Lazarus_fixes32). From this link you should run Lazarus.

Access to the compiler from the console

To access the compiler from the console, add the executable files folders to the PATH variable and the compiler configuration folder to the PPC_CONFIG_PATH variable:

export PATH="/home/user/fpc/fixes32/fpc/bin/x86_64-linux:${PATH}"
export PPC_CONFIG_PATH="/home/user/fpc/fixes32/fpc/bin/x86_64-linux"

The above lines can be added to the .profile file. Changes will be available after user’s relogin.

If you want to use many versions of the compiler, you can write a bash script:

#!/bin/sh
export PATH="/home/user/fpc/fixes32/fpc/bin/x86_64-linux:${PATH}"
export PPC_CONFIG_PATH="/home/user/fpc/fixes32/fpc/bin/x86_64-linux"

That’s all, examples compiled with this version of the compiler (fixes3.2) will work correctly on all linux machines.

2019-05-18
On May 18, 2019
In Castle Game Engine, GameDev, Lazarus, Object Pascal
Tagged castleengine, freepascal, lazarus, opengl
Previous Post: Godot 3.1.1 – Important fixes for networking, mobile games and new audio features
Next Post: Mingw-w64: How to fix “File too big/too many sections”

Try my new game! Free to play!

Logo Bricks Color Pick

Bricks Color Pick is a completely new approach to classic Arkanoid! No paddle! Now your goal is to switch the color of the ball to the color of the brick.

Get it from Google Play

Level 37/40 5-6 Colors Screenshot

You can also change ball movement direction by the button in top left corner.

QR Code Google Play Bricks Color Pick

Level 62/80 (RelaxMode) Screenshot

Recent Posts

  • How to compile OpenAL library for Android with Oboe library.
  • Lazarus 2.0.12 Released
  • How to Fix LMMS GUI Freezing on Linux?
  • How to update wine to 5.0.0 on Linux Mint 19 or Ubuntu 18?
  • Agile Commander 1.2.3 Released!

Categories

  • DevBlog
  • GameDev
    • Castle Game Engine
    • Godot Engine
  • Linux
  • Programming
    • Dlang
      • DlangUI
    • Object Pascal
      • Lazarus
  • Promotion

Products:
Agile Commander
Bricks Color Pick

 

 

Digital Karabela – Andrzej Kilijański
76-015 Wyszebórz 32, Poland
https://digitalkarabela.com
Contact
Privacy Policy