nel-all
[Top][All Lists]
Advanced

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

[Nel] Display a logo


From: Stéphane CHAPLAIN
Subject: [Nel] Display a logo
Date: Wed, 26 Mar 2003 14:50:25 +0100

Hello,

I would like to display a 2D logo during runtime. 
The following code works:

void displaylogo()
{
        ITexture *text = new CTextureFile("nel128.tga");
        float   x= 8/ScreenWidth ;
        float   y= 8/ScreenHeight ;
        float   w=128/ScreenWidth ;
        float   h=128/ScreenHeight ;
        CDRU::drawBitmap (x, 1-(h+y), w, h, *text, *CNELU::Driver );
} 

I have to call displaylogo before swapbuffers. 

My question is : Is the file nel128.tga loaded (open file, read ...) each time 
this function is called?  

I ve tried the following code
ITexture *text;

void initlogo()
{
        text = new CTextureFile("nel128.tga");
        text->setReleasable(false); // in order not to release this texture
}


void displaylogo()
{
        float   x= 8/ScreenWidth ;
        float   y= 8/ScreenHeight ;
        float   w=128/ScreenWidth ;
        float   h=128/ScreenHeight ;
        CDRU::drawBitmap (x, 1-(h+y), w, h, *text, *CNELU::Driver );
} 
I thought it would be fastest if the driver doesn't read tthe file at each 
frame. It crashes at the second call to displaylogo(). text seems to be relased 
after the first render.
Thanks for your answers.
Stéphane. 
  




reply via email to

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