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
Printable View
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
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
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
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
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
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
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