Results 1 to 4 of 4

Thread: reuse vcl source for timage like component?

  1. #1

    reuse vcl source for timage like component?

    On rewriting gl3ds i got the suggestion to make it work like timage.

    Looking at the vcl sources i got with delphi2005 i see i uses a global var Fileformats.
    For keeping track of different fileformat it uses this:
    TFileFormatsList = class(TList)
    which is a list of:
    TFileFormat = record
    GraphicClass: TGraphicClass;
    .....

    Changing TGraphicClass to TModelClass it get a working system for my use, but am i allowed to copy from the vcl sources? Or should i write my own on TList based class for this? Or are there better ways of keeping track of extension and class info for an x number of fileformats? Or is there a generic TList to be used for this?

    Questions, questions ....

    But the main one is, am i allowed to copy the TFileFormatsList from the vcl and adopt it for my purposes?

    Next: Is there a generic TList that takes an record, and allows easy and fast access to the fields in the record (under an mpl license)?
    http://3das.noeska.com - create adventure games without programming

  2. #2

    reuse vcl source for timage like component?

    I believe you cannot directly copy VCL source code and publish it...for personal use it is allowed....but not sure here, maybe the licensing conditions have changed...

  3. #3

    reuse vcl source for timage like component?

    I did not publish anything yet. I have my doubt about using it for personal use also. Hence my second question on alternatives!. Write my own derived TList that is...
    http://3das.noeska.com - create adventure games without programming

  4. #4

    reuse vcl source for timage like component?

    I use a similar idea with my world, texture and gui classes.. i have a base class, the object classes and then the object list.. e.g.

    Code:
    CBaseTexture = Class Of TBaseTexture;
    TBaseTexture = Class
    end;
    
    TTexture = Class(TBaseTexture)
    end;
    
    TShader = Class(TBaseTexture)
    end;
    
    TTextures = Class(TList)
    //list of textures
    end;
    
    TTextureClass = Class
      name: string;
      class: CBaseTexture;
    end;
    
    TTextureClasses = Class(TList)
    private
      function GetItem(Index: Integer): TTextureClass;
    public
      function add(const name: string; const class: CBaseTexture): Integer;
      function Find(const Name: String): Integer;
      property Items[Index: Integer]: TTextureClass read GetItem; default;
    end;
    I found this very helpful, and made life simple when i added new gui classes, etc... although there is probably a better way of doing it :?
    M109uk
    <br />--------------------------------------------------------
    <br />www.pulse-soft.oneuk.com

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
  •