Search found 3947 matches

by vitek
Wed Aug 04, 2010 3:19 am
Forum: Beginners Help
Topic: Changing all materials in the scene.
Replies: 8
Views: 582

You could do something with this.

Travis
by vitek
Sun Jul 25, 2010 5:40 pm
Forum: Beginners Help
Topic: EntityManager help!
Replies: 7
Views: 777

You might look at this thread where I describe provide an implementation of the autolist pattern. When you create an object it is automatically added to a list and the object is removed when it is destroyed.

Travis
by vitek
Mon Jul 12, 2010 4:56 am
Forum: Beginners Help
Topic: Getting all particle affectors?
Replies: 6
Views: 350

Look at the code for the CParticleSystemSceneNode::serializeAttributes() . That should tell you everything you need to know. Serialize the attributes. Once you have the attributes, iterate through them looking for ones named Affector . Based on the value, you create a particle affector of the approp...
by vitek
Tue Jul 06, 2010 3:35 pm
Forum: Beginners Help
Topic: Type Conversion Error
Replies: 3
Views: 311

Wide strings use two bytes per character instead of just one and use the type wchar_t instead of char. Not necessarily. The size of a wchar_t is platform dependent. For example, it is 4 bytes on recent versions of g++ on linux. [vitek@junta pointer]$ cat t.cpp #include <stdio.h> int main () { print...
by vitek
Wed Jun 30, 2010 10:08 pm
Forum: Beginners Help
Topic: ActiveCamera->render(); excute twice?
Replies: 2
Views: 357

I'm not saying that it is right, I'm just explaining what it looks like it is trying to do, but it looks like the scene manager needs to have an accurate value for camWorldPos before registering scene nodes (see CSceneManager::registerNodeForRendering()).

Travis
by vitek
Mon Jun 28, 2010 1:44 pm
Forum: Beginners Help
Topic: Funtion
Replies: 37
Views: 2852

If you want your code to be totally awesome, you could use macros...

Code: Select all

#define Scale(x,y,z) setScale(x,y,z)
Travis
by vitek
Tue Jun 15, 2010 9:24 pm
Forum: Beginners Help
Topic: Check if Iterator points to Zero
Replies: 9
Views: 639

The question you just answered is not your original question. If you want to get the address of the object pointed to by an iterator, you can use the trick you showed (provided the type being iterated over doesn't override unary operator&). You can use casting to avoid problems if the type does ...
by vitek
Wed Jun 09, 2010 4:19 pm
Forum: Beginners Help
Topic: [General Q] Saving and loading a struct
Replies: 6
Views: 613

The better solution would be to write proper code to serialize your object type. It would also be a good idea to use a vector or list instead of fixed length arrays.
by vitek
Tue Jun 08, 2010 8:59 pm
Forum: Beginners Help
Topic: [General Q] Saving and loading a struct
Replies: 6
Views: 613

That code is not safe at all. Using read and write that way is only safe for plain-old-data types. std::string is not a plain-old-data type.

Travis
by vitek
Mon Jun 07, 2010 12:38 am
Forum: Beginners Help
Topic: Trouble writing to a file
Replies: 11
Views: 560

If I remember correctly, the file open dialog changing the working directory as you browse the file system. If you want to avoid the working directory being changed, you need to cache the working directory before and restore it after the file dialog has done its thing. As pointed out above, you shou...
by vitek
Sun Jun 06, 2010 6:43 pm
Forum: Beginners Help
Topic: side-by-side configuration problem when i try to run my game
Replies: 4
Views: 307

Re: side-by-side configuration problem when i try to run my

Mani2010 wrote:It is a debug build but that shouldn't matter?
Yes, it does matter. Machines that don't have MSVC installed won't have the debug runtimes installed, and you aren't legally allowed to redistribute the debug libraries either.

Travis
by vitek
Mon May 31, 2010 9:55 pm
Forum: Beginners Help
Topic: IrrXML nodes to int
Replies: 9
Views: 573

if (!strcmp("model", xml->getNodeName())) doesn't work for some reason ( http://www.ambiera.com/irrxml/docu/index.html ) It gives an error (converting const wchar_t* to const char*). I used to use Irrlicht 1.6.. I never ran into any wchar errors.. Why on earth do all those functions exit ...
by vitek
Mon May 31, 2010 4:24 pm
Forum: Beginners Help
Topic: IrrXML nodes to int
Replies: 9
Views: 573

If you really must convert a wchar_t string to an integer, then you should either convert the wchar_t string to a char string, and then use atoi() , strtol() , strtoul() or strtod() , or you could write your own routine to do it directly. The solution would be trivial if you reformatted your xml to ...
by vitek
Sun May 30, 2010 11:47 pm
Forum: Beginners Help
Topic: Global Variables
Replies: 5
Views: 400

// Then create the event receiver, giving it that context structure. MyEventReceiver receiver(context); // And tell the device to use our custom event receiver. device->setEventReceiver(&receiver); The above code is the problem. You create a MyEventReceiver on the stack, and you pass a pointer ...
by vitek
Fri May 28, 2010 5:13 am
Forum: Beginners Help
Topic: Copying the last rendered page to a texture?
Replies: 20
Views: 2897

Re: Copying the last rendered page to a texture?

agamemnus wrote:createScreenShot does not do this despite what the comments in the .h file state. It's buggy, has a very odd resize, and takes an OS screenshot as opposed to an actual page copy.
Provide source to fix it then...