Search found 8184 matches

by D.J.Peters
Sep 18, 2022 19:59
Forum: Sources, Examples, Tips and Tricks
Topic: Ray Tracer
Replies: 7
Views: 2301

Re: Ray Tracer

I replaced the vector math with macros and the result are ~10 seconds :-) Joshy 'Ported from https://js1k.com/2017-magic/demo/2648 by Igor Sbitnev To FB by UEZ build 2021-01-19 ' original on old laptop ~24 seconds ' optimized ~11 seconds now :-) #Include "crt/math.bi" #Include "fbgfx....
by D.J.Peters
Sep 18, 2022 17:57
Forum: Sources, Examples, Tips and Tricks
Topic: Ray Tracer
Replies: 7
Views: 2301

Re: Ray Tracer

On an old single core laptop I got 28 seconds a little bit slow so I optimized the trace() function and the pixel plotting I get 14 seconds now :-) Joshy 'Ported from https://js1k.com/2017-magic/demo/2648 by Igor Sbitnev To FB by UEZ build 2021-01-19 ' original on old laptop ~28 seconds optimized ~1...
by D.J.Peters
Sep 18, 2022 14:02
Forum: Sources, Examples, Tips and Tricks
Topic: List Files and Dirs of Path with Unicode character support ?
Replies: 16
Views: 2360

Re: List Files and Dirs of Path with Unicode character support ?

this works here but I don't have UTF8 file names on my gernan system. use a string size of 1024 for filename or path 64 is often to small ! Joshy Dim UserPath as String = environ("USERPROFILE") & "\Desktop" Open Pipe "dir /b " & UserPath For Input encoding "...
by D.J.Peters
Sep 18, 2022 11:40
Forum: Sources, Examples, Tips and Tricks
Topic: List Files and Dirs of Path with Unicode character support ?
Replies: 16
Views: 2360

Re: List Files and Dirs of Path with Unicode character support ?

You can read the output of a schell command with a PIPE

Joshy

Code: Select all

var UserPath = environ("USERPROFILE")
Open Pipe "dir /b " & UserPath For Input As #1
var aLine = ""
while not EOF(1)
  line input #1, aLine
  print aLine
wend
close #1
sleep
by D.J.Peters
Sep 17, 2022 19:02
Forum: General
Topic: KD-Tree Implementation
Replies: 14
Views: 1926

Re: KD-Tree Implementation

@Andrew Lindsay I worked on the quadtree the last 12 hours. Looks like the new result are very stable now. I removed everything unnecessary types (tVector2i, tVector2f, tCircle, tRectangle) Most interesting for you I added functions to get the nearest node and it's distance to a point x,y inside a c...
by D.J.Peters
Sep 17, 2022 18:26
Forum: Sources, Examples, Tips and Tricks
Topic: A simple but fast QuadTree (for collision detection, particle physics ...)
Replies: 1
Views: 1003

Re: A simple but fast QuadTree (for collision detection, particle physics ...)

do a circle queries (x,y,radius) #include "QuadTree.bi" dim as integer sw,sh,sb screeninfo sw,sh,sb :sw*=0.75:sh*=0.75 screenres sw,sh,sb,2',1 windowtitle "use mouse buttons [left]=add node [right]=query nodes" screenset 1,0 var frames=0,fps=60 var ox=-1,oy=-1,ob=-1 ' old mouse c...
by D.J.Peters
Sep 16, 2022 10:17
Forum: General
Topic: KD-Tree Implementation
Replies: 14
Views: 1926

Re: KD-Tree Implementation

(sorry about my bad written english but I understand and read english very well) I can try to help but I need to know your needs the file BUKP_1m_Adjacent.csv has 2D coords (perfect for a QuadTree) what is the meaning of this x,y coords and do you need to know the nearest coord if you select one of ...
by D.J.Peters
Sep 16, 2022 8:00
Forum: Libraries & Headers
Topic: FLTK-C-1.3.3 for FreeBASIC
Replies: 433
Views: 198105

Re: FLTK-C-1.3.3 for FreeBASIC

Here the result of the Dependency Walker :-)

Joshy
file: "fltk-c-1.3.3-64.dll" Image
by D.J.Peters
Sep 16, 2022 7:37
Forum: Libraries & Headers
Topic: FLTK-C-1.3.3 for FreeBASIC
Replies: 433
Views: 198105

Re: FLTK-C-1.3.3 for FreeBASIC

VANYA wrote: Sep 16, 2022 6:59Fl_GetFontSizes missing in the 64-bit version of the DLL.
I compiled and executed Fl_GetFontSizes01.exe with 64-bit compiler and OS without any problem ?

Joshy
Image
by D.J.Peters
Sep 16, 2022 0:18
Forum: Sources, Examples, Tips and Tricks
Topic: Split String Algorithm for FreeBasic
Replies: 21
Views: 3464

Re: Split String Algorithm for FreeBasic

@Vinion do you know strtok() from the FreeBASIC c runtime ? C Runtime: https://www.freebasic.net/wiki/ProPgCruntime Joshy #include "crt.bi" var s1 = "don't reinvent the wheel we have the cool C-Runtime :lol:" print s1 dim as string splits(any) var p = strtok(strptr(s1),strptr(&qu...
by D.J.Peters
Sep 15, 2022 23:48
Forum: Sources, Examples, Tips and Tricks
Topic: OpenGL shader language math in FreeBASIC.
Replies: 23
Views: 5746

Re: OpenGL shader language math in FreeBASIC.

This thread here is primary for the OpenGL shader language on CPU with FreeBASIC! you can define iTime as IGlobalTime in the shader code :-) #define iTime iGlobalTime By the way the shadertoy OpenGL shaders thread in FreeBASIC is here: https://www.freebasic.net/forum/viewtopic.php?t=28001 Joshy ' sh...
by D.J.Peters
Sep 14, 2022 22:09
Forum: General
Topic: KD-Tree Implementation
Replies: 14
Views: 1926

Re: KD-Tree Implementation

I added a circle shape for a query range and chnaged particle to a PathNode !
you can store in the quadtree any kind of nodes but a node must have x and y position at least.

The quadtree can be found here: viewtopic.php?p=294656

Joshy
by D.J.Peters
Sep 14, 2022 20:55
Forum: General
Topic: KD-Tree Implementation
Replies: 14
Views: 1926

Re: KD-Tree Implementation

You can use a quadtree also !

The quadtree can be found here: viewtopic.php?p=294656

Joshy
by D.J.Peters
Sep 14, 2022 20:23
Forum: General
Topic: [solved] Is the FreeBASIC array alignment safe ?
Replies: 44
Views: 4500

Re: [solved] Is the FreeBASIC array alignment safe ?

Only to show you an example here are vec4 aligned 16 bytes. ..... operator vec4 . cast as _VEC4 ptr return cptr(_VEC4 ptr,cast(uinteger,@memory) and MASK) end operator ..... operator vec4 . [] (byref index as const uinteger) byref as single return cptr(single ptr,cast(uinteger,@memory) and MASK)[in...
by D.J.Peters
Sep 08, 2022 4:25
Forum: Game Dev
Topic: How to draw graphics into screen?
Replies: 3
Views: 3285

Re: How to draw graphics into screen?

Here are all FreeBASIC graphics commands -->: CatPgGfx Joshy ' graphic screen with 8 bit palette = 256 colors screenres 640,480,8 ' a red diagonal line line (10,10)-step(100,100),4 ' a red [B]ox line (120,10)-step(100,100),4,B ' a red [B]ox [F]illed line (240,10)-step(100,100),4,BF ' a red [B]ox [F]...