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

GTL 3 - MSVC Beta release time?

Sign in to follow this  

94 views

A few refinements have been made today;

Firstly I was treating async IO file reading wrong; I was treating a non-zero return from ReadFile() as an error, which is true normally but in AIO mode the 'error' is 'IO operation pending'. The net result was it was causing my Async loads to fail with an error about an IO operation pending; opps!

I've swapped the 'set error flag and return' methods in all the decoders to throw an exception instead, then at the call site the exception is caught, the error flag is set, so is an error message and if set an error callback is called.

I'm still considering dropping 'error' and replacing it with 'ioerror' and 'decode error' as those are the only two exceptions which are used.

Yes, callbacks are in; two exist 'loaded' and 'error' with the same signature for both; void func(GameTextureLoader3::ImagePtr, std::string const &) with the latter parameter being the filename which loaded/failed to load.

The call backs can be set at init time or via 'setCallbacks()' after that, both taking boost::function objects so no restriction on the function type called, as long as it can match the signature.

The 'process()' function now correctly update the 'state' of the object as it loads,with the stages being:
- Pending
- Loading
- Loaded
- Processing
- Completed

However the state can become 'error' after 'Loading' or 'Processing' due to that being the location when errors can occur.

So, it looks like everything finally works, which is nice [grin]
I'll ponder for a bit longer to see if anything else needs doing and, if not, get a Beta release (Win32, MSVC only for now) up later tonight.

I'm currently updating my Gentoo VM so that I can work on the Linux IO and threading issues. The later introducing a dependancy on pthreads most probably and the former using the POSIX AIO API (which I'm currently reading up on). This should be an intresting learning experiance [grin]
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