Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 13 Jun 2001
Offline Last Active May 21 2016 04:24 PM

#5210338 How to correctly inject and share an object to multiple other objects

Posted by on 12 February 2015 - 02:20 PM

Also keep in mind that, depending on your use case, you might not want to store a reference to A at all.

It's perfectly ok to just pass A as an argument when calling a method of B or C.

#5206480 Constructor gotcha's?

Posted by on 24 January 2015 - 06:01 PM

IMO the most important aspect of OOP? Invariants!

When you are declaring a class you are introducing a new type.


The constuctor is responsible to ensure that the object is initialized with a valid state. Every public method should make sure to leave your object in a valid state satisfying the class invariant.

Once you have internalized this concept, your code will become much more robust.

#5206090 no vsync means double buffering to avoid tearing, right?

Posted by on 22 January 2015 - 06:29 PM

Without vsync there will be tearing, whether double or triple buffering doesn't matter.

#5204951 Can anyone explain why this seems to be the source of intermittent slowdown?

Posted by on 17 January 2015 - 01:21 PM




#5204317 Checking the equality of objects in C#

Posted by on 14 January 2015 - 04:01 PM

Your code is very verbose.


Any reason why you are not using properties? http://msdn.microsoft.com/en-us/library/x9fsa0sw.aspx

You can also override Equals() or the == operator to make testing for equality much simpler http://msdn.microsoft.com/en-us/library/ms173147(v=vs.80).aspx


As for your problem: Are you sure the order of the arguments on this line is correct?

Person pSearch = new Person(firstName, lastName, State, ZipCode, PhoneNumber, Address, Age);


more stuff to read:


#5203587 Estimating effort Hours

Posted by on 11 January 2015 - 06:56 PM

You can give time estimates for the tasks. These will probably be wrong however.

After finishing some amount (say one week) you should go back to the original estimates and find out what took longer and what actually was done quicker than planned.

You should involve your team in this process and absolutely make clear to them that it isn't a personal fault if they needed more time than expected.

#5200685 Is Unity good for learning?

Posted by on 29 December 2014 - 06:07 PM

Visual Studio Express is a little bit weird. It's separated into a few different versions. I personally use their professional version, but I believe that the version you'd need is called "Visual Studio Express 2013 for Windows Desktop." Express should provide all the features you could ever need


Actually Microsoft just released the community edition of visual studio for free, which has all the pro features such as plugin support.



#5195332 Decoupling physics

Posted by on 29 November 2014 - 08:28 AM

Why are you doubting that this is the correct approach?

The physics systems acts as a service in this case and the other systems are consumers.


Events or not, your picking system is dependent on the physics system either way, as without it your code would not work.

#5195273 Particle Systems & Handling Transparency

Posted by on 28 November 2014 - 05:52 PM

Tween vertex color to RGBA(0,0,0,0) this gets rid of both terms

#5195254 Particle Systems & Handling Transparency

Posted by on 28 November 2014 - 03:58 PM


(it is possible to draw additive and alpha blended particles in a single draw call).


How do you do that? (I'm an OpenGL beginner)



I suppose with the blend function: Dest * (1 - SrcAlpha) + Src


Aka premultiplied-alpha.


If SrcAlpha is 0, it simply reduces to additive blending.

If SrcAlpha is between 0 and 1 you can achieve alpha blending but you have to premultiply your textures by the alpha value first.


This also allows you to seamlessly blend from explosion to smoke and other cool effects.

#5193245 The left-hand side of an assignment must be a variable

Posted by on 17 November 2014 - 07:48 AM


How does this even let you do this?

class Foo
   Foo yolo;


It's Java. yolo is a reference. You are probably thinking in c++ terms... tongue.png

#5192939 Proper C++ header file?

Posted by on 14 November 2014 - 08:32 PM


Where is the compiler output?


Hmm...? I'm compiling with g++ from the terminal command line. The only thing being output to the terminal that isn't posted here is the command I used to compile.


g++ -c TileMap.cpp



Ah, now it's there. It wasn't when I posted.

#5192550 Live filesystem changes

Posted by on 12 November 2014 - 06:36 PM

Really, go for a version control system.

I you want to go open source you can use github.

Alternatively check out Assembla. https://www.assembla.com/home

1 Project with up to 1GB of storage is free there.

#5188647 O(pow(N,12))

Posted by on 22 October 2014 - 06:43 PM

This somehow reminds me of the lugaru source code that was posted here a while ago.

#5188643 O(pow(N,12))

Posted by on 22 October 2014 - 06:23 PM