About Store Forum Documentation Contact



Post Reply 
a couple of questions
Author Message
craksy Offline
Member

Post: #1
a couple of questions
ok i got a couple of questions, and i wanna start out with the most embarrassing ones...
this should be pretty basic C++, but still i don't understand it : :oops:

anyway i was looking at particle tutorial, and was wondering about the Image pointer in this section:
Code:
Image *image   =Images("particle/fire.gfx");
      Color  color   =Color(0,40,0,0);
      Int    elms    =30;
      Flt    radius  =0.1,
             life_avg=1.0;


why use a pointer? i really don't get it :S why cant u just use an ordinary variable as for the rest of the arguments?
and i know i asked this before, but i didn't get it.
could one of u guys explain it to me in a simple way please? it really bugs me that i never understand these pointers :/


second thing is the virtual functions... iv'e never seen them before using Esenthel engine.
exactly what do they mean, and how do i know when to use them instead of ordinary functions?

third question, quite simple: __super() is just a reference to the parent class right?
i mean in an extended struct/class __super will be referring to the original struct the extention is a child from?
and when used in the constructor it's used for setting the parent class arguments right?
im really unsure about this, but there's a similar function (Super()) in actionscript, and at least thats what it does :/

and my last question:
is it possible to see two dimensional text in 3D? like you will be able to walk past it.
it doesn't have to be two sided, as for the purpose i need it for, you will just be moving in a straight line and wouldn't be able to see the text as you move past it anyway.

i know it's a lot of questions, but as i'm often unsure about different stuff related to the engine i stack up questions to avoid 100 posts just with questions from me pfft

i hope you'll take time to answer them smile
and if you don't understand some of it, please ask me to reformulate myself... my english is pretty poor pfft

in advance: Thanks smile

-Craksy
10-13-2009 11:21 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
Re: a couple of questions
Quote:why use a pointer?
Images loads an image only once to memory, then you can access it by pointer in many places of the code, this way you dont create copies of it (lower memory usage)

Quote:second thing is the virtual functions
they're described in documentation

Quote: __super() is just a reference to the parent class right?
yes

Quote:is it possible to see two dimensional text in 3D? like you will be able to walk past it.
yes, please check tutorial "game basics/object parameters", you can dynamically adjust the font size depending on distance to camera
TextDS tds; tds.scale=some_constant / view_pos.z;
10-13-2009 01:31 PM
Find all posts by this user Quote this message in a reply
craksy Offline
Member

Post: #3
Re: a couple of questions
Quote:Images loads an image only once to memory, then you can access it by pointer in many places of the code, this way you dont create copies of it (lower memory usage)
ok let me see if i got this right:
Using a pointer refers to the memory address of the variable which allows access to the data from everywhere, while just having a plain variable would refer to the actual variable in the code.
The image variable has to be accessed from multiple classes in order to create the particle so a pointer is used, as a normal variable would cause scope issues?

am i completely wrong about this? i really read a lot on the subject trying to understand it, but i'm still a little unsure about it :/

Quote:they're described in documentation
i did read on this, and its actually quite smart xD i never thought about the problem, or how to solve it, but virtual function seems like a good method pfft

Quote:yes
historical moment... i was actually right about something grin

Quote:yes, please check tutorial "game basics/object parameters"

ok i will look into it grin

thanks a lot grin i think i finally understand some of this stuff now grin
10-13-2009 02:05 PM
Find all posts by this user Quote this message in a reply
Post Reply