the most basic C++ stuff ever :)
January 8th, 2009
here is the first chunk of code from that function:void csplash::process()
{
d3dgammaramp newramp;
d3dgammaramp oldramp;
g_graphicscontext.lock();
g_graphicscontext.get3ddevice()->clear(0, null, d3dclear_target, 0, 0, 0);
int sw = g_graphicscontext.getwidth();
int sh = g_graphicscontext.getheight();
int tw = something_goes_here.gettexturewidth();
int th = something_goes_here.gettextureheight();
cguiimage* image = new cguiimage(0, 0, sw-(tw/2), sh-(th/2), tw, th, m_imagename);
image->setaspectratio(cguiimage::aspect_ratio_keep);
image->allocresources();
after this, i believe the rest of the function handles the process of fading up, waiting, and fading down the display, whereas this early chunk is where the properties of the image to be displayed are set up.
as you can see, i have made some changes to this code.
the key stumbling block i have hit at this time is this:
i am attempting to determine the pixel dimensions of the splash.png graphic. since guilib\guiimage.h is in the includes, i went looking in there and found the gettexturewidth() & height functions, which seem to be what i want.
as you can see in my code, i am not sure how to call functions from another cpp/h file.
any advice on this matter would be most appreciated.
why do i think that?
here's the function in its entirety:
int cguiimage::gettexturewidth() const
{
return m_itexturewidth;
}
my current patch will compile but because of where the "image size" values are coming from, it totally doesn't work properly.
what i need to find is a function which will get the pixel dimensions of an image file given the file's name as a string variable. any hints on where to look?
int tw = image->gettexturewidth();
int th = image->gettextureheight();
after the line that creates the image, ie:
cguiimage* image = new cguiimage(0, 0, sw-(tw/2), sh-(th/2), tw, th, m_imagename);
#If you have any other info about this subject , Please add it free.# |
Posted in freedeadaim.com | edit
A little something about you, the author. Nothing lengthy, just an overview.