Search found 142 matches

by ShawnLG
Dec 23, 2022 21:48
Forum: General
Topic: Christmas Star Challange
Replies: 5
Views: 961

Christmas Star Challange

This challenge is popular on a Facebook group that I am in. Can you print out the Christmas star in a few bites of code as possible? A particular Language is not a requirement. #Define a(x)Abs(x)<5 #Define f(i)For i As Integer=-8 To 8 f(y) f(x) Print IIf((a(x-y)Or a(x+y))And(a(x)Or a(y)),"*&quo...
by ShawnLG
May 11, 2022 16:06
Forum: General
Topic: Feature request: C Switch statement
Replies: 2
Views: 448

Feature request: C Switch statement

Can the C Switch statement be added to FreeBASIC? It has different functionality than the Select Case statement. Such as optional Break from Case block.
by ShawnLG
Mar 17, 2022 16:40
Forum: Libraries & Headers
Topic: FBImage static Win/Lin 32/64-bit
Replies: 67
Views: 34735

Re: FBImage static Win/Lin 32/64-bit

How come this library is not included with the FB distribution? Or better yet, built into the FB graphics library? It's too useful not to have it available.
by ShawnLG
Feb 22, 2022 5:23
Forum: Hardware Interfaces / Communication
Topic: Interfacing the Microsoft Kinect
Replies: 1
Views: 3072

Interfacing the Microsoft Kinect

Has anyone used the Kinect with Freebasic? Is there an interface for it? I have the original 360 Kinect.
by ShawnLG
Sep 23, 2021 23:06
Forum: Hardware Interfaces / Communication
Topic: fbvideoclass (Windows 32/64-bit)
Replies: 23
Views: 18581

Re: fbvideoclass (Windows 32/64-bit)

I fixed the vertical bars bug in VUV2 converter. Joshy forgot to assign the first chroma channel. Did some minor optimizations. Function ConvertYUY2(Byval pHeader As PVIDEOHDR) As Any Ptr 'YUY2 vertical bars bug fixed by ShawnLG. Dim As Integer i,n,t Dim As Integer nPixels=_VideoFormat.bmiHeader.biW...
by ShawnLG
Sep 10, 2020 16:27
Forum: Sources, Examples, Tips and Tricks
Topic: Endless loop.
Replies: 26
Views: 3245

Re: Endless loop.

At first I thought this demo was a ray tracer. Closer inspection reveal it was not, or a poly fill type. After playing with it, I found out it is a voxel type. I see you are calculating dot products for every voxel. This is compute intensive. Most of the voxels share the same surface normal informat...
by ShawnLG
Jul 30, 2020 22:08
Forum: Sources, Examples, Tips and Tricks
Topic: Reverse Bits
Replies: 10
Views: 1559

Re: Reverse Bits

I look forward to being scolded by admin. http://deltarho.org.uk/Downloads/eek.png Me too http://deltarho.org.uk/Downloads/smile.png . Although it would make more sense scolding the OP for not crediting the source ;-) I found the example here. https://aticleworld.com/5-way-to-reverse-bits-of-an-int...
by ShawnLG
Jul 30, 2020 5:25
Forum: Sources, Examples, Tips and Tricks
Topic: Simple Noise 1D,2D and 3D
Replies: 3
Views: 1907

Re: Simple Noise 1D,2D and 3D

It is faster to multiply with the recipical instead of all thoes ugly divisions. 'Replaced divisions with reciprocals, ShawnLG #Ifndef __SIMPLENOISE_BI__ #define __SIMPLENOISE_BI__ const as integer NOIZESIZE = 255 dim shared as single noise(NOIZESIZE,NOIZESIZE,NOIZESIZE) sub init constructor randomi...
by ShawnLG
Jul 30, 2020 4:42
Forum: Sources, Examples, Tips and Tricks
Topic: Reverse Bits
Replies: 10
Views: 1559

Reverse Bits

Need bits reversed? Theres a clever bit hack for that. Function ReverseBits32(x As ULong) As ULong x = ((x And &haaaaaaaaull) Shr 1) Or ((x And &h55555555ull) Shl 1) x = ((x And &hccccccccull) Shr 2) Or ((x And &h33333333ull) Shl 2) x = ((x And &hf0f0f0f0ull) Shr 4) Or ((x And &a...
by ShawnLG
Jul 23, 2020 16:05
Forum: Community Discussion
Topic: BASIC Gaming Issue #7 is out!
Replies: 11
Views: 4619

Re: BASIC Gaming Issue #7 is out!

It's a shame he has disappeared. He has contributed so much to the BASIC community.
by ShawnLG
Jul 23, 2020 15:31
Forum: Game Dev
Topic: Liquid Fabric. A fast water ripple engine object for games.
Replies: 2
Views: 1157

Re: Liquid Fabric. A fast water ripple engine object for games.

dafhi wrote:that FPS tho. A lot of integer with FP sprinkles. Good for us old dogs.
I like to use the datatype that is best suited for the job. There was a 64 bit compilation bug in LiquidFabric.bi that broke the hight map and light map functions. LiquidFabric.bi was updated.
by ShawnLG
Jul 21, 2020 19:50
Forum: Game Dev
Topic: Liquid Fabric. A fast water ripple engine object for games.
Replies: 2
Views: 1157

Liquid Fabric. A fast water ripple engine object for games.

I have seen a few water ripple demos and I desided to make my own. It's more than a demo. It is in OOP model for easy use in games. It has three texture filter outputs. GetHM(): Returns a pointer to a height map image of the Liquid Fabric. The height map can be used to create a vectorized water fiel...
by ShawnLG
Jun 22, 2020 17:18
Forum: Sources, Examples, Tips and Tricks
Topic: PHP-like associative arrays
Replies: 45
Views: 16926

Re: PHP-like associative arrays

Dear ShawnLG; Thanks for your correction. I checked with the following program. There still seems to be collisions. You are right. There is still a problem with collisions. i had a feeling something was quite not right. Thanks for testing it. I was reliying on the hash key for reference for collisi...
by ShawnLG
Jun 20, 2020 16:27
Forum: Sources, Examples, Tips and Tricks
Topic: PHP-like associative arrays
Replies: 45
Views: 16926

Re: PHP-like associative arrays

I have added collision currection to the hash mapping. The hash function would be useless without it. I was unable to test it because I do not know of any collision conditions. Why is the hash table defined in two dimentions? assocarray.bi ' collision divergent by ShawnLG #Define ASSOC_ARRAY_LOG_COL...
by ShawnLG
Jun 08, 2020 2:36
Forum: Projects
Topic: "Another" 3d engine Xors3D (abandoned)
Replies: 15
Views: 3327

Re: "Another" 3d engine Xors3D (abandoned)

Dr_D wrote:Hi. I'm always interested in 3D engines.
You might like Genesis3D SDK. It is also abandonware. I remember playing the demo in the late 90s. It has that nastalgec Quake feel to it. The source is in C for version 1.2, so it can be translated to FB.

https://www.genesis3d.com/