Search found 635 matches

by UEZ
Nov 21, 2020 19:23
Forum: Tips and Tricks
Topic: Bresenham Triangle rasterization
Replies: 1
Views: 145

Re: Bresenham Triangle rasterization

Could be useful some day. Thanks for sharing.
by UEZ
Nov 20, 2020 19:47
Forum: General
Topic: Crash in recursion
Replies: 3
Views: 141

Crash in recursion

I've this code: 'Ported from https://www.dwitter.net/d/19000 by katkip to FB by UEZ build 2020-11-02 #Include "fbgfx.bi" Using FB Randomize Dim As Integer w = 1920 Shr 2 + 11, h = 1080 Shr 1 Screenres w, h, 32, 2, GFX_ALWAYS_ON_TOP Or GFX_ALPHA_PRIMITIVES Or GFX_NO_SWITCH Screenset 1, 0 Co...
by UEZ
Nov 19, 2020 14:27
Forum: General
Topic: Split 8bit in 4bit
Replies: 26
Views: 665

Re: Split 8bit in 4bit

Here another variant: #Define High4bit(n) (Valint("&h" & Left(Hex(n), 1))) #Define Low4bit(n) (Valint("&h" & Right(Hex(n), 1))) Dim As Byte n = 165 ? "Hex: " & Hex(n), "Binary: " & Bin(n, 8) Dim As Ubyte h = High4bit(n), l = Low4bit(n) ...
by UEZ
Nov 18, 2020 9:17
Forum: General
Topic: Split 8bit in 4bit
Replies: 26
Views: 665

Re: Split 8bit in 4bit

Something like this here? Function Low4bit(n As Byte) As Byte Return n And &h0F End Function Function High4bit(n As Byte) As Byte Return (n And &hF0) Shr 4 End Function Dim As Byte n = 165 '&hA5 '1010 0101 '10 5 'A 5 ? "Hex: " & Hex(n) ? ? "High: " & Hex(High4...
by UEZ
Nov 11, 2020 21:43
Forum: Tips and Tricks
Topic: Delaunay triangulation
Replies: 8
Views: 406

Re: Delaunay triangulation

@Joshy: thanks for the links. Meanwhile I added the filled polygon using center color (mid point) of each vertice. https://i.ibb.co/fGHBPQL/Preview2.jpg 'Windows and 32-bit only! #define WIN_INCLUDEALL #include once "delaunay.bi" #include once "windows.bi" #include once "_GD...
by UEZ
Nov 11, 2020 19:24
Forum: Tips and Tricks
Topic: Delaunay triangulation
Replies: 8
Views: 406

Re: Delaunay triangulation

The bug is not in your Delaunay code rather an issue with Redim Preserve vertices(c - 1). It corrupts the array and thus triangulate function crashes.

Image

Now I have to add the color for each triangle...
by UEZ
Nov 11, 2020 14:14
Forum: Tips and Tricks
Topic: Delaunay triangulation
Replies: 8
Views: 406

Re: Delaunay triangulation

It works with the provided example properly but when I try to use some vertices from a bitmap it crashes with the same error message. Here the download to the needed files: http://www.mediafire.com/file/5wdpne4q1dm00l1/Delaunay.zip/file In the zip archive you can find the file Example _GDIPlus_Bitma...
by UEZ
Nov 08, 2020 14:55
Forum: Tips and Tricks
Topic: Delaunay triangulation
Replies: 8
Views: 406

Re: Delaunay triangulation

@paul doe: thanks for sharing it. This topic was also on my to-do list. I've viewed some of the Delaunay JS code but there are some functions which need to be implemented in FB first... I wondered also why this nice feature wasn't ported to FB so far. Btw, x86 crashes - x64 works properly. Aborting ...
by UEZ
Oct 30, 2020 11:56
Forum: Tips and Tricks
Topic: Console colour finder for Windows.
Replies: 3
Views: 198

Re: Console colour finder for Windows.

Thanks UEZ. I also tested the dpi tweak to pascal. But pascal or basic or C code only achieve the same goal of running the windows procedures, and the console is omnipresent in windows. But I observe that the pascal .exe is 116 kb, and the freebasic .exe is only 27 kb. The DPI function requires Win...
by UEZ
Oct 30, 2020 11:52
Forum: Tips and Tricks
Topic: The beauty / magic of math (28 examples) Vol. I
Replies: 10
Views: 724

Re: The beauty / magic of math (24 examples)

Added some more examples. See first post.
by UEZ
Oct 29, 2020 15:06
Forum: Tips and Tricks
Topic: Console colour finder for Windows.
Replies: 3
Views: 198

Re: Console colour finder for Windows.

dodicat, the code is not DPI aware. If you add SetProcessDPIAware to the code it works also properly with different layout sizes (DPI). #define _WIN32_WINNT &h0500 #include "windows.bi" #include "crt.bi" Declare Function SetWindowTheme Lib "UxTheme.dll" Alias "...
by UEZ
Oct 23, 2020 14:41
Forum: Community Discussion
Topic: [solved] Simple math question ?
Replies: 10
Views: 516

Re: [solved] Simple math question ?

Try this:

Dim As Ulong x, n = 15
x = (n * (n - 1) ) / 2
? x, Sqr((2 * x) + 0.25) + 0.5 = n
Sleep


If you look at the equation mathematically, then it has 2 solutions, because the function is a polynomial of second degree.
by UEZ
Oct 23, 2020 10:15
Forum: Libraries
Topic: fbsound 1.2 Windows/Linux (sid wav mp3 ogg mod it xm s3m)
Replies: 19
Views: 811

Re: fbsound 1.2 Windows/Linux (sid wav mp3 ogg mod it xm s3m)

@Joshy: is a possible to have only as small as possible DLL which plays SID files only? I'm using TitchySID.dlll (16 kb) which supports only x86 code execution.

Thanks. :-)
by UEZ
Oct 21, 2020 19:27
Forum: Tips and Tricks
Topic: The beauty / magic of math (28 examples) Vol. I
Replies: 10
Views: 724

Re: The beauty / magic of math

Very nice. With river2 all I got was large squares appearing and disappearing. It didn't look like the JS version. flame failed to compile, Command executed: "C:\FreeBasic\fbc.exe" "C:\FreeBasic\UEZ\flame.bas" Compiler output: C:\FreeBasic\UEZ\flame.asm: Assembler messages: C:\F...
by UEZ
Oct 21, 2020 8:54
Forum: Libraries
Topic: fbsound 1.2 Windows/Linux (sid wav mp3 ogg mod it xm s3m)
Replies: 19
Views: 811

Re: preview: of fbsound 1.2 (dynamic) Windows/Linuxt (sid wav mp3 ogg mod it xm s3m)

Cool, I just tested it playing a SID file and works properly.

Thanks for sharing. :-)

Go to advanced search