PDA

View Full Version : Uniformity to match TBGL with other Modules



kryton9
14-05-2017, 20:54
Thanks to Primo's test (http://www.thinbasic.com/community/showthread.php?12760-PerlinNoise&p=93575&viewfull=1#post93575) of my test noise dll, it brought up an important issue of different types.
In studying Ken Perlin's code, he uses floats, doubles, integers. Since I am adapting his code for thinBasic's use,
I need your input Petr on what types all things should be so that I can make them compatible with TBGL.

I do already see that you need to add a tbgl_trgbaf type or similar, so that floating point color values can be used. And if doubles supported, then will need to add a type for that. Up to you, I will write the code for dll accordingly to keep things uniform.

So in essence, what should I use. For instance, I don't see int32 in the help but you had mentioned it before?:


Perlin
TBGL
Use


Double
Double
Single?


Float
Single
Single?


Int
Long
?


uint
dword
?

Petr Schreiber
15-05-2017, 09:01
Hi Kent,

Int32 is alias for Long, they are equivalent.

Please use whatever precision you need, thinBasic & TBGL will convert to target automagically :)

Using the *D functions ... believe me it makes no sense to use DOUBLE for color when we have displays, which have 8bits per color channel :)

Just convert the number in 0..1 range to 0..255 range by multiplying by 255 and using the TBGL_Color.


Petr

kryton9
15-05-2017, 19:05
Perlin was using Doubles, that is what threw me off. I will work in floats(singles). Thanks.

Is there a list of the numeric aliases anywhere in the help?

Petr Schreiber
15-05-2017, 19:29
Hi Kent,

the data types are briefly mentioned in change notes here:
http://www.thinbasic.com/public/products/thinBasic/help/html/version_1_8_0_0.htm

For some time, I am thinking about community aided documentation for thinBASIC.
Eros is using excellent tool for the help file, probably one of the best, but it has one catch - it is very expensive.



Petr

kryton9
15-05-2017, 21:56
Ahhh, I tried the help search online and offline and it doesn't apparently search the recent updates pages. If it searched those it would solve all the issues.
I think opening up to the community could cause issues. I believe in benevolent dictators running languages to give a uniform style to the language :D

Petr Schreiber
15-05-2017, 22:15
I was thinking about some pull-request based approach, to give dictators enough power ;)


Petr

Michael Hartlef
16-05-2017, 07:32
Is "the opening of TB" about everything or just modules?

ErosOlmi
16-05-2017, 11:09
Numeric alias added to manual. Will be present in next release.

I'm using Help & Manual version 5.6 (an old version but more than enough for my needs) for thinBasic manual: http://www.helpandmanual.com/products_hm_overview.html
If you have something to add/amend/re-organize/whatever regarding manual please post a request into manual forum and I will try to do it: http://www.thinbasic.com/community/forumdisplay.php?202-Help-Material
Some parts of the manual are poorly documented with no examples. If you want to contribute ... I will be happy to include contributions.

@Michael
"the opening of TB" is about almost all modules for the moment.
I suppose thinAir will follows and also some tools like debugger and profiler
thinCore (thinBasic Core engine) and thinBundling (build executables from thinBasic scripts) will not be open source.

Michael Hartlef
16-05-2017, 11:45
@Eros: Thanks for the info.