Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: PNG/TGA Transparency in GLScene + Lazarus

  1. #1

    PNG/TGA Transparency in GLScene + Lazarus

    Hello.

    I've just started to port Dage from Delphi into Lazarus and 99% of everything worked off the box in Ubuntu 9.10.

    Only thing that really bugs me now is PNG and TGA transparency in THudSprite objects, and probably in meshobjects too. I use GraphicEx library for Delphi version and everything works as charmed. Is there a GraphicEx lib for Lazarus somewhere? Coulnd't find anything but dead links.

    I have the latest Lazarus, FPC and GLScene from SVN repository.

    Current projects with Delphi & Lazarus: Dage - Dog Adventure Game Engine.

  2. #2

    Re: PNG/TGA Transparency in GLScene + Lazarus

    I made a small test program that doesn't work for me.

    Download zip file here

    Current projects with Delphi & Lazarus: Dage - Dog Adventure Game Engine.

  3. #3

    Re: PNG/TGA Transparency in GLScene + Lazarus

    You could use Vampyre Image lib instead (It's FPC compatible and supports loads of image formats).

    http://imaginglib.sourceforge.net/index.php?page=about

    I have no experience with GLScene and GraphicEx (I might have tried it, but i can't recall). So I can't really help you with these.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  4. #4

    Re: PNG/TGA Transparency in GLScene + Lazarus

    A little stray off the subject - from what I heard, GraphicEx is not the best choice. I read somewhere that it's unstable and tends to be a "memory-leak maker".

    I'd suggest Vampire Lib, too. It is OpenGL-compatible, cross-platform (even MacOS is supported!) and, just like chronozphere said, compiles in FPC and Lazarus.

    I used to work with GLScene, but I've never tried Vampire Lib with it. I guess you will have to do some tweaks here and there to make it work.

  5. #5

    Re: PNG/TGA Transparency in GLScene + Lazarus

    Thanks for a tip! I'll try Vampire and post the results here soon.
    Current projects with Delphi & Lazarus: Dage - Dog Adventure Game Engine.

  6. #6

    Re: PNG/TGA Transparency in GLScene + Lazarus

    Ugh.. Okay the Vampyre builds and compiles fine. The demos work etc. But I can't seem to tell GLScene to load those PNGs with Vampyre instead of Lazarus Graphics. Any ideas?
    Current projects with Delphi & Lazarus: Dage - Dog Adventure Game Engine.

  7. #7

    Re: PNG/TGA Transparency in GLScene + Lazarus

    I can't really help because I don't know how GLScene loads it's images. You should try loading "some" image with Vampyre ImageLib, so that you have all it's pixels in memory. Now you need to look for a way to import raw pixel data into GLScene. Once you found this, you can make a routine to convert an ImageLib image to a GLScene texture.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  8. #8

    Re: PNG/TGA Transparency in GLScene + Lazarus

    AFAIK, GraphicEx registers the image format somehow so that it is supported by Delphi and thus can be loaded to a TImage. Maybe you should check how it's done and use VampireLib instead?

  9. #9

    Re: PNG/TGA Transparency in GLScene + Lazarus

    Ok, I got it working in the small testunit

    But not yet with Dage.

    The problem is probably the usage of GLVfsPAK. It requires ApplicationFileIO and because of it, GLScene does some kind of "hack" to TPicture file format list. This causes AV.

    I hope the newsgroups for glscene comes online soon...
    Current projects with Delphi & Lazarus: Dage - Dog Adventure Game Engine.

  10. #10

    Re: PNG/TGA Transparency in GLScene + Lazarus

    I think that GLVfsPack has nothing to do with pictures- it's just a unit which provides support for Quake packages.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •