Return back to marek-knows.com Member Community
Game Development, 3D Modeling, Art, Sound Effects and more


VMK 8 Camera class member variables

 
Post new topic   Reply to topic    Member Community Forum Index -> OpenGL Game Engine VMK
View previous topic :: View next topic  
Prometheus



Joined: 24 Feb 2010
Posts: 2

 PostPosted: Wed Feb 24, 2010 9:57 pm    Post subject: VMK 8 Camera class member variables Reply with quote Back to top

First of all let me say "Hi to all!"
I'm new here and I've recently bought a copy of the GameEngine DVD and I hope it will arrive soon!
In the meanwhile I've been able to follow the tutorial until VMK 8, the ones who talks about the Camera and I have to say that they are very easy to follow, even for a non C++ programmer like me.
I'm a Java programmer so I've never had to deal with pointers and there is this question that keeps bugging me.
Sometimes class member variables are declared as non pointer and sometimes they are declared as pointers.
I've thought that you declare a member variable as pointer when you cannot foresee how the memory will be allocated for that specific member variable. As a rule, I thought that most classes used as member variables of other classes need to be declare as pointers, like ErrorHandler.
But in the VMK 8 you have declared the Vector3 as non pointer variable (for example "Vector3 m_v3LookDirectionHome") and I really can't understand how do you determine when a member variable needs to be declared as a pointer and when not.
Probably it's a stupid question for an average C++ programmer but I really can't understand it.
Thanks in advance for any answer you'll send me and sorry for my poor English . Very Happy
 
View user's profile Send private message
Ironthorn



Joined: 31 Jan 2010
Posts: 2
Location: Russia, Murom

 PostPosted: Mon Mar 15, 2010 2:23 am    Post subject: Reply with quote Back to top

Quote:
But in the VMK 8 you have declared the Vector3 as non pointer variable (for example "Vector3 m_v3LookDirectionHome") and I really can't understand how do you determine when a member variable needs to be declared as a pointer and when not.


ErrorHandler is a singleton (we need only one copy of this class), that why we declared pointer to ErrorHandler in all other classes.

In most cases you can determine how declare member on your own.
_________________
My english bad, very bad
 
View user's profile Send private message
Prometheus



Joined: 24 Feb 2010
Posts: 2

 PostPosted: Sat May 08, 2010 7:17 pm    Post subject: Reply with quote Back to top

Thanks a lot for your answer and sorry for being so late but I couldn't get online. Thinking about singleton now it makes sense to declare ErrorHandler as a pointer.
You helped me a lot, not only for the game engine but for C++ in general.
Thanks again!
 
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Member Community Forum Index -> OpenGL Game Engine VMK All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum