nel-all
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nel] UTexture


From: Cyril 'Hulud' Corvazier
Subject: Re: [Nel] UTexture
Date: Tue, 2 Mar 2004 17:38:22 +0100

 
after creating a UTexture format vie the UDriver createTextureFile function
 
  _texture = driver().createTextureFile("file.tga");
 
i need a way to obtain the width and height of the UTexture file
there doest appear to be an accessor for this in UTexture
 
Yes, your're right, there is no accessor for the texture size. Anyway, NeL could tell you the size of the texture only after the texture has been used.
later in the code at the point i need to find the width and height
i have a material with the texture assigned to it and to perform
some required calculations
 
to avoid repeating something that already may exist and
for cleaner faster code does anyone know a way to obtain this information from
Utexture or more preferably from a material with a Utexture assigned to it
 
the material > texture > width / height is best way for me as it will require
a lower overhead of varibles being thrown about
Si you need to know a bitmap size from a file (tga or dds), use NLMISC::CBitmap::loadSize().
To get the bitmap file name, you will have to get a NL3D::UTextureFile interface from your UTexture object with a "dynamic_cast".
 
Otherwise, the way you can do this is :
 
- Expand the NeL 3d interface to give access to the CTexture::generate() method that forces a texture to be generated.
- Expand the NeL 3d interface to give a read access to the texture size. Be sure to call CTexture::generate() before.
 
Hld.
 
    Andi 'Debug' Allen

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d--- s-: a-- C++++ US++ P++ L+ E--- W+++ N o-- K++ w++++
O---- M-- V-- PS+++ PE Y+ PGP t+ 5++ X++ R-- tv+++ b++++ DI++ D++
G++ e* h++ r+++ y++++
------END GEEK CODE BLOCK------


_______________________________________________
Nel mailing list
address@hidden
http://mail.nongnu.org/mailman/listinfo/nel-all

reply via email to

[Prev in Thread] Current Thread [Next in Thread]