How to access device in different cpp file.

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.
thanhle
Posts: 325
Joined: Wed Jun 12, 2013 8:09 am

Re: How to access device in different cpp file.

Post by thanhle »

Where do you call chunk::createMesh()?

You must do it before begin scene or After end scene.

Regards
thanh
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

Re: How to access device in different cpp file.

Post by Cube_ »

I call chunk::createMesh() from the for loop in chunk::chunk() (i.e the constructor of chunk).
do note that generating the scene nodes in the constructor of chunk works fine.

Also do note that all these calls take place before I've even initiated while(device->run)

I've conducted a short test of my build environment and while I'm not entirely sure how to interpret the results I'm pretty sure it's insane.
I linked the paste in my previous post (that I edited a few minutes ago) but here it is again
http://pastebin.com/KG9d7zc9

6 nested for loops with a conditional check at the end should not fail.


Maybe I'm just missing something vital seeing it's 2 am, I might be able to find a solution later.
For now I'll just go and sleep or something.
"this is not the bottleneck you are looking for"
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: How to access device in different cpp file.

Post by mongoose7 »

You're not very good at this. Why not do a desk check with, say, chunk size = 2. Your problem is with both x and y. Why don't *you* try to work it out. You'll need a pencil and paper. Good luck!
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

Re: How to access device in different cpp file.

Post by Cube_ »

I've already tried with a chunk size of 2, either way I was just about to post that I had solved it and can now generate my full sized chunks without problem.
I must now get some sleep, this late night programming is killing my ability to process information.
"this is not the bottleneck you are looking for"
Post Reply