PDA

View Full Version : Texture Loading and acceleration



kryton9
08-05-2017, 01:11
Refreshing my memory on thinBasic, Oxygen and TBGL... I thought clarification in the documentation could help new comers.

Just some suggestions.

One is the idea of texture loading. It is confusing having texture loading in GDIp module, TBGL module and on the forums freeImage texture loading.
GDIp seems to support all the formats without the need of an additional dll like freeImage.dll.

It would be nice if TBGL used GDIp texture loading behind the scenes to benefit from the useful additional formats like png and jpg. If not possible, then perhaps in the help under each type of texture loading function, links to the other functions were provided as is with other keywords.

I thought the Canvas was accelerated, but in reading some posts it seems it is not. So in the help it would be neat if any module where graphics are involved from charting to tbgl that each module identified if the graphics would be accelerated by the graphics cards or not.

I found the starting tutorial to be very useful to get back up to speed with the basics, great job!

Petr Schreiber
08-05-2017, 09:05
Hi Kent,

for the purpose of easy texture loading, I prepared SmartTexture (https://github.com/petrSchreiber/SmartTexture) include, you may give it a try!

GDI Plus works from Windows XP above, older Windows do not support it. I think it is not that big issue these days, but it was the main motivation why it wasn't used in the past.


Petr

kryton9
08-05-2017, 10:57
Excellent Petr, perhaps such useful files should be linked to in the help files or links provided in 1 sticky easy thread to find somewhere on the forums.

Thanks I will be using this one a lot!

kryton9
08-05-2017, 11:20
Petr, I noticed you named SmartTexture with an extension of tBasicu, which I know stands for unit file.
Why is this a unit file and not an include file (tBasici) or better yet what is the difference between a unit and include file?

Petr Schreiber
08-05-2017, 15:52
Hi Kent,

great question!

tBasicU
I use it for self contained units, that means, that whole file is basically single type with functions, all encapsulated in that type (like class).

tBasicI
I use these for header includes, that is, files which contain DECLAREs, or generally intefaces to third party libraries.


Petr

kryton9
08-05-2017, 17:41
Thanks Petr, nice clear explanation. I will rename my files accordingly.