Skip to content

About

Dynamic library (DLL, SO etc.) so load, render and process 3D and 2D models like X3D, VRML, glTF

Resources

Stars

2 stars

Watchers

3 watching

Forks

Repository files navigation

Dynamic library to load and render 3D and 2D models, like X3D, VRML, glTF

This repository contains the code of a dynamic library using Castle Game Engine to load, render and interact with models in any format supported by Castle Game Engine (like X3D, VRML, glTF).

This repository also contains the precompiled library (DLL, SO etc.) made using GitHub Actions.

The library exposes API in plain C (and is thus useful from any programming language), and is available for all platforms supported by Castle Game Engine (Windows, Linux, macOS, iOS...). It is used "in production" by the Room Arranger for the 3D viewer on multiple platforms.

The library allows to load and render models in an application written in any programming language (C, C++, C#, Python, ...) and display the results using any technology. You initialize OpenGL(ES) context on your side, in any way, and then call library routines to render models and interact with them.

Note for Pascal developers: You should not use this library, in short :) Instead use full Castle Game Engine API in Pascal, which is much more powerful (can manage any number of scenes, transformations, creatures, viewports, lights, user interface, physics, sound and more). This library is designed for a more limited purpose: load and render a single model at a time.

Multi window Qt Library Tester
Multi window Qt Library Tester in C++

Compiling

Enter this directory, and run ./castleengine_compile.sh shell script.

This should produce castleengine.dll (on Windows), libcastleengine.dylib (on macOS) or libcastleengine.so (on Unix).

To compile static library for iOS, run ./compile-iOS.sh shell script.

Note for Windows: castleengine_compile.sh requires you to have Cygwin or MinGW installed. It may be easier to call castleengine_compile.bat, which doesn't require anything special.

Note: Make sure that fpc binary is available on the environment variable $PATH. If you don't know how to set the environment variable, search the Internet (e.g. these are quick instructions how to do it on various Windows versions).

When using under LGPL license, remember to add --compiler-option=-dCASTLE_ENGINE_LGPL parameter.

Contents

Usage examples

C++

  • add castleengine.h and castlelib_c_loader.cpp to your project source files
  • provide the compiled library castleengine.dll/.dylib/.so next to your exe file

iOS

  • add castleengine.h and tremolo sources to your project source files.
  • add Pod file with freetype dependency. Install pods and use xcworkspace to open the project. Alternatively, compile Freetype as static library (freetype.a) separately and just link with it
  • link with libcastleengine.a

About

Dynamic library (DLL, SO etc.) so load, render and process 3D and 2D models like X3D, VRML, glTF

Resources

Stars

2 stars

Watchers

3 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages