Hi there. I've got a serious problem becouse of speed of my program. I want to draw my scene only in some rectangle. I mean: I've got a 800x600 window, there is a 2-d graphical menu in rect (0,600,600,800), there are special 2d in the outsides of the left rect (for example (0,0,600,9)). Now I want to render my scene only in the left rectangle - in (9,9,600,591), this will couse no need of making each frame the menu from the beginning, and smaller size of the render, so it will increase the speed.
The question: How to render my scene each frame only in this rect (9,9,600,591) and leave etherything else alone ??
[rendering] only a part of the scene
Can viewports help you here? I can't remember if they have seperate updates (haven't used them in irrlicht, only in my old dx engine) if so you should set up seperate viewports and just update the one with the scene in.
If you are thinking more along "dirty rects" (for 2D) then google should help there.
If you are thinking more along "dirty rects" (for 2D) then google should help there.
-
- Posts: 340
- Joined: Wed Sep 28, 2005 4:38 pm
- Location: Canada, Eh!
Ok, I did this using viewports, but there is such a problem:
On problem, is that my menu disappears, and I need it to be seem.
Another problem is that I can't move my cursor over my menu ;/
Anyway, the viewport increased FPS from 300 to 450 !! So that's exactly what I need. But it doesn't work properly. How to deal with this ??
Code: Select all
(...)
draw menu
(...)
set viewport
(...)
while(device->run)
draw what's neccessarly
(...)
Another problem is that I can't move my cursor over my menu ;/
Anyway, the viewport increased FPS from 300 to 450 !! So that's exactly what I need. But it doesn't work properly. How to deal with this ??
-
- Posts: 370
- Joined: Mon Aug 29, 2005 10:54 pm
- Location: http://web.utk.edu/~pfox1
There must be an easier way to decrease the ammount of calculations being done. What slows your scene down so much?
Do you mean there is a menu (or something) in the ENTIRE window? If so, that is what is slowing you down I think.there is a 2-d graphical menu in rect (0,600,600,800)
The reason why your menu disappears, is probably because when you render, it won't draw your menu because it is outside of the viewport. Everything you want to render with Irrlicht must be within the viewportOn problem, is that my menu disappears, and I need it to be seem.