Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 16 Apr 2012
Offline Last Active Jan 26 2015 04:27 PM

Posts I've Made

In Topic: OpenGL - Lighting not working?

21 June 2012 - 03:54 PM

Posted Image

In Topic: OpenGL - Lighting not working?

21 June 2012 - 03:29 PM

Have you a glTexEnv of GL_MODULATE anywhere?

Excuse my idiotic questions, but what is that?

In Topic: class members, stack or heap?

17 April 2012 - 08:07 AM

When you are dealing with large amounts of data (like classes), you almost always want it on the heap. As previously mentioned, the stack is rather small, and putting a whole bunch of data on it could easily cause it to overflow. The heap, however, is much larger, and therefore better for classes, structs, etc. Just make sure you always deallocate: the stack does that for you, the heap does not.

int main() {
int x = new int;
//Use the variable
delete x; //Deallocate now that your done
return 0;

In Topic: Structure Vector in class

16 April 2012 - 01:09 PM

Another note: I do not recommend putting
using namespace std;
on top like that. You are putting all that junk into the global namespace, which isn't good practice. I'd recommend putting it inside functions instead, or at least, only do stuff like this:
using std::cout;
using std::cin;
using std::string;