Search found 1128 matches

by paul doe
Mar 29, 2020 23:23
Forum: General
Topic: Best approach to fit n rectangles into a screen
Replies: 15
Views: 517

Re: Best approach to fit n rectangles into a screen

... The background is that I want to partition the image into zones to bundle a group of pixel for collision check within each grid zone to avoid unnecessary checks for pixel which are "far away" from each other. Isn't this just a specialized quadtree? Or you can also use spatial hashing...
by paul doe
Mar 29, 2020 12:52
Forum: General
Topic: OOP test
Replies: 13
Views: 409

Re: OOP test

... how do i make intefaces and abstract classes in FB ? ... By reading the manual , under the section 'User Defined Types'. There is no such thing as a proper interfaces yet (neither do classes, for that matter). However, by using the types you can fudge them to some extent. FreeBasic only support...
by paul doe
Mar 28, 2020 15:59
Forum: Community Discussion
Topic: Multiplatform coroutines in C and also in FreeBasic
Replies: 6
Views: 458

Re: Multiplatform coroutines in C and also in FreeBasic

Mmm, this could prove tremendously useful, thanks. I guess that it can also be built-in in the dialect itself (fork/yield/join?)
by paul doe
Mar 28, 2020 13:40
Forum: Windows
Topic: win7 vs 8
Replies: 10
Views: 736

Re: win7 vs 8

@TouristTrap: how so? It does work as expected for me. When you press Win+E, an explorer window is opened at the position of the last one you closed, and starts to stack from there. I recall Win7 having the same behavior, whereas I don't recall it opening a specific folder in a specific desktop posi...
by paul doe
Mar 28, 2020 0:37
Forum: Libraries
Topic: raylib headers
Replies: 46
Views: 2113

Re: raylib headers

@BasicCoder2: see here for a description of the problem you're having: https://www.freebasic.net/forum/viewtopic.php?f=14&t=28380&start=15#p269653 Or you can use the 64-bit version which does not have the issue you're reporting (the dll itself needs another one, the gcc runtime). @Joshy: any...
by paul doe
Mar 28, 2020 0:15
Forum: Libraries
Topic: raylib headers
Replies: 46
Views: 2113

Re: raylib headers

@fxm: I see that sancho3 reviewed the topic 'Using libraries in FreeBasic' by SJ Zero on February 06, 2018, under 'Community Tutorials'. Mind if I rewrite it completely? (it's quite outdated by now). Also, I think a link to it directly in the Table of Contents might prove useful, since this has to b...
by paul doe
Mar 28, 2020 0:06
Forum: Libraries
Topic: raylib headers
Replies: 46
Views: 2113

Re: raylib headers

Inside the raylib-2.6.0-Win32-mingw zip, in the /bin folder, it's the binary (the .dll) you need. Dump it into the folder where the examples are. You should then be able to run them.
by paul doe
Mar 27, 2020 23:58
Forum: Community Discussion
Topic: Freebasic is not smooth in graphics
Replies: 17
Views: 1137

Re: Freebasic is not smooth in graphics

... Do you see it as a substitute for fbgfx rather than SDL2? ... Indeed. As Joshy pointed out before, it isn't particularly advanced but it does have some nice functionality that fits neatly into the 'BASIC' mindset ( doEverythingForMe() kind of coding). SDL2 serves a similar purpose but h...
by paul doe
Mar 27, 2020 20:14
Forum: Community Discussion
Topic: Freebasic is not smooth in graphics
Replies: 17
Views: 1137

Re: Freebasic is not smooth in graphics

It would be nice to have extensive FreeBASIC tutorials for using OpenGL or SDL2. What for? There you have the Raylib headers ported by IchMagBier. I ported several examples and provided a link to the binaries. I've also built it statically and have it available if requested. Do you see much activit...
by paul doe
Mar 27, 2020 20:04
Forum: Community Discussion
Topic: Freebasic is not smooth in graphics
Replies: 17
Views: 1137

Re: Freebasic is not smooth in graphics

... Has anyone made an FB class that does something similar? Could be a fun exercise for someone who wants to learn this stuff to make such a class. https://github.com/glasyalabolas/fb-framework/tree/master/inc/fbfw/math That's mine (there are others too; Joshy for example also has one). It's part ...
by paul doe
Mar 27, 2020 13:51
Forum: Community Discussion
Topic: Freebasic is not smooth in graphics
Replies: 17
Views: 1137

Re: Freebasic is not smooth in graphics

... I have seen dozens of games and demos written in this language and none of them ever had the fluid movement of sprites. Did I miss something or is it impossible to get fluid graphics? Have you tested this one ? No GPU, just the standard FreeBasic functionality. Runs pretty smoothly even on a 60...
by paul doe
Mar 26, 2020 22:01
Forum: General
Topic: Ask about "new" and "delete"
Replies: 5
Views: 226

Re: Ask about "new" and "delete"

What happens is simply that the memory is marked as 'free' by the underlying OS (since we reclaimed it when we called new ). The values are not changed unless the memory is occupied again with other data (which in your example isn't the case; processes cannot access the memory space of other process...
by paul doe
Mar 20, 2020 22:25
Forum: General
Topic: Program to calculate the GCD of more than two numbers
Replies: 6
Views: 317

Re: Program to calculate the GCD of more than two numbers

@lrcvs: just in case you wanted to know how much of a difference tail recursion makes, here's a simple benchmark for the above. I'm using my implementation (which is similar to dodicat's; the GCD_bf() function is simply your code refactored into a function) but with his test sample: namespace Math /...
by paul doe
Mar 20, 2020 22:02
Forum: General
Topic: Program to calculate the GCD of more than two numbers
Replies: 6
Views: 317

Re: Program to calculate the GCD of more than two numbers

@dodicat: indeed, the recursive approach is the faster of the ones I tested. I tried the 'most efficient' approach here, for example, and for large numbers it just bogs down to a grinding halt. Thanks for sharing.
by paul doe
Mar 20, 2020 21:09
Forum: General
Topic: Program to calculate the GCD of more than two numbers
Replies: 6
Views: 317

Re: Program to calculate the GCD of more than two numbers

Really nice. This is the same algorithm but wrapped in functions for convenience: namespace Math /' Returns the greatest from an array of numbers '/ function _ maxOf( _ numbers() as integer ) _ as integer dim as integer _ mx => 0 for _ i as integer => lbound( numbers ) _ to ubound( numbers ) mx => i...

Go to advanced search