GLBasic forum

Main forum => GLBasic - en => Topic started by: bigsofty on 2011-May-31

Title: GLB Texture Handles
Post by: bigsofty on 2011-May-31
How do I retrieve the OpenGL texture handle for a texture that has already been read using the LOADSPRITE function?

This is for using stored GLB textures with raw GL commands.
Title: Re: GLB Texture Handles
Post by: Kitty Hello on 2011-May-31
What are you trying to archive?

Try:
Code (glbasic) Select

X_SETTEXTURE id%, -1
intern_id% = glGetInterger(GL_TEXTURE_BINDING_2D)



Title: Re: GLB Texture Handles
Post by: bigsofty on 2011-May-31
I am having to write a little openGL lib to convert some OpenGL code, written in C that I need.

I need the texture handle to that I can use GLB textures within some inline code.

Using some of the images already read and stored by GLBs LOADSPRITE function, then later reusing the images handles with inline C, using "glBindTexture" for example.

If you get my meaning?

Title: Re: GLB Texture Handles
Post by: Kitty Hello on 2011-May-31
That might work excellently. If you mess with the texture size from INLINE code, GLBasic might not be able to display it properly. I store the width/height internally in a variable.
Title: Re: GLB Texture Handles
Post by: bigsofty on 2011-May-31
Cool Gernot, I'll give that a go.

I won't be writing anything to the texture just reading it.

Thanks again!  :good: