[Pkg-pascal-devel] are we waiting on each other?

Michalis Kamburelis michalis.kambi at gmail.com
Sun Jun 8 11:01:17 UTC 2014


Paul Gevers wrote:
> Hi all,
> 
> On 06-06-14 21:57, Paul Gevers wrote:
>> Until we create a better solution, I believe for view3dscene we should
>> depend on the cge-src package. I will propose a solution as alternative
>> to the patch in this weekend.
> 
> Please find attached what is my proposal instead of the patch to include
> the castleconf.inc file.
> 
> Let me know what you think.
> 

Hi,

As I understand, the issue is because view3dscene source code currently
refers to castleconf.inc. And castleconf.inc is part of Castle Game
Engine sources, thus requiring CGE sources for view3dscene compilation.

As an upstream, I can offer some explanation and simple solution:

Explanation: In general, we do *not* advice end programs to use the
castleconf.inc include file. castleconf.inc should be internal for the
engine, and not used by most applications (like games or view3dscene).
The fact that view3dscene *right now* refers to castleconf.inc is a
temporary hack: that's because view3dscene does some rendering using
direct OpenGL calls (which we discourage, with CGE >= 5.0.0 all
rendering should go through engine classes, to seamlessly support OpenGL
and OpenGLES). These calls are used to display some debug stuff (octree,
frustum visualization etc.). Moreover, view3dscene uses CastleGL macro
(expanded to OpenGL units: "GL, GLU, GLExt" for OpenGL, or to
"CastleGLES20" for OpenGLES), even though most of the debug stuff is
just commented out under OpenGLES (see comments "//TODO-es" near some
ifdefs). And castleconf.inc handles expanding the CastleGL macro.

The end result is that view3dscene is half-ported to OpenGLES (Android,
iOS), i.e. it can be compiled and run using OpenGLES renderer and the
primary functions work (GUI, 3D models), although some debug 3D stuff is
not rendered.

In the long run, view3dscene should not use direct OpenGL/OpenGLES calls
at all, it should not use CastleGL macro, so so it also should not use
castleconf.inc file. So I would not advice to make elaborate work to
handle this in Debian packages --- the problem should disappear in
upstream anyway :)

Simple solution: It is possible to get rid of castleconf.inc references
from view3dscene code easily:

- Remove "{$I castleconf.inc}" lines from view3dscene sources (8 occurences)
- Replace "CastleGL" in uses clauses with "GL, GLU, GLExt". (Actually,
in one unit it can be just removed.)

See the attached patch. I tested it with respect to the current SVN
trunk code of view3dscene, but it should apply to latest view3dscene
released code too.

The only downside of this patch is that you remove partial OpenGLES
support from view3dscene code, but it's useless anyway for users. It's
only a work-in-progress that is useful for me (it allows to test
OpenGLES renderer with view3dscene).

Hope this helps :),
Michalis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: remove-castleconf-from-view3dscene.patch
Type: text/x-patch
Size: 3946 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-pascal-devel/attachments/20140608/c4d49d05/attachment-0001.bin>


More information about the Pkg-pascal-devel mailing list