indexing description: "[ Base class for OpenGL texture. Use `id' to access the OpenGL texture id. ]" date: "$Date$" revision: "$Revision$" deferred class GL_TEXTURE inherit GL_SHARED_TEXTURES export {NONE} all end GL_FUNCTIONS_EXTERNAL export {NONE} all end GLU_FUNCTIONS_EXTERNAL export {NONE} all end feature -- Access id: INTEGER is -- OpenGL texture id deferred end feature -- Measurement width: INTEGER -- Width of texture in pixels height: INTEGER -- Height of texture in pixels feature -- Status report is_valid: BOOLEAN is -- Is texture valid? do Result := id /= 0 end is_not_freeing_texture: BOOLEAN -- Is `Current' not freeing texture on disposal? feature -- Status setting do_not_free_texture is -- Tell `Current' not to free texture on disposal. -- If you call this, you will be responsible for freeing -- the OpenGL texture yourself using `gl_delete_textures'! do is_not_freeing_texture := True end feature -- Basic Operations save is -- Save texture in global textures list. -- A saved texture will not be freed, even when you loose -- the reference to the texture object. To free it later use -- the global storage GL_TEXTURES. -- TODO: maybe a mechanism to add an id would be nice. do textures.save (Current) end invariant width_not_negative: width >= 0 height_not_negative: height >= 0 end