C
Christopher
Its been awhile and I am rusty.
Can the constructor of my class call another method in the same class
if that other method does not change any member data?
I want to simply have a seperate method that returns a huge string,
that string containing code in another language, which is to be
compiled by a third party API when my object is being contructed.
class MyClass()
{
public:
MyClass()
{
m_effect = ThirdPartyAPIFunction( GetHLSL() );
}
private:
const std::string GetHLSL()
{
std::string hlsl = "";
/*1*/ hlsl += " // This is HLSL code";
/*2*/ hlsl += "float4 IntensityAmbient;";
return hlsl;
}
ThirdPartyAPIVaribale * m_effect;
};
Can the constructor of my class call another method in the same class
if that other method does not change any member data?
I want to simply have a seperate method that returns a huge string,
that string containing code in another language, which is to be
compiled by a third party API when my object is being contructed.
class MyClass()
{
public:
MyClass()
{
m_effect = ThirdPartyAPIFunction( GetHLSL() );
}
private:
const std::string GetHLSL()
{
std::string hlsl = "";
/*1*/ hlsl += " // This is HLSL code";
/*2*/ hlsl += "float4 IntensityAmbient;";
return hlsl;
}
ThirdPartyAPIVaribale * m_effect;
};