Sign in to follow this  
  • entries
    455
  • comments
    639
  • views
    421687

Internationalism...

Sign in to follow this  
_the_phantom_

66 views

So, encouraged by my fixing of the GTL yesterday I decided today, inbetween leveling sessions on UT2K4 RPG, to do some work towards the .Net and Lua bindings I muttered about in the last entry.

The first step was the DLL version of the library; for this I decided to convert the static dll lib project to a proper dll project; this was so I could hack the 'config.hpp' file a bit in order to correctly apply the dll export dectorations to the functions.

This was pretty easy, as it was basically a case of defining a token I could change depdending on the conditions of the application doing the linking; in this case if we were building then define the export and if were are linking then define the import.
It has just occured to me that the latter phase only works on MSVC compilers atm as it's bundled in with the auto-linking, so turning off that or using another C++ compiler will fox it; I should probably do something about that before I goto bed.

At this point I had a choice; .Net or Lua.
In the end I chickened out of the C++/CLI stuff and went with Lua, which thus far has been pretty simple.

The aim is to have it so you can practically treat a GTL::Image object like a table, but a table with functions.
So you could do w,h,d = img:getDimentions() or even w = img:getDimentions() to get information about the height, widtha and depth of the image, or you could do w = img["width"] todo the same thing for the width (and maybe even for the dimentions).

Function wise it all looks easy, the table is going to be immutable as once the image is loaded you can't really do much else with it. The only thing I need to figure out is how to make immutable values in the GTL table for the image types and colour depth information...

At this point you are probably wondering how this relates to the entry subject?
Well, it was while doing this Lua dll that I realised that this is a very British library, mainly because of Image::getColour().

So, I decided that, to try and avoid nasty problems of American English speakers getting things wrong to bind the Image::getColour function as both 'getColour' and 'getColor'. Indeed, I might even expand this into the main C++ library [grin] (although with the intellisense systems out there these days I don't see it being as much of a potential problem).

I'll finish the Lua lib tomorrow/later today; it's 6:35am and I'm a bit tired so sleep doth call (as I'd rather avoid any more migraines thanks...).
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now