Irrlicht Documentation question

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
oppositescopez
Posts: 14
Joined: Wed Sep 11, 2013 3:00 pm
Contact:

Irrlicht Documentation question

Post by oppositescopez »

So, ive been able to modify the examples and get little things to work off of that but i have some questions. Keep in mind this is the first 3d engine that ive ever used, and im not really experienced with creating code from documented ..source? i think would be the right word. though i do have a well understanding of c++.

lets say for example i wanted to change the cursor in my application, well , the first place i would look is namespace list->gui where i can find the ICursorControl class. now i can see the virtual void irr::gui::ICursorControl::changeIcon function and it says "replace a cursor icon" i can look at the definition and see the enumeration paramaters for ECURSOR_ICON. but what i could not find is how do you know, when you need to use this to use getCursorControl
. the only reason i got it to work is because one of the examples had

Code: Select all

 device->getCursorControl()->setVisible(true);
so i modified it and did

Code: Select all

 device->getCursorControl()->setActiveIcon(ECI_CROSS);
and from the tutorials ive learned to know to add using namespace gui to get it working correctly. (or probably using gui:: before device would work to)

but how was i supposed to know to use getCursorControl to use it, under the setActiveIcon section of the member function Documentation i cant find any reasoning
telling me to use that with it. though maybe i just dont have enough experience with documentation to know how to just get anything "working". i wish i knew some free pdf's or lessons on understanding the logic behind using documentation or logical 3d engine use with c++ or something along the lines of that that would help me out other than more and more c++ tutorials. if anyone can help or knows of any references please share.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht Documentation question

Post by CuteAlien »

Getting familiar with new technology takes always time. Just use every channel of information you can find.

First look at the examples coming with the engine. Having an example that does already what you are trying to do is generally the most useful documenation you can get. In this case "24.CursorControl" would probably have been helpful. Study the source and find out how it does what it does. If you have trouble with the source then the the API information often can help you out.

If all that fails - do as you do now - ask in the forum and we try to help :-)
You can also sometimes get help in the chat for quick questions (see my .sig for chat channel), but for anything that can't be answered in 1-2 lines you are mostly better offf with this forum.

Once you get more familiar with an engine the API documenation will become more and more useful as you already will have a sense of where you can probably find what you need and will only have to find the correct name and parameters.

And lastly - once in a while it helps looking at the engine source directly.

About that specific question - you have setActiveIcon and how to find out you need getCursorControl(). Documentation tells you setActiveIcon is a member of ICursorControl. So you need to find some class to get that. As all the examples show the main class in Irrlicht is the IrrlichtDevice class. So start searching there until you find a function returning an ICursorControl. In this case looking at Irrlicht device is already suffient as getCursorControl is a direct member of IrrlichtDevice. If the class is not found there you might have search the classes you can access from that main-class.

If you still don't find it then use the search-over-all-files function of your IDE. Use a project where you have the Irrlicht headers included (Irrlicht engine project file is maybe a good one). Search for example for "ICursorControl" and it can return you all headers which contain that word. Or if you don't know the class-name yet search for names that seem to make sense ("cursor"). Of if you are on Linux then instead of using the IDE you can use a tool like ack-grep which is great for searching for specific programming words in folders.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply