Results 1 to 7 of 7

Thread: Objectification TBGL suggestion by Rene

  1. #1
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,554
    Rep Power
    174

    Lightbulb Objectification TBGL suggestion by Rene

    OK...
    TBGL improvement for me would mean to split all those different sections into objects. Like
    TBGL.Sprite.<member>...
    TBGL.Entity.<member>...
    TBGL.Window.<member>...
    TBGL.Displaylist.<member>...
    TBGL.Matrix2d.<member>...
    TBGL.Matrix3d.<member>...
    ...

    where member is a property or method of course.
    Even enumerations and/or constants could exist in dot-notation.

    And once thinAir knows how to autocomplete when user types a dot, coding will be much easier too. It saves a lot of time if the user gets presented a list of possible options instead of searching through documentation for correct spelling or keyword-order.
    Was it

    TBGL_GetMouseButtonLeft
    or
    TBGL_MouseGetLeftButton
    or
    TBGL_LeftMouseButtonGet
    or
    TBGL_MouseButtonLeftGet
    or just
    TBGL_GetMouseLButton...?

    Dot-notation + autocomplete would make it easy.
    And once we have the correct order we still can check help - without further search - for required parameters.
    And of course to have an eye on the logic order in future.
    -TBGL first anyway
    -Library second ( i.e. Entity, Window, Mouse...)
    -[Property], [Sub-properties]
    - Method in the end

    To read left mousebutton it would mean

    If TBGL.Mouse.Button.Left.Get Then ...

    or just

    If TBGL.Mouse.LButton Then ...

    Since .Set is not doable logically from within code as a method but by the users finger on the mouse.

    Anyway, thanks for the module, I had lots of fun using it.
    I think there are missing some Forum-sections as beta-testing and support

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736
    Hi Rene,

    interesting ideas as always

    I do like the concept, although the same benefit as you mentioned could be achieved with pure procedural approach, just having the part of name in "correct" order.

    I like the object oriented approach as a concept, however, while it can be tempting to separate everything via dot, it can have significant overhead, as I mentioned in my article on UDTs.

    I will think about it more.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,554
    Rep Power
    174

    Smile

    OK, too many dots will slow things down. I understand that.
    But anyway if it's objectified and i

    Dim win As New TBGL.Window
    Dim Player As New TBGL.Entity

    We save one dot already

    I will not call
    TBGL.Entity.Rotate(Player,x,y,z)
    (What nonsense!)
    But
    Player.Rotate(x,y,z)
    Last edited by ReneMiner; 25-12-2018 at 23:39.
    I think there are missing some Forum-sections as beta-testing and support

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736
    I agree, it would make a lot of sense for scene-entity system.

    Currently, TBGL grew a lot in size, I would like to split it to smaller parts - something like small core + entity system, model system and so on as optional parts.

    All of that while preserving backwards compatibility.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  5. #5
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,554
    Rep Power
    174
    I fear backward compatibility will make the module bigger than it is now. And as your idea to include only the needed libraries like entity, displaylist or sprite it would mean to have like a

    TBGLCore :
    window and basic functionality only
    and the user has to include what he needs like
    TBGLSprite
    TBGLEntity
    TBGLDL - display list...
    TBGLM15
    ...
    That would keep the used memory as low as needed and for backward-compatibility - old scripts - will still include classic TBGL.

    The advantage would be it were possible to add future extensions without touching the current ones. Maybe TBGLObj- or TBGLNif- model system
    Last edited by ReneMiner; 26-12-2018 at 14:36.
    I think there are missing some Forum-sections as beta-testing and support

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736
    No bloating of the original DLL, basically as you write - the newly designed components can be added via separate DLLs. I think I already posted regarding this decision.

    My vision is to perform smooth, yet painless transformation for the current users.

    TBGL will dissolve from one monolith to thin TBGL Core + optional components.

    As long as you use uses "TBGL", you will get the classic TBGL, and new redesign will be avialable for example as TBGL.Core, TBGL.SceneSystem and other modules.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  7. #7
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,554
    Rep Power
    174
    Yes that's what I imagine too. A core-engine-object providing several extensions and being expandable with things that we don't know yet. We can add those in future without touching the core nor bloating the module itself. It's up to the user to include the new stuff if he wants or needs it. He's not condemned to include m15-models if he wants to use 2d-sprites only nor will he be forced to include scene + entity-system if he wants just an in future possibly added "isometric 2.5d-sprite-library" or whatever we don't have yet...

    Give them Lego to play with
    I think there are missing some Forum-sections as beta-testing and support

Similar Threads

  1. Suggestion: new for commands
    By kryton9 in forum Suggestions/Ideas discussions
    Replies: 7
    Last Post: 16-05-2017, 19:15
  2. Rene's project consulting
    By ReneMiner in forum TBGL General
    Replies: 22
    Last Post: 27-10-2012, 09:46
  3. Suggestion for all TBGL scripts
    By ErosOlmi in forum TBGL module by Petr Schreiber
    Replies: 1
    Last Post: 23-04-2007, 08:50
  4. One suggestion
    By Petr Schreiber in forum MSVC++ 6.0
    Replies: 3
    Last Post: 13-01-2006, 13:51

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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