Search found 22 matches

by fargoth
Wed Jan 10, 2024 9:43 pm
Forum: Beginners Help
Topic: [SOLVED] segmentation fault when trying to cast IGUIElement to
Replies: 3
Views: 1830

Re: segmentation fault when trying to cast IGUIElement to

Ah, I've found it :) Needed to disable RTTI and use static_cast instead of dynamic_cast...
by fargoth
Wed Jan 10, 2024 9:03 pm
Forum: Beginners Help
Topic: [SOLVED] segmentation fault when trying to cast IGUIElement to
Replies: 3
Views: 1830

[SOLVED] segmentation fault when trying to cast IGUIElement to

I'm trying to retrieve the value selected on a menu. The following line gives seg fault on dynamic_cast<std::remove_pointer_t<T> *>(guiElement); From here: std::remove_pointer_t<T> * getGuiElement(int in_id) { //check that T is a valid type to try to upcast during compile time. static_assert(std::is...
by fargoth
Tue Jan 09, 2024 9:59 pm
Forum: Beginners Help
Topic: What should I use instead of CBatchingMesh?
Replies: 1
Views: 1791

What should I use instead of CBatchingMesh?

I'm trying to make my game run on a modern system, and apparently the latest version doesn't have CBatchingMesh anymore... What's the replacement?
by fargoth
Wed May 27, 2015 7:56 pm
Forum: Beginners Help
Topic: re-creating device during run-time
Replies: 1
Views: 516

re-creating device during run-time

I want to change the device settings (e.g. resolution, full screen) during run-time. The following code closes my application instead of resetting the resolution:     void CMazeGameEngine::setResulotion(unsigned int in_width, unsigned int in_height) {     init(in_width, in_height);     setupMenuAndW...
by fargoth
Wed May 27, 2015 5:47 pm
Forum: Beginners Help
Topic: The video card is my bottleneck - how to speed it up?
Replies: 0
Views: 823

The video card is my bottleneck - how to speed it up?

I've used the CBatchingMesh to hold my whole maze - since I thought it's not that big and demanding - it's just 250 planes + 500 boxes - all boxes with same texture of about 100kb and all planes with the same texture of about the same size... I only see about 10th of these planes and boxes at a give...
by fargoth
Wed May 27, 2015 5:29 pm
Forum: Beginners Help
Topic: dynamic_cast of IGUIElement seg faults
Replies: 4
Views: 535

Re: dynamic_cast of IGUIElement seg faults

But to access the function of the spinbox from the base guielement pointer I still have to dynamic_cast, don't I?
My game crushed on me before I turned RTTI on, and the only thing I did was dynamic_cast, I didn't even use typeid...
by fargoth
Wed May 27, 2015 5:22 pm
Forum: Beginners Help
Topic: Determine legal resolution for full screen mode
Replies: 3
Views: 660

Re: Determine legal resolution for full screen mode

Thank you very much!
by fargoth
Sun May 24, 2015 6:01 am
Forum: Beginners Help
Topic: dynamic_cast of IGUIElement seg faults
Replies: 4
Views: 535

dynamic_cast of IGUIElement seg faults

It seems irrlicht is configured to compile with no RTTI - Is there a reason why I shouldn't enable it? Maybe I should modify how I go about things? I'm casting to get the gui values after a button was clicked, e.g: unsigned int CMazeGameMenu::getChosenNumOfAIPlayers()     {         float numOfAI = d...
by fargoth
Sat May 23, 2015 1:00 pm
Forum: Beginners Help
Topic: animator stops animating while camera is re-positioning?
Replies: 0
Views: 705

animator stops animating while camera is re-positioning?

I've made a little camera controller class which makes the camera fly to wherever it's pointed at. But my circular motion animator stops animating while the camera is on the move... am I doing something wrong? Here's my code: _levelStartTime = _timer->getRealTime();         unsigned int lastFrameTim...
by fargoth
Sat May 23, 2015 12:52 pm
Forum: Beginners Help
Topic: Determine legal resolution for full screen mode
Replies: 3
Views: 660

Determine legal resolution for full screen mode

Is there a way to determine in run-time the possible resolutions a computer supports for full-screen mode? I'm making a video settings menu and I want to populate it only with the right options... I would also like to know how I determine if certain features are supported, e.g. parallax mapping (my ...
by fargoth
Sat May 09, 2015 1:18 pm
Forum: Beginners Help
Topic: Why use meshBuffer?
Replies: 3
Views: 923

Why use meshBuffer?

I've got many similar meshes (walls) in my scene graph (created one mesh, and added many IMeshSceneNodes) Is it better to add all these meshes up into one Mesh using it's meshBuffers? If so, Why? I would have to add each vertex of the mesh over and over again with the appropriate offsets, which seem...
by fargoth
Sat May 09, 2015 11:44 am
Forum: Beginners Help
Topic: Mesh overlap - is it a problem?
Replies: 1
Views: 543

Mesh overlap - is it a problem?

Hi, I've built a dynamic maze using   _sceneManager->getGeometryCreator()->createCubeMesh(...)   To build the maze walls, and I intend to push the result into a meshBuffer. To make the maze use as little vertices as possible (because it could be very big), I have long cubes for long corridor walls -...
by fargoth
Fri May 08, 2015 12:58 pm
Forum: Beginners Help
Topic: Movement animators vs. main loop "evolve"
Replies: 3
Views: 564

Re: Movement animators vs. main loop "evolve"

Thanks for the reply, I thought I was missing something... So I guess I'll just write the rotation bit myself, so that I'd know exactly when to stop and start walking straight. Do you have any advice regarding player controls? I've currently inherited IEventReciever, and made my event receiver acqua...
by fargoth
Fri May 08, 2015 12:06 pm
Forum: Beginners Help
Topic: irrlicht memory management
Replies: 5
Views: 992

Re: irrlicht memory management

I understand it's just a counter.. I just want to make sure I got it correctly: If I use a create function to get an animator node, add it to another node, and than call clear on scene manager - I would still have that animator node because it had 2 refs, and now it has one? So I have to drop the an...
by fargoth
Fri May 08, 2015 11:56 am
Forum: Beginners Help
Topic: Movement animators vs. main loop "evolve"
Replies: 3
Views: 564

Movement animators vs. main loop "evolve"

I've walked through the irrlicht movement tutorial. It seems there are two ways to move a scene node - one is through an animator, and the other is setting position and rotation in the game loop. I think using animators is the more elegant way, but I can't find an example of how to use it the way I ...