Re: [AD] support for mod files

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On April 6, 2010, Matthew Leverton wrote:
> On Tue, Apr 6, 2010 at 7:07 PM, Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx> 
wrote:
> > I think it might require a windows specific fshook driver. One that
> > uses HANDLEs rather than FILEs. Unless Win32 has a way to turn a FILE
> > into a HANDLE.
> 
> I wrote a minimal stream class, used like:
> 
> ~~~
> ALLEGRO_FILE *fp = al_fopen("c:\\mysha2.bmp", "rb");
> 
> AllegroStream s(fp);
> Gdiplus::Image *img = new Gdiplus::Image(&s, false);
> 
> if (img)
>   std::cout << "image: " << img->GetWidth() << "x" << img->GetHeight()
> << std::endl;
> 
> delete img;
> al_fclose(fp);
> ~~~
> 
> It works fine so far, although I haven't tried it on anything except
> the standard file interface.

Ah so gdiplus can be told to work with an arbitrary stream interface? That 
could be a good alternative to dealing with native win32 handles.

> --
> Matthew Leverton
> 
> -------------------------------------------------------------------------
> ----- Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev


-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/