From 46fe340be3154ac416c62f44b2e0a1bf9bc7d306 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 24 May 2010 19:23:02 -0400 Subject: [PATCH 1/2] ui.gadgets.worlds: don't enable depth buffer by default, since it just wastes memory and apps which need it can pass custom pixel-format-attributes to open-window to enable it explicitly --- basis/ui/gadgets/worlds/worlds.factor | 1 - extra/nehe/2/2.factor | 11 ++++++++++- extra/nehe/4/4.factor | 13 +++++++++++-- extra/nehe/5/5.factor | 13 +++++++++++-- 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/basis/ui/gadgets/worlds/worlds.factor b/basis/ui/gadgets/worlds/worlds.factor index cdee1ab02d..a63d64312b 100644 --- a/basis/ui/gadgets/worlds/worlds.factor +++ b/basis/ui/gadgets/worlds/worlds.factor @@ -20,7 +20,6 @@ CONSTANT: default-world-pixel-format-attributes { windowed double-buffered - T{ depth-bits { value 16 } } } CONSTANT: default-world-window-controls diff --git a/extra/nehe/2/2.factor b/extra/nehe/2/2.factor index d28bbdb904..0d6d498b37 100644 --- a/extra/nehe/2/2.factor +++ b/extra/nehe/2/2.factor @@ -39,5 +39,14 @@ M: nehe2-gadget draw-gadget* ( gadget -- ) -1.0 -1.0 0.0 glVertex3f ] do-state ; -MAIN-WINDOW: run2 { { title "NeHe Tutorial 2" } { pref-dim { $ width $ height } } } +MAIN-WINDOW: run2 + { + { title "NeHe Tutorial 2" } + { pref-dim { $ width $ height } } + { pixel-format-attributes { + windowed + double-buffered + T{ depth-bits { value 16 } } + } } + } >>gadgets ; diff --git a/extra/nehe/4/4.factor b/extra/nehe/4/4.factor index 0cddcfcaa3..0ca23570e9 100644 --- a/extra/nehe/4/4.factor +++ b/extra/nehe/4/4.factor @@ -68,5 +68,14 @@ M: nehe4-gadget graft* ( gadget -- ) M: nehe4-gadget ungraft* ( gadget -- ) t >>quit? drop ; -MAIN-WINDOW: run4 { { title "NeHe Tutorial 4" } { pref-dim { $ width $ height } } } - >>gadgets ; +MAIN-WINDOW: run4 + { + { title "NeHe Tutorial 4" } + { pref-dim { $ width $ height } } + { pixel-format-attributes { + windowed + double-buffered + T{ depth-bits { value 16 } } + } } + } + >>gadgets ; diff --git a/extra/nehe/5/5.factor b/extra/nehe/5/5.factor index e6f5c6e6ba..a0b6cddec6 100644 --- a/extra/nehe/5/5.factor +++ b/extra/nehe/5/5.factor @@ -120,5 +120,14 @@ M: nehe5-gadget graft* ( gadget -- ) M: nehe5-gadget ungraft* ( gadget -- ) t >>quit? drop ; -MAIN-WINDOW: run5 { { title "NeHe Tutorial 5" } { pref-dim { $ width $ height } } } - >>gadgets ; +MAIN-WINDOW: run4 + { + { title "NeHe Tutorial 5" } + { pref-dim { $ width $ height } } + { pixel-format-attributes { + windowed + double-buffered + T{ depth-bits { value 16 } } + } } + } + >>gadgets ; From 07e92b50ce4cd2437f8e21bd9462f9e6219c3b6e Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 24 May 2010 19:23:55 -0400 Subject: [PATCH 2/2] ui.backend.x11: don't pass GLX_USE_GL since its a no-op and Mesa doesn't like it --- basis/ui/backend/x11/x11.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/ui/backend/x11/x11.factor b/basis/ui/backend/x11/x11.factor index d43f814eef..4e69455865 100644 --- a/basis/ui/backend/x11/x11.factor +++ b/basis/ui/backend/x11/x11.factor @@ -30,7 +30,7 @@ M: world configure-event ! In case dimensions didn't change relayout-1 ; -PIXEL-FORMAT-ATTRIBUTE-TABLE: glx-visual { $ GLX_USE_GL $ GLX_RGBA } H{ +PIXEL-FORMAT-ATTRIBUTE-TABLE: glx-visual { $ GLX_RGBA } H{ { double-buffered { $ GLX_DOUBLEBUFFER } } { stereo { $ GLX_STEREO } } { color-bits { $ GLX_BUFFER_SIZE } }