Jump to content

  • Log In with Google      Sign In   
  • Create Account

reaperrar

Member Since 12 Mar 2011
Offline Last Active Aug 25 2014 08:45 PM

Posts I've Made

In Topic: Alpha blending fails unless Debug mode

14 March 2013 - 03:08 AM

 

Desc.RenderTarget[a].DestBlendAlpha = HZBLENDVALUE_ONE;

 

What's HZBLENDVALUE_ONE supposted to be?

Typo in the post, not in the code... my bad. Edited


In Topic: [Resolved] std::list clear() - Unhandled Exception

26 January 2013 - 10:49 PM

Ty for the help. The problem was in fact somewhere unrelated though not too far fortunately. Stopped looking at the list itself though thx to your replies.


In Topic: Two-Phase construction...

13 January 2013 - 05:36 AM

No offence or unfair stereotyping intended, but the only code-bases I've used that were based around two-phase construction, were projects where the majority of staff weren't very good at C++, but were decent at C.

The largest project I've ever worked on took 1min to compile lol. It's hard to grasp the reasons for avoiding T-PC because of this I beleive. I haven't much real c++ experience though I realised my design was wrong because of the research I did into it. Came here to the begginers area for convincing and your post was most helpful, ty.

 

I have used placement new before though didn't make the connection that the allocation/construction happened in a identical way to my two-phase approach. I was using a pool, allocating space for the object and calling initialise when a new object was requested.

 

I'll avoid using two-phase construction flippantly in my design.


In Topic: Two-Phase construction...

13 January 2013 - 04:29 AM

Why are you not wanting to use a vector?

 

If possible, I'd like memory required by the object to be local to the object rather than off in some random place. Plus I'm under the impression the vector will copy the object into each instance (as opposed to call each instance's constructer with the value individually), so if the object is not meant to be copied that could be a problem down the track I'm thinking.

 

I guess I'm just seeing if there are alternatives to the vector though it appears there isn't without two-phase construction.


In Topic: Two-Phase construction...

13 January 2013 - 01:11 AM

I'm a little confused about how could go about doing this...

 

class MyClass
{
	public:
		MyClass(int i) : m_i(i);
		~MyClass();
		
	private:
		int m_i;
}

int main()
{
	const unsigned int uiArraySize = 1000;
	int iInitializeValue = 5;
	
	MyClass oClass[uiArraySize] = {iInitializeValue, iInitializeValue, iInitializeValue...};

	return 0;
}

If I want all instances of the class to intialize with value "iInitializeValue" is there some automatic way this can be done instead of copy paste 1000 times xD?

 

EDIT: ...Without using anything other than syntax? I don't want to be forced to use something in std::

EDIT: Also, I assume acheiving the same thing is out of the question with the new operator when creating an array, though it would then seem more appropriate to use the std::vector.... unless the object provided to be copied from is non-copyable. /sigh


PARTNERS