FreeBasic Framework

User projects written in or related to FreeBASIC.
paul doe
Posts: 1225
Joined: Jul 25, 2017 17:22
Location: Argentina

FreeBasic Framework

Postby paul doe » Nov 04, 2019 21:19

Following the discussions here, I decided to revamp my framework a little (since 1.07.1 is out, and has some features I needed). The preliminary results can be seen here:

FreeBasic Framework

Laid out mostly as a set of interoperable classes, there's also a templating framework (which is the basis of it all) to create your own templated types.

coderJeff wrote:...
4) #macro & #define are typically only usable where a simple text substitution would work. #macro & #define are not well suited as-is to extend the language itself since preprocessor has very limited capability as far as a macro language goes. Developing additional token processing operators or macro-text processing functions is a possibility, but there are other issues.
...

You would be surprised. I would like to see a more advanced preprocessor implemented, though. There were some things that were really challenging to implement and required some serious thought to make them work (making templating work within namespaces was one of them). Anyway, really nice work with 1.07.1 guys! (I'm using the Gcc 8 toolchain); no serious hiccups to report here.

I'm developing this along a commercial app, but this code is MIT so there aren't any troubles in posting this here. Bugs? Comments? Suggestions? Report, please.

Edit: Not publicly available anymore.
Last edited by cha0s on Jun 15, 2020 5:49, edited 4 times in total.
Reason: locked
Lost Zergling
Posts: 322
Joined: Dec 02, 2011 22:51
Location: France

Re: FreeBasic Framework

Postby Lost Zergling » Nov 05, 2019 13:30

To the extent that OOP is considered a mandatory point of passage, it may be appropriate to consider the possibilities. In the classical object design, one generally considers that the state of the system results from the organization of the objects between them. The "classic" design is mental representation in a two-dimensional way: the system is the sheet of paper on which the result is organized. If we try to imagine a multi-layer system, there is the question of the organization and communication of the subsystems between them: either that objects are able to interact in conceptually distinct subsystems, or that objects are able to exchange messages to guide their behavior. The modeling of such a set is no longer limited to the sum of the modeling of the subsystems because the question of the setting of the relations is a function of the model of description of each conceptual layer. In my opinion and also seen from this angle, integrating more consideration of the accessibility of the conceptual dimension, the project would seems to me particularly interesting (and arduous). This post is based on my overall understanding of this project (and what it inspire to me), some of the technical aspects elude me, sorry for any misunderstanding.
paul doe
Posts: 1225
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBasic Framework

Postby paul doe » Nov 06, 2019 21:55

Just a small update. Revamped the event system (NOW it works as I wanted), and added examples for collections usage (forgot those before).
paul doe
Posts: 1225
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBasic Framework

Postby paul doe » Dec 11, 2019 1:05

Small update. Revamped almost the entire framework, and added more examples. Lots of stuff are still a WIP, but the foundational code is unlikely to see a rework. Working on the Windowing framework ATM.
paul doe
Posts: 1225
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBasic Framework

Postby paul doe » Jan 16, 2020 21:10

A somewhat large update. Added a few classes and revised some old code. Still need to revise the math and geometry frameworks. Fixed some broken examples.
dafhi
Posts: 1343
Joined: Jun 04, 2005 9:51

Re: FreeBasic Framework

Postby dafhi » Jan 16, 2020 23:25

looks like 'git' messed with your folders again? specifically, all the .bi where fbfw is located are dupes of the .bi inside fbfw

examples/graphics i had to

Code: Select all

#include once "../../inc/fbfw-graphics.bi"

now i'm getting on line 6
File not found, "fbfw-templates.bi" in '#include once "fbfw-templates.bi"

perhaps these .bi are meant to go into fb/inc
paul doe
Posts: 1225
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBasic Framework

Postby paul doe » Jan 17, 2020 4:02

dafhi wrote:...
perhaps these .bi are meant to go into fb/inc

Yes. You only need to copy the contents of the /inc folder (not the folder itself) into your FreeBasic distro /inc folder (combine them). That's all there is to it. Sorry for the lack of docs, I have been really busy with other things as of lately...
dafhi
Posts: 1343
Joined: Jun 04, 2005 9:51

Re: FreeBasic Framework

Postby dafhi » Jan 17, 2020 8:24

new errors
D:\prod\programming\fb\FreeBASIC-1.07.1-gcc640-win32\inc\fbfw\graphics.bi(19) error 4: Duplicated definition, __cclr__ in '#define __cclr__( c ) culng( c )'
D:\prod\programming\fb\FreeBASIC-1.07.1-gcc640-win32\inc\fbfw\graphics.bi(75) error 4: Duplicated definition, pixelAreaOf in '( cptr( _'
paul doe
Posts: 1225
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBasic Framework

Postby paul doe » Jan 17, 2020 13:05

Ok. I've fixed some end-of-line issues the repo was having. Now, these are the exact steps you need to follow to 'install' the codebase:

  • Copy the contents of the /inc folder of the repo (not the folder itself, its contents) to your FreeBasic installation /inc folder.
That's it. Examples should then run from wherever they are. I've just tested it and it works. It should, since the repo contains an exact snapshot of what I actually have in my /inc folder.

About the naming conflicts: perhaps you happen to have another symbol named __cclr__ somewhere in your codebase? I get no conflicts here (obviously)...
dafhi
Posts: 1343
Joined: Jun 04, 2005 9:51

Re: FreeBasic Framework

Postby dafhi » Jan 17, 2020 21:49

affirmative to the whole copy-paste thing.

fbgfx-example-2.bas. i forgot to append "..." to the list
...
D:\prod\programming\fb\FreeBASIC-1.07.1-gcc640-win32\inc\fbfw\graphics.bi(80) error 4: Duplicated definition, pMin in 'iif( ( v ) < ( a ), ( v ), ( a ) )'
D:\prod\programming\fb\FreeBASIC-1.07.1-gcc640-win32\inc\fbfw\graphics.bi(82) error 4: Duplicated definition, pMax in 'iif( ( v ) > ( a ), ( v ), ( a ) )'
D:\prod\programming\fb\FreeBASIC-1.07.1-gcc640-win32\inc\fbfw\graphics.bi(92) error 4: Duplicated definition, boundedPixelOf in 'iif( _'
D:\prod\programming\fb\FreeBASIC-1.07.1-gcc640-win32\inc\fbfw\graphics.bi(113) error 4: Duplicated definition, pixel in 'buffer[ ( pitch ) * ( y ) + ( x ) ]'
D:\prod\programming\fb\FreeBASIC-1.07.1-gcc640-win32\inc\fbfw\graphics.bi(120) error 4: Duplicated definition, pixelAddress in 'iif( _'
D:\prod\programming\fb\FreeBASIC-1.07.1-gcc640-win32\inc\fbfw\graphics.bi(128) error 4: Duplicated definition, pitchInPixelsFor in '( buffer->pitch \ sizeOf( Drawing.fbColor ) )'
D:\prod\programming\fb\FreeBASIC-1.07.1-gcc640-win32\inc\fbfw\graphics.bi(135) error 4: Duplicated definition, op_blend in '( ( op * Color_A( src ) ) shr 8 )'
D:\prod\programming\fb\FreeBASIC-1.07.1-gcc640-win32\inc\fbfw\graphics.bi(139) error 4: Duplicated definition, pixel_op in '( ( ( _'
D:\prod\programming\fb\FreeBASIC-1.07.1-gcc640-win32\inc\fbfw\graphics.bi(139) error 133: Too many errors, exiting

i'll try and suss if it's something i'm doing wrong
paul doe
Posts: 1225
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBasic Framework

Postby paul doe » Jan 17, 2020 22:27

dafhi wrote:affirmative to the whole copy-paste thing.

fbgfx-example-2.bas. i forgot to append "..." to the list
...

Dafhi: you don't need to append anything. Just run the examples as they are. Or if you want to try your hand with, say, collections, just create a new file anywhere and write:

Code: Select all

#include once "fbfw-collections.bi"

'' Code that uses collections

That's all that's needed. That's why all those 'duplicated' files named fbfw-* in the /inc folder are for: to include them directly as headers.

After 'installation', you should have, in your FreeBasic's /inc folder:
  • The /fbfw folder
  • All the fbfw-*.bi files
And that's it. When you want to use something, use the fbfw-whatever header as I explained above.
Last edited by paul doe on Jan 17, 2020 22:31, edited 1 time in total.
dafhi
Posts: 1343
Joined: Jun 04, 2005 9:51

Re: FreeBasic Framework

Postby dafhi » Jan 17, 2020 22:31

i am so awkward in the sequence of how i word things. i meant append to error msg list.

update: tried array-example in collecion examples/collections. it works fine
update 2: the graphics examples arent working
Last edited by dafhi on Jan 17, 2020 22:35, edited 1 time in total.
paul doe
Posts: 1225
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBasic Framework

Postby paul doe » Jan 17, 2020 22:34

dafhi wrote:...
update: tried array-example in collecion examples/collections. it works fine

Good. All the other ones should also work (just downloaded the code from GitHub and tested it, again).

Don't expect any brilliance, though. These are just some examples I threw together to show basic functionality and most are meaningless except for me. In time, I'll add some more 'meaty' examples to it (such as creating your own templatable collections, more useful use of predicates, and a lot more).
paul doe
Posts: 1225
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBasic Framework

Postby paul doe » Jan 17, 2020 22:37

dafhi wrote:...
update 2: the graphics examples arent working

Why?
dafhi
Posts: 1343
Joined: Jun 04, 2005 9:51

Re: FreeBasic Framework

Postby dafhi » Jan 17, 2020 22:42

tried all folders. "interaction" also gives
D:\prod\programming\fb\FreeBASIC-1.07.1-gcc640-win32\inc\fbfw\graphics.bi(19) error 4: Duplicated definition, __cclr__ in '#define __cclr__( c ) culng( c )'
D:\prod\programming\fb\FreeBASIC-1.07.1-gcc640-win32\inc\fbfw\graphics.bi(75) error 4: Duplicated definition, pixelAreaOf in '( cptr( _'
etc.

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 6 guests