diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-01-23 06:52:52 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-01-23 06:52:52 +0300 |
commit | 69310fb1076b040b75b681f3e48c1fed15dd000a (patch) | |
tree | f7ec338022d4a1a2d4fe44c7350b4f89b05b1840 /source/blender/windowmanager/intern/wm_subwindow.c | |
parent | 9872e5882ce98af8c261337a10d82d6d488294b4 (diff) |
2.5: WM Compositing
* Triple Buffer is now more complete:
- Proper handling of window resize, duplicate, etc.
- It now uses 3x3 textures (or less) if the power of two sizes
do not match well. That still has a worst case wast of 23.4%,
but better than 300%.
- It can also use the ARB/NV/EXT_texture_rectangle extension
now, which may be supported on hardware that does not support
ARB_texture_non_power_of_two.
- Gesture, menu and brushe redraws now require no redraws at all
from the area regions. So even on a high poly scene just moving
the paint cursor or opening a menu should be fast.
* Testing can be done by setting the "Window Draw Method" in the
User Preferences in the outliner. "Overlap" is still default,
since "Triple Buffer" has not been tested on computers other than
mine, would like to avoid crashing Blender on startup in case
there is a common bug, but it's ready for testing now.
- For reference "Full" draws the full window each time.
- "Triple Buffer" should work for both swap copy and swap exchange
systems, the latter still need the -E command line option for
"Overlap".
- Resizing and going fullscreen still gives flicker here but no
more than "Full" drawing.
* Partial Redraw was added. ED_region_tag_redraw_partial takes a
rect in window coordinates to define a subarea of the region.
On region draw it will then set glScissor to a smaller area, and
ar->drawrct will always be set to either the partial or full
window rect. The latter can then be used for clipping in the 3D
view or clipping interface drawing. Neither is implemented yet.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_subwindow.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_subwindow.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c index 8431317f4d9..255d22191e2 100644 --- a/source/blender/windowmanager/intern/wm_subwindow.c +++ b/source/blender/windowmanager/intern/wm_subwindow.c @@ -231,8 +231,7 @@ void wm_subwindow_position(wmWindow *win, int swinid, rcti *winrct) static wmWindow *_curwindow= NULL; static wmSubWindow *_curswin= NULL; -/* enable the WM versions of opengl calls */ -void wmSubWindowSet(wmWindow *win, int swinid) +void wmSubWindowScissorSet(wmWindow *win, int swinid, rcti *srct) { int width, height; _curswin= swin_from_swinid(win, swinid); @@ -248,7 +247,14 @@ void wmSubWindowSet(wmWindow *win, int swinid) width= _curswin->winrct.xmax - _curswin->winrct.xmin + 1; height= _curswin->winrct.ymax - _curswin->winrct.ymin + 1; glViewport(_curswin->winrct.xmin, _curswin->winrct.ymin, width, height); - glScissor(_curswin->winrct.xmin, _curswin->winrct.ymin, width, height); + + if(srct) { + width= srct->xmax - srct->xmin + 1; + height= srct->ymax - srct->ymin + 1; + glScissor(srct->xmin, srct->ymin, width, height); + } + else + glScissor(_curswin->winrct.xmin, _curswin->winrct.ymin, width, height); glMatrixMode(GL_PROJECTION); glLoadMatrixf(&_curswin->winmat[0][0]); @@ -256,7 +262,13 @@ void wmSubWindowSet(wmWindow *win, int swinid) glLoadMatrixf(&_curswin->viewmat[0][0]); glFlush(); - +} + + +/* enable the WM versions of opengl calls */ +void wmSubWindowSet(wmWindow *win, int swinid) +{ + wmSubWindowScissorSet(win, swinid, NULL); } void wmLoadMatrix(float mat[][4]) |