PDA

View Full Version : TBTIL Texture Image Library



D.J.Peters
07-03-2010, 02:32
Supported file formats: BMP, PNG, JPG, TGA, DDS, PSD, HDR

Joshy

kryton9
07-03-2010, 09:44
Joshy you are like a new spring breeze, or more like adrenaline injection... 2 powerful libs in one day. And great selection of libs to do!

ErosOlmi
07-03-2010, 11:09
To keep thing organized, I can create dedicated sub forum for this project.
Just ask for it.

Petr Schreiber
07-03-2010, 11:11
Thanks a lot,

if I may ask, how does it work? Does it any auxiliary library?

Regarding LGPL - what does it mean to programmers? I checked on Wiki and it seems to be quite friendly license comparing to classic GPL, but I would experience some explanation from person who knows this better (you :))


Thanks :occasion:,
Petr

ErosOlmi
07-03-2010, 11:24
Joshy,

as a way of proceed here in thinBasic we tend to use module/library name in front of any function in order to keep things clear.
So names likes "NewRGBTextureFromFile" can be something like "TBTIL_RGBTextureFromFile" and so on.

When you read source code it is very clear from where function come from.

This is not mandatory of course but if used I think it is something every thinBasic programmer is used to.

Ciao
Eros

Michael Hartlef
07-03-2010, 11:28
Hi folks,

about GPL, there are some good thought expressed here (http://en.wikipedia.org/wiki/GNU_General_Public_License#Linking_and_derived_works).

Eros, I think he would need a current C SDK for it. If these libs are released under GPL, then there are not for me. But thanks for sharing them anyway.

Michael

Petr Schreiber
07-03-2010, 11:36
Hi Mike,

they seem to be LGPL, not GPL. That, if I read it correctly, means if you just use the library, your program does not have to be (L)GPL. This is different from GPL "classic".

This is why I asked Joshy about clarification.

Michael Hartlef
07-03-2010, 11:38
But didn't you wrote GPL at first? I know, the LGPL is save for linking.

Petr Schreiber
07-03-2010, 11:40
Yes,

then I read the header by Joshy again and noticed it is LGPL. So I corrected my original question.
I am sorry for confusion.


Petr

Michael Hartlef
07-03-2010, 11:44
Ok. :)

Michael Hartlef
07-03-2010, 11:44
Btw Petr, why is this sample code working? I see no BindTexture command there.

Petr Schreiber
07-03-2010, 11:47
We must wait for Joshy to know the true reason,

my theory is that the NewRGBTextureFromFile loads the texture and lets it bound with glBindTexture internally.


Petr

Michael Hartlef
07-03-2010, 11:50
Yes, that makes sence.

Michael Hartlef
07-03-2010, 11:56
This lib is incompatible with TBGL's own texture handling.

Petr Schreiber
07-03-2010, 13:11
I have few suggestions for Joshy,

but as I see this thread, he has already lot to answer :)
If he will agree for new forum, I will post suggestion for one command there, which will make it even more TBGL usable.


Petr

D.J.Peters
08-03-2010, 00:25
be cool friends the topic is "Experimental" modules or library interface
the zip file is now up to date (see first post)

The lib in it's curent state has nothing to do with TBGL
but to use a texture i used TBGL of course

there is a new example test02 in the zip file
ist use custom alpha channel

if you put your tricky codes in a thinBasic SDK lib only thinBASIC users can use it
but as a "normal" dll all windows OpenGL coder can use it for free and in comerical products too.

TBGL users needs:
Dim Handle as Long
Handle = NewTextureXXX(FileName)
TextureSlot = TBGL_CreateTextureSlotFromHandle(Handle)
...
or
...
TextureSlot = TBGL_CreateTextureSlotFromHandle(NewTextureXXX(FileName))
...

Joshy

D.J.Peters
08-03-2010, 00:41
To keep thing organized, I can create dedicated sub forum for this project.
Just ask for it.
this isn't a bad idea.

Joshy

D.J.Peters
08-03-2010, 01:10
what makes this lib as a special lib ?

this isn't only a other fast and free image loading lib
it's more some parts are realy tricky.

for example if you use a other lib loads a png or what ever
and sets any mask color as alpha channel
in most cases it will work as you will acept.

but if you enable mipmapping the result is often not good
comapre this three pics
the texture is from *.bmp file without any alpha channel
then pink RGB(255,0,255) is defined as new alphachannel
the third picture is from the library i wrote last night.

Joshy

D.J.Peters
08-03-2010, 06:17
Added:

textnum = NewAlphaTextureFromCombinedFiles(ImageFile, AlphaFile)

get it from first post see test03.tbasic

happy cooding

Joshy

(the first file must be the image the alphachannel will be calculated from the second file)

ErosOlmi
08-03-2010, 11:17
Created dedicated forum for TBCDL
Joshy, you are moderator in this area.

The best would be to have a post marked as "Sticky" where to have the latest version of your lib always updated and have different posts for specific discussions. This will simplify a lot searching and keeping things organized.

Ciao
Eros