Game Development Community

Correct syntax for accessing/creating $Pref variables?

by Kevin Rogers · in Torque Game Engine · 02/13/2006 (2:17 pm) · 1 replies

I need to add some custom $Pref variables to the engine. However, I'm seeing inconsistent usage -- some use "$Pref" and some use "Pref". (And some are un-capitalized...) Examples include:
Con::getVariable("Pref::Unix::OpenALSpecifier");

Con::addVariable("$pref::TS::autoDetail", TypeF32, &DetailManager::smDetailScale);

Con::addVariable("pref::Player::renderMyPlayer",TypeBool, &sRenderMyPlayer);

U32 region = Con::getIntVariable( "$pref::Net::RegionMask" );

dSprintf( buf, sizeof( buf ), "Pref::Client::ServerFavorite%d", i );

I just want to know what the "correct" or "accepted" syntax is supposed to be, so I can attempt to be consistent with it. Thanks!

#1
02/14/2006 (4:42 am)
Well, all of them work. It's up to you to choose your mileage. I prefer not using the $ and properly capitalizing the variable names.