Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


BattleMetalChris

Member Since 06 Mar 2009
Offline Last Active Sep 23 2014 06:45 PM

Posts I've Made

In Topic: Function "Overload" Question

17 June 2012 - 06:33 PM

Could you not just pass a reference to a vector of the parameters? This also lets you use templates if you plan on having several versions for different parameter types.

typedef std::vector<std::string> ParamsVec;



int foo(ParamsVec& params)

{

	 std::string str;

	 cin >> str;



	 int count = 0;

	 for (ParamsVec::iterator it = params.begin(); it != params.end(); ++it)

	 {

	 	 if ((*it) == str) return count;

	 	 count++;

	 }

}




EDIT: aargh, stupid source tags, why do they cut off angle brackets if I specify a language type?...

In Topic: SampleLevel not returning alpha component

07 April 2012 - 04:11 AM

haha, I feel like an idiot, I can't believe that didn't occur to me.

In Topic: Using strings in HLSL

29 March 2012 - 03:49 AM

Given that 32 bits seems to be the smallest integer data-type hlsl can use, would it be prudent to pack a string of 64 chars into 16 ints, pass them like that, then use bitshifting to unpack them in the shader?

What about packing into four int[4]s (I know hlsl packs everything internally into arrays of four 32-bits), or would that be exactly the same as passing 16 ints?

In Topic: Alternative to singleton

15 March 2012 - 11:59 AM

Antheus, that's a fantastic explanation, thank you :)

In Topic: Why does my win32 application terminate early?

12 March 2012 - 07:22 PM

Apoch, you genius.

It was Avast, sandboxing the exe. Added it to the list of exceptions and everything works perfectly. :)

PARTNERS