# Render 3D and 2D games inside Delphi VCL and FMX forms using TCastleControl

**URL:** https://forum.castle-engine.io/t/render-3d-and-2d-games-inside-delphi-vcl-and-fmx-forms-using-tcastlecontrol/794
**Category:** News
**Created:** [April 16, 2023, 9:25am UTC](https://forum.castle-engine.io/t/render-3d-and-2d-games-inside-delphi-vcl-and-fmx-forms-using-tcastlecontrol/794 "2023-04-16T09:25:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)
#### Post date: [April 16, 2023, 9:25am UTC](https://forum.castle-engine.io/t/render-3d-and-2d-games-inside-delphi-vcl-and-fmx-forms-using-tcastlecontrol/794/1 "2023-04-16T09:25:04Z")

</div>

| [![Castle Game Engine 3D in Delphi FMX form](https://forum.castle-engine.io/uploads/default/original/2X/2/26cfef3210c03bc58f9dfa5fb3ce61a0ab79c75e.png)](https://castle-engine.io/wp/wp-content/uploads/2023/04/delphi_fmx_3.png "Castle Game Engine 3D in Delphi FMX form") |
| [![Castle Game Engine 2D animation in Delphi VCL form](https://forum.castle-engine.io/uploads/default/original/2X/f/f93c1b865eff82d68e18e3ceb941a2a0cf315af3.png)](https://castle-engine.io/wp/wp-content/uploads/2023/04/delphi_vcl_1.png "Castle Game Engine 2D animation in Delphi VCL form") |
| [![Castle Game Engine 3D in Delphi VCL form](https://forum.castle-engine.io/uploads/default/original/2X/9/975cc1f1349bf5c9f6a8903a881410647c2148f3.png)](https://castle-engine.io/wp/wp-content/uploads/2023/04/delphi_vcl_2.png "Castle Game Engine 3D in Delphi VCL form") |
| [![Castle Game Engine 3D in Delphi FMX form](https://forum.castle-engine.io/uploads/default/original/2X/f/fe8383c5db35725de58f4d5aac911b49bd7caabd.png)](https://castle-engine.io/wp/wp-content/uploads/2023/04/delphi_fmx_1.png "Castle Game Engine 3D in Delphi FMX form") |
| [![Castle Game Engine UI in Delphi FMX form](https://forum.castle-engine.io/uploads/default/original/2X/0/049eeee8210d68321bb28b7d5e87768a886c0ae2.png)](https://castle-engine.io/wp/wp-content/uploads/2023/04/delphi_fmx_2.png "Castle Game Engine UI in Delphi FMX form") |
| [![Castle Game Engine UI in Delphi VCL form](https://forum.castle-engine.io/uploads/default/original/2X/1/119fa6ad5b091d29e41c5f0d6f1284a453290690.png)](https://castle-engine.io/wp/wp-content/uploads/2023/04/delphi_vcl_3.png "Castle Game Engine UI in Delphi VCL form") |

We announced this feature already some time ago [and you can watch my presentation from Embarcadero CodeRage 2022](https://www.youtube.com/watch?v=oA87iclrDZA) about it. A lot of polishing work happened since then, so it’s time to announce it officially:

_Castle Game Engine_ now offers a [TCastleControl](https://castle-engine.io/control_on_form) component that you can install in Delphi IDE and drop on a VCL or FMX form. It allows you to load any 3D or 2D object hierarchy (designed in CGE editor or just instantiated by code) and render it inside a Delphi form. Inputs (mouse, keys) are handled, animations play. You can embed a fully-featured game inside a Delphi form this way or you can use it to just add something small, e.g. a visualization of some 3D object (from [glTF, X3D, MD3 or other formats](https://castle-engine.io/creating_data_model_formats.php)) to an existing form design.

Everything is documented on [TCastleControl manual page](https://castle-engine.io/control_on_form). The VCL and FMX variants of the component are practically equivalent, they are also practically equivalent to Lazarus (LCL) version of `TCastleControl`.

The short instructions are:

1. Get the [Castle Game Engine](https://castle-engine.io/download). Take a look at our [installation manual](https://castle-engine.io/install) if you have any questions.

2. Install the components in Delphi IDE: Go to the [packages/delphi](https://github.com/castle-engine/castle-engine/tree/master/packages/delphi) subdirectory and open the `AllPackages.groupproj` there. It’s a group of 3 packages.

3. Then open the examples. They are in [examples/delphi](https://github.com/castle-engine/castle-engine/tree/master/examples/delphi), one example for VCL one for FMX. These are regular Delphi projects, open them, play with stuff on form, compile and run (for Windows 32-bit or 64-bit).

4. That’s it. Go ahead and have fun with the engine! 🙂

Since the initial announcement, we have improved input (mouse and key) handling on both VCL and FMX, we added code to avoid rendering FMX version at design-time (it seems FMX native components just cannot reliably render at design-time), and we improved how controls work with our [views](https://castle-engine.io/views).

Let me know your feedback, about the new TCastleControl for FMX and VCL, and everything else! If you have any questions, [hop onto our forum and Discord](https://castle-engine.io/talk.php). And if you like this, please [support us on Patreon](https://www.patreon.com/castleengine)!
