OpenGL Library for Delphi,
maintained by Eric Grange,
based on Mike Lischke's GLScene.

 

Articles - Loading a texture in code


A texture is loaded into a material through its texture property. The TGLTexture class has an image property that has a loadfromfile property. At runtime a texture from the material library can be loaded as follows:

Material:=GLMaterialLibrary1.materials.getlibmaterialbyname('Texture1');
Material.material.texture.image.loadfromfile('texture.jpg')


Set the TGLTexture.disabled flag to false.

To assign a texture to a GLScene object refer to the how to assign a texture article.


by skinhat
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.2
Page was generated in 0.0835 seconds