Topic: Using M_VARIABLE_TEXTURE_REF

I'm slowly trying to get this particle system working. I've confirmed that it compiles and runs nicely on both Windows and Linux (yay!) and I've started looking at texturing, however, I can't seem to work out how the M_VARIABLE_TEXTURE_REF works.

I have got a MTextureRef as a member, I've initialised it with m_Texture(0, "", false) as I would assume this would make an empty reference. I have then passed this variable back to the editor within getVariable, however, all I get is a section in the editor which says Texture, but won't let me do anything. Is M_VARIABLE_TEXTURE_REF just read only? Will I have to read a string and then load the texture from that?

As always, I'm still looking into this issue, so I might reply to myself in a bit with a "Eureka" tongue

Re: Using M_VARIABLE_TEXTURE_REF

aw, no it's my fault, I made it by anticipation along with M_VARIABLE_SHADER_REF but it's not plugged yet to MaratisUI,
it was used in one version, I still have the code somewhere, I'm trying to find it back and I let you know.

Re: Using M_VARIABLE_TEXTURE_REF

Oh, that's alright then, if it doesn't work for now, I can work around it using just a string, can easily be replaced later.

I would like to use this again to bring up the possibility of a wiki with API reference. I am willing to host it myself if that makes things easier. I would be happy to contribute with what I have discovered, including sample code.

Re: Using M_VARIABLE_TEXTURE_REF

Yes, it's possible to start a wiki here, it's a good idea,
I will see what we can install.

Re: Using M_VARIABLE_TEXTURE_REF

That would be great! Just point me at it when it's done and I'll start writing tongue

Re: Using M_VARIABLE_TEXTURE_REF

All right, there is now a mediawiki at "http://anael.maratis3d.com/mwiki"
it will be later accessed by "wiki.maratis3d.org" (in 24h probably)

You should be able to create an account, I had some problem to make the image system working,
there is still some problem to upload images to the wiki, for now only external files is working I don't know why.

Re: Using M_VARIABLE_TEXTURE_REF

I found the code, it's on svn.
To use a texture ref, in your behavior add a MTextureRef pointer (ex : MTextureRef * m_myTexture)
and use M_VARIABLE_TEXTURE_REF with a pointer pointer :

return MVariable("myTexture", &m_myTexture, M_VARIABLE_TEXTURE_REF);

don't forget to set the pointer to NULL in the behavior constructor, and for the copy constructor you can copy the pointer.

Re: Using M_VARIABLE_TEXTURE_REF

Thanks, I will try that later today. Unfortunately I haven't been able to do much today, I did, however, start writing a bit on the wiki, I have begun to fill out the API on the MFile interface. Before I continued, I wanted to check whether what I had done was acceptable. The start is here.

Re: Using M_VARIABLE_TEXTURE_REF

Thank you for the doc, it's perfect ! if we can have all the api filled like that it will be gold.

Re: Using M_VARIABLE_TEXTURE_REF

That's great then, I will try to document the things I've had a hand in working with this week and maybe try to get some code snippets in there as examples.  I should have some time to get at least that done smile

Re: Using M_VARIABLE_TEXTURE_REF

Very good thing to have a wiki smile i can contribute on basic lua functions if you want me to.
Cheers

Re: Using M_VARIABLE_TEXTURE_REF

Hi Vegas, yes of course, it's open to everyone,
I started the script section, maybe you want to add documentation and examples ? Thanks !

Re: Using M_VARIABLE_TEXTURE_REF

Alright, i've started writing this in offline mode, then post once i have enough stuff smile

Re: Using M_VARIABLE_TEXTURE_REF

I was wondering if we could get a link to the wiki on the support page wink