Results 1 to 7 of 7

Thread: TBGL_CreateTextureFromHandle

  1. #1

    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
    (Sorry about my bad English.)

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,157
    Rep Power
    736

    TBGL_CreateTextureFromHandle

    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


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,157
    Rep Power
    736

    TBGL_CreateTextureFromHandle

    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
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #4

    TBGL_CreateTextureFromHandle

    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
    (Sorry about my bad English.)

  5. #5
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,157
    Rep Power
    736

    TBGL_CreateTextureFromHandle

    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
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  6. #6

    Re: TBGL_CreateTextureFromHandle

    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

    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
    (Sorry about my bad English.)

  7. #7
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,157
    Rep Power
    736

    Re: TBGL_CreateTextureFromHandle

    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
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •