Check out the What's New page for details
End Users Developers Contact
The TGPGuiLib™ provides cross platform user interface support for Terragen™ plugins. In case you have just wandered in, Terragen is an excellent near photorealistic landscape generator/renderer. You can find the website here. The TGPGuiLib allows plugin developers to write Terragen plugins that have user interfaces which can run with minimal effort on both the Windows and Macintosh versions of Terragen. It also provides developers with what is hopefully a straightforward way to create user interfaces, and allows close integration with Terragen.
Here's an example of a plugin interface which uses the TGPGuiLib :
Click images to see full size versions in new window
The picture on the left shows the plugin running on the Mac OS X, and the picture on the right shows the plugin running on Windows XP. Both these windows use exactly the same source code. This plugin is from the WaterWorks pack, which you can find out more about here.
It's very easy to use the TGPGuiLib. At the moment Mac users don't need to do anything, as the TGPGuiLib is included inside Terragen Mac.
Windows users need to download the installer, linked to below. Once downloaded, double click the installer and follow it's instructions. If your copy of Terragen is not installed in the default location ( which is "C:\Program Files\Terragen" ) then you will need to browse to the folder Terragen is installed in when prompted. The installer will install the following items, all of which must be in the same folder as your Terragen application :
- TGPGuiLib.DLL file. This is the TGPGuiLib.
- TGPGuiLib.prz folder. This folder contains resources that the TGPGuiLib requires to work properly.
- TGPGuiLoader.tgp file. This is a Terragen plugin which loads the TGPGuiLib when Terragen starts up. It doesn't do anything else. This file allows you to put plugins which use the TGPGuiLib in any of the various folders Terragen can load plugins from.
Plugins that use the TGPGuiLib will find it automatically. The TGPGuiLib doesn't do anything itself, it just provides services for plugins.
Windows users - please note that if you cannot see the TGPGuiLib.DLL file after unzipping the download, then Windows is hiding it from you. It is actually there. Windows hides certain types of files from you by default, and DLL files are one of those types. For instructions on turning on the display of hidden files in the version of Windows you use, please search the Windows help for something like "show all files".
The TGPGuiLib is free for everyone to use, although that is not to say it's public domain. I reserve all rights to it.
Currently only the Windows version of the TGPGuiLib is available for download. The Mac version is included inside Terragen Mac.
TGPGuiLib for Windows
Version 1.2.7 Released 21/10/03.
Important : The TGPGuiLib now requires OpenGL. This does not mean that you have to have a 3D card in your machine, just that you need OpenGL installed on your system. To the best of my knowledge, OpenGL has been installed with Windows since Windows 98. If you have an older version of Windows, you will need to visit the Microsoft website to find the installer. If I can find a link to this myself I will add it here.
If you would like to be notified of when newer versions of the TGPGuiLib are released, then you can click here to subscribe to an announcement mailing list. This is a low volume list where the only messages posted will be announcements of new versions of the TGPGuiLib.
Here's a list of the current issues or bugs effecting the TGPGuiLib ( these only effect the Windows version ) :
- There is a bug with some of the displays in the Colour Picker looking corrupted. This problem goes away if you set the "Hardware acceleration" setting in the Troubleshoot part of the Advanced settings in the Display control panel to about the second notch from the left. It seems mainly to be a problem with Radeon graphics cards. This will be fixed in an upcoming version.
- Occasionally when you dismiss a plugin window, a window other than the Terragen one may come to the front. This has no harmful effects aside from being an inconvenience. Just click on the Terragen window to bring it to the front again.
- There is a bug where the graphics areas in some plugins may turn a particular colour ( it seems to be the same colour as the "Selected Items" colour in your current theme ) when the window opens. For example, with the standard Windows theme, the graphics area turns dark blue. To get around this you generally just need to do something to force the graphics area to redraw, perhaps change a setting in the plugin. This is annoying, and I'm looking into ways to fix it.
- On Windows, the "Pick Up" and "Drop" buttons don't use a colour that you may have picked up from the Colour Picker in TG itself, and vice versa. Although the TGPGuiLib Colour Picker has similar functionality to the main TG one, it isn't possible for it to be integrated with TG one yet unfortunately.
Here's a list of some plugins that use the TGPGuiLib. If you'd like to add your plugin to the list, please email me.WaterWorks
Available for Mac/Windows
WaterWorks is a collection of water effects plugins. There are a number of plugins in the pack, from a surf effect plugin to a lava plugin to an ice shelf effect plugin.
For Export Only
Available for Mac/Windows
For Export Only is a set of terrain export plugins. It exports Windows BMP, Autodesk DXF, Wavefront OBJ and RenderMan RIB files. A 3DS Max and Electric Image FACT exporter will be added in upcoming releases.
Available for Mac/Windows
Solaris is a Lighting Accessory plugin which lets you set the position of the Sun according to a location on the Earth, given in latitude and longitude, a date and the time of day.
The TGPGuiLib currently supports a good basic range of UI functionality. It supports multiple modal windows and a range of controls. It also supports Open and Save file dialogs, alerts/message boxes, a colour picker and a progress dialog for lengthy operations. As of v1.2, the TGPGuiLib also supports graphics using OpenGL, with both full window and seperate graphic area support, as well as timer functions. There are a range of utility functions, including extensive byte swapping functions to allow you to easily read and write cross platform data. The TGPGuiLib also has a set of functions which make saving and loading settings to Terragen world files much more straightforward.
As of v1.2.6, the TGPGuiLib adds support for loading XML based GUI description files. These files can be generated easily from interface builders ( such as Visual Basic on Windows or REALbasic on the Mac ) and help to greatly simplify the process of creating plugin GUIs. Along with this, a structured folder resource system has been added. This allows plugins to automatically load resource files appropriate for each supported platform ( Mac OS 9, Mac OS X, Windows ). This process is handled by the TGPGuiLib, plugin developers simply need to put the appropriate files in the appropriate places. Future versions of the TGPGuiLib will add language support to the resource system which, along with Unicode support, will make it possible to have localised plugins.
v1.2.7 adds a stack based GUI layout system which automatically lays out UI according to specific rules for each platform. This a very quick way to create plugin interfaces, especially suited to certain kinds of plugins.
The TGPGuiLib is a shared library/DLL with a C interface. At present the TGPGuiLib is not widely available as it still needs to be documented, and besides, the Terragen PDK is not widely available yet either.
A Developer page with more about the UI elements the TGPGuiLib supports, as well as details on future additions and enhancements, is forthcoming. Watch this space.
If you have any questions, bug reports, complaints, salutations and the like, you can contact me, Jo Meder, via email at firstname.lastname@example.org.
Many thanks to Yoshiki Shimakawa for doing a Japanese translation of this site, which you can see here.
In case you were wondering, TGPGuiLib stands for Terragen Plugin Graphical User Interface Library.