Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Ozz

A little off the point but...

This topic is 6920 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I`m stuck, has anyone seen a program to texture 3ds models independant of any other programs, i.e to a Max/Photoshop Plugin. Also could someone explain the use of ''static'' and ''extern''? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
I can explain you these keywords:
e.g.

void myfunc()
{
static int x=0;
......
}

Use static if a variable should only be visible inside a function but also should be "global", I mean it should keep the value when the function returns until it''s called the next time - if a local variable isn''t static, it''s created new every time the function is called. The initialization of a static variable is done only the first time the function is called.

src1.cpp:

#include "src1.h"
int xx;
...

src2.cpp:

....
void func1()
{
extern int xx;
....
}


Use extern if there''s a global variable which you want to use in your function but which is in another source file.

You can also declare a global variable as static. If you do so, this global variable can''t be used in other source files by using extern.

Visit our homepage: www.rarebyte.de.st

GA

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!