From 4f3b7115be13d663526ff6d95219cfe45abd9fb0 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Fri, 16 Mar 2012 03:39:31 +0000 Subject: [PATCH] gl: Unify DirectConnected functions * Partial undo of hrev43864 - 3dmov I was using an old GL renderer. After my indirect GL fix, this started working well without direct rendering. (sorry for the spam) * Clean up the other GL DirectConnected functions Make it easy for know what to disable to toggle Direct Rendering. --- src/add-ons/screen_savers/flurry/Flurry.cpp | 7 +++++-- src/apps/3dmov/MainWindow.cpp | 4 ++++ src/apps/glteapot/TeapotWindow.cpp | 5 +++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/add-ons/screen_savers/flurry/Flurry.cpp b/src/add-ons/screen_savers/flurry/Flurry.cpp index f314dad2d5..31c6a153ab 100644 --- a/src/add-ons/screen_savers/flurry/Flurry.cpp +++ b/src/add-ons/screen_savers/flurry/Flurry.cpp @@ -351,7 +351,7 @@ Flurry::StartSaver(BView* view, bool preview) void Flurry::StopSaver() { - if (fFlurryView) + if (fFlurryView != NULL) fFlurryView->EnableDirectMode(false); } @@ -366,10 +366,13 @@ Flurry::DirectDraw(int32 frame) void Flurry::DirectConnected(direct_buffer_info* info) { - if (fFlurryView) { + // Enable or disable direct rendering + #if 1 + if (fFlurryView != NULL) { fFlurryView->DirectConnected(info); fFlurryView->EnableDirectMode(true); } + #endif } diff --git a/src/apps/3dmov/MainWindow.cpp b/src/apps/3dmov/MainWindow.cpp index c2ace0c446..155b094f8a 100644 --- a/src/apps/3dmov/MainWindow.cpp +++ b/src/apps/3dmov/MainWindow.cpp @@ -200,10 +200,14 @@ bool MainWindow :: QuitRequested() */ void MainWindow :: DirectConnected(direct_buffer_info *info) { + // TODO: Direct rendering causes mouse to flicker due to lack + // of a hardware cursor. + #if 0 if (fCurrentView != NULL) { fCurrentView->DirectConnected(info); fCurrentView->EnableDirectMode(true); } + #endif } /* FUNCTION: animation_thread diff --git a/src/apps/glteapot/TeapotWindow.cpp b/src/apps/glteapot/TeapotWindow.cpp index 2df2260b33..659c805612 100644 --- a/src/apps/glteapot/TeapotWindow.cpp +++ b/src/apps/glteapot/TeapotWindow.cpp @@ -213,10 +213,15 @@ TeapotWindow::QuitRequested() void TeapotWindow::DirectConnected(direct_buffer_info* info) { + // TODO: Direct rendering causes the mouse to flicker due + // to the lack of a Hardware Cursor, however without + // it the teapot freezes on mouse move. (bug?) + #if 1 if (fObjectView != NULL) { fObjectView->DirectConnected(info); fObjectView->EnableDirectMode(true); } + #endif }