Jump to content

  • Log In with Google      Sign In   
  • Create Account

Madhed

Member Since 13 Jun 2001
Offline Last Active Today, 02:38 PM

#5206480 Constructor gotcha's?

Posted by Madhed 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 Madhed 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 Madhed on 17 January 2015 - 01:21 PM

http://www.gamedev.net/blog/355/entry-2260109-a-quick-introduction-to-sampler-based-profiling/

 

http://www.codersnotes.com/sleepy




#5204317 Checking the equality of objects in C#

Posted by Madhed 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);

EDIT:

more stuff to read:

http://msdn.microsoft.com/en-us/library/bb384054.aspx




#5203587 Estimating effort Hours

Posted by Madhed 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 Madhed 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.

 

http://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx




#5195332 Decoupling physics

Posted by Madhed 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 Madhed 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 Madhed 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 Madhed 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 Madhed 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 Madhed 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 Madhed 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 Madhed on 22 October 2014 - 06:23 PM

c3d0981ae770f926eedf4eda7505b006.jpeg




#5188641 Is optimization for performance bad or is optimizating too early bad?

Posted by Madhed on 22 October 2014 - 06:21 PM

Optimizing is bad if your "sub optimal" code is actually running perfectly fine on the target system and you have more important things to do.

Optimizing code that you haven't tested is bad because you are most probably fishing in the dark.






PARTNERS