TBGL_CreateTextureFromHandle
issueid=110 08-03-2010 14:49
Member
Number of reported issues by D.J.Peters: 7
TBGL_CreateTextureFromHandle

thanx Petr
this looks great for me
now the most priority of my wishlist is:

TextureIndex = TBGL_CreateTextureFromHandle(ByVal Handle as long)

Often TGA's and BMP's are very big and PNG's or JPG's can do the same job.

Joshy
Issue Details
Issue Number 110
Issue Type Feature
Project TBGL
Category Unknown
Status Suggested
Priority Unknown
Suggested Version Unknown
Implemented Version (none)
Votes for this feature 0
Votes against this feature 0
Assigned Users (none)
Tags (none)




08-03-2010 15:39
Super Moderator
Hi Joshy,

thanks, so are the functions ok?

There is one function in TBGL called "TBGL_MakeTexture", it takes as input RGBA, RGB, BGRA or BGR block of memory. If you could return this stream from your TBTIL, it can be integrated seamlessly and even stay garbage collected.

TBGL_MakeTexture allows making nearest, linear, mipmapped linear and also anisotropic filtering, so I would prefer to do it this way, if possible.

I will make suggestion in your forum now :D


Petr

08-03-2010 15:43
Super Moderator
Also one thing to add,

with thinBASIC 2.x series, TBGL will support JPG and PNG natively.
TB 2.x series will be Windows XP/Vista/7 only, so module can rely on fact GDIPlus is always present, so it can provide this feature easily.


Petr

08-03-2010 16:03
Member
it's ok i can interrupt my work

but i know the results of GDI+ will never be the same.

there are many math under the hood to get high quality results for
downscaling to power of 2 textures
mipmaping without damage on the alpha channel
...

you know why your bmp font blitting looks not so good ?

I can't under stand why you won't native OpenGL together with TBGL.

In OpenGL a texture is a texturename not any index or slot
Shaders or OpenCL or CUDA needs a real texture handle not any virtual number.

but it's ok for me

Joshy

08-03-2010 16:08
Super Moderator
Hi Joshy,

I think your work is important and good, so do not interrupt anything please!

I will think about your handle suggestion more, but must really run now.

I see your point with slots, they have more historical reasons, when I started the module 5 years ago.


Petr

09-03-2010 08:00
Member
Hello Petr,

first sorry if my last words was a litle bit harsh
but sometimes i code 24 hours in one session
without sleep and with ton's of coffee
(it's ok i like it it's my pasion since last 30 years)

but it isn't good for fine communication :oops:

back to the topic:
i know texture slots make it easy for you to free all resources
on end if theTBGL window/control are destroyed.

So it isn't wrong to work with this desgin the only one what OpenGL coders needs is.

SlotIndex = TBGL_CreateTextureSlotFromGLHandle(OpenGLTextureHandle)
' now the user can use any TBGL texture command with it

OpenGLTextureHandle=TBGL_GetHandleFromTextureSlot(SlotIndex)
' now the user can use any OpenGL texture command with it

think about it.

It's easy and should be posible in minuts for you as hard core coder ;)

I'm sure together we can push thinBASIC to the next higher level.

Joshy

09-03-2010 08:45
Super Moderator
Hi Joshy,

no problem :)

I was thinking about it and in the end it should be possible to develop the functionality as you say.
It will be also possible to "garbage collect" it, which basically means the module will release the resource added by TBGL_CreateTextureFromHandle in the end.

The slot2handle and back functions seems good idea.


Thanks,
Petr

+ Reply