Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2015-04-24 18:51:20 +0300
committerDalai Felinto <dfelinto@gmail.com>2015-04-24 19:06:49 +0300
commit27ac96dbae9d6fb166776ff689bae171bd7f095b (patch)
treead744a41413e489ece22cd740e3b9918bbcdfee1 /source/blender/windowmanager/intern/wm_stereo.c
parentfb17a3fb765cf4d4eccb90bd2468dab930071792 (diff)
Multi-View: rolls back to a non quadbuffer friendly window if displaymode changes from pageflip to something else
In some cases the graphic card supports quadbuffer, but not the display. In this case it is nice to go back to a window that does not have quadbuffer if you change back to anaglyph, interlace, ... Otherwise you may be stuck with a flickering window
Diffstat (limited to 'source/blender/windowmanager/intern/wm_stereo.c')
-rw-r--r--source/blender/windowmanager/intern/wm_stereo.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/source/blender/windowmanager/intern/wm_stereo.c b/source/blender/windowmanager/intern/wm_stereo.c
index b2cd1f03bc6..4e13f6bc4d2 100644
--- a/source/blender/windowmanager/intern/wm_stereo.c
+++ b/source/blender/windowmanager/intern/wm_stereo.c
@@ -450,18 +450,28 @@ int wm_stereo3d_set_exec(bContext *C, wmOperator *op)
wmWindowManager *wm = CTX_wm_manager(C);
wmWindow *win = CTX_wm_window(C);
const bool is_fullscreen = WM_window_is_fullscreen(win);
- char display_mode = win->stereo3d_format->display_mode;
+ char prev_display_mode = win->stereo3d_format->display_mode;
+ Stereo3dData *s3dd = op->customdata;
- if (G.background)
+ if (G.background || s3dd == NULL)
return OPERATOR_CANCELLED;
- if (op->customdata) {
- Stereo3dData *s3dd = op->customdata;
- *win->stereo3d_format = s3dd->stereo3d_format;
- }
+ *win->stereo3d_format = s3dd->stereo3d_format;
- /* pageflip requires a new window to be created with the proper OS flags */
- if (win->stereo3d_format->display_mode == S3D_DISPLAY_PAGEFLIP) {
+ if (prev_display_mode == S3D_DISPLAY_PAGEFLIP &&
+ prev_display_mode != win->stereo3d_format->display_mode)
+ {
+ /* in case the hardward supports pageflip but not the display */
+ if (wm_window_duplicate_exec(C, op) == OPERATOR_FINISHED) {
+ wm_window_close(C, wm, win);
+ }
+ else {
+ BKE_report(op->reports, RPT_ERROR,
+ "Fail to create a window without quadbuffer support, you may experience flickering");
+ }
+ }
+ else if (win->stereo3d_format->display_mode == S3D_DISPLAY_PAGEFLIP) {
+ /* pageflip requires a new window to be created with the proper OS flags */
if (wm_window_duplicate_exec(C, op) == OPERATOR_FINISHED) {
if (wm_stereo3d_quadbuffer_supported()) {
wm_window_close(C, wm, win);
@@ -470,17 +480,18 @@ int wm_stereo3d_set_exec(bContext *C, wmOperator *op)
else {
wmWindow *win_new = wm->windows.last;
wm_window_close(C, wm, win_new);
- win->stereo3d_format->display_mode = display_mode;
+ win->stereo3d_format->display_mode = prev_display_mode;
BKE_report(op->reports, RPT_ERROR, "Quad-buffer not supported by the system");
}
}
else {
BKE_report(op->reports, RPT_ERROR,
"Fail to create a window compatible with the time sequential display method");
- win->stereo3d_format->display_mode = display_mode;
+ win->stereo3d_format->display_mode = prev_display_mode;
}
}
- else if (wm_stereo3d_is_fullscreen_required(win->stereo3d_format->display_mode)) {
+
+ if (wm_stereo3d_is_fullscreen_required(s3dd->stereo3d_format.display_mode)) {
if (!is_fullscreen) {
BKE_report(op->reports, RPT_INFO, "Stereo 3D Mode requires the window to be fullscreen");
}