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

Thread: FreeBasic SDK: first working example

  1. #1
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,795
    Rep Power
    10

    FreeBasic SDK: first working example

    Hi all,

    here again on using FreeBasic language to be able to create thinBasic modules. This time not only words but a real working example. For the moment it is just a simple example implementing a graphic console (text and few drawing directive). But it is working fine so far and it is using both numbers and string in native thinBasic way (OLE32 strings).

    I think I've also found a simple and official (I mean without any complicated or trick tasks) way to manage OLE32 strings (BSTR) directly into FreeBasic source code both to pass and receive strings. But we will see in a new thread in next days.

    For the moment I just need to have some confirmations about this little module. Is it working for you?
    If all will be OK, I will release also FreeBasic sources and needed .lib files to be able to create FreeBasic modules.

    Have fun and please tell me if script example is working on your box. Just put included files into any new folder (of course thinBasic at least 1.4.0.x must be installed) and run script. You should get a window that will show some graphics, circles and text.

    Ciao
    Eros

    UPDATED:
    Thread closed because more advanced stage have been acquired on FreeBasic SDK.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

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

    Re: FreeBasic SDK: first working example

    Hi Eros,

    on my PC it works good.

    First pixel fill takes about second, circles draw fast.


    Bye,
    Petr
    Attached Images Attached Images
    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 author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,795
    Rep Power
    10

    Re: FreeBasic SDK: first working example

    Yes, first pixel set is a 640x480 loop, so 307200 iterations. Not so good for an interpreter.

    Thanks for you testing Petr.
    I will release the source code of the module very soon in order for all to have a look how to use FreeBasic.
    Seems this will open a lot of new possibilities.

    Ciao
    Eros

    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #4

    Re: FreeBasic SDK: first working example

    Same here, works fine. Speed is similar to Petr's.

  5. #5
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,139
    Rep Power
    733

    Re: FreeBasic SDK: first working example

    Eros,

    to clarify speed, I did simple measure and it seems the first color fill takes about 687 ms, and this time value is very stable in any run which is good.

    One thing regarding the module - I would like to choose resolution and bit depth rather than mode number. Do you think it would be possible ? If not, no problem, I am still quite used to similar approach from PB/DOS and SCREEN statement


    Thanks,
    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

  6. #6
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,795
    Rep Power
    10

    Re: FreeBasic SDK: first working example

    Petr,

    this module will not be released as official thinBasic module but as FreeBasic source code plus FreeBasic project file under FbEdit IDE (see http://www.radasm.com/fbedit/ ) to be propedeutic for thinBasic users to develop thinBasic modules using FreeBasic.

    So developed functions are just an example on how to develop them under FreeBasic. Everyone will get the needed files and do what they will prefer. So do not worry about functionalities right now I'm just wrapping native FreeBasic keywords without nay big strategy. I just choose Graphic console functionalities because they are simple easy to be mastered very quickly. I'm not a FreeBasic expert right now
    FreeBasic is so rich of native functions plus have a lot of 3rd party library that I suspect limit will just be the fantasy.

    At the moment I'm adding comments to FreeBasic source code plus adding some more functions to show how to pass variables (both BYREF and BYVAL), how to return numeric and string data, and things like that. I'm also still working on exposing some more thinCore functionalities to FreeBasic but maybe I will leave some for the next implementation.

    So be prepared to have complete FreeBasic SDK by mid of next week. I will work a bit on the week-end and release it next week.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  7. #7
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,795
    Rep Power
    10

    Re: FreeBasic SDK: first working example

    Hi Petr.

    As usual your requests are so interesting that I didn't resist to add them.
    See first post on this thread and new example in zip file.

    Let me know.
    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  8. #8
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,139
    Rep Power
    733

    Re: FreeBasic SDK: first working example

    Eros,

    yesterday night I talked with my friend about how short time it takes to see new feature in thinBASIC.
    I think you made new record this night


    Thank you,
    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

  9. #9
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,795
    Rep Power
    10

    Re: FreeBasic SDK: first working example

    Well, speed in adding new functionalities is due to the interface we have exported from thinCore. The set of exported functions are now quite tested and stable. The only delay can be when dealing with different ways to handle string data types but for numeric, problems are zero now.

    Ok, I want to beat myself in dev speed ;D
    Added the following other 3 functions. Download from first post in this thread:
    • FBGFX_Cls[(Mode)]
    • FBGFX_Color(Fore, Back)
    • FBGFX_RGB(R, G, B)

    I had to add specific RGB because generated color number have also alpha channel inside. From FreeBasic help file: "It returns an unsigned integer in the format &hAARRGGBB, where RR, GG and BB equals the values passed to this function, in hexadecimal format. AA is the implicit alpha value and is automatically set to &hFF (opaque)."

    Tomorrow maybe other few. Now I go to sleep

    Good night!
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  10. #10
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,139
    Rep Power
    733

    Re: FreeBasic SDK: first working example

    Incrrredible !

    Thanks and good night ,
    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

Page 1 of 2 12 LastLast

Similar Threads

  1. FreeBasic SDK: working full source code example
    By ErosOlmi in forum Module SDK (Freebasic version)
    Replies: 4
    Last Post: 26-09-2007, 16:19

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
  •