     win "delete-event" [ on-delete ]
     GtkWidget:delete-event connect-signal ;
 
-: enable-gl ( win -- ? )
-    ${
-        GDK_GL_MODE_RGBA
-        GDK_GL_MODE_DOUBLE
-        GDK_GL_MODE_DEPTH
-        GDK_GL_MODE_STENCIL
-        GDK_GL_MODE_ALPHA
-    } [ enum>number ] [ bitor ] map-reduce
-    gdk_gl_config_new_by_mode
-    f t GDK_GL_RGBA_TYPE enum>number gtk_widget_set_gl_capability ;
-
 CONSTANT: window-controls>decor-flags
     H{
         { close-button 0 }

        GDK_FUNC_MOVE enum>number bitor gdk_window_set_functions
    ] 2tri ;

M:: gtk-ui-backend (open-window) ( world -- )
    GTK_WINDOW_TOPLEVEL gtk_window_new :> win
    world [ window-loc>> win swap first2 gtk_window_move ]
    [ dim>> win swap first2 gtk_window_set_default_size ] bi
    
    win enable-gl drop ! сделать проверку на доступность OpenGL

    win connect-signals
    
    win gtk_widget_realize
    win world window-controls>> configure-window-controls
    
    win <window-handle> world handle<<
    world win register-window
    
    win gtk_widget_show_all ;

! Copyright (C) 2010 Anton Gorenko.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien.c-types alien.data alien.enums
alien.strings arrays ascii assocs classes.struct
combinators.short-circuit command-line destructors
io.backend.unix.multiplexers io.encodings.utf8 io.thread kernel
libc literals locals math math.bitwise namespaces sequences
strings threads ui ui.backend ui.clipboards ui.event-loop
ui.gadgets ui.gadgets.private ui.gadgets.worlds ui.gestures
ui.pixel-formats ui.pixel-formats.private ui.private
glib.ffi gobject.ffi gtk.ffi gdk.ffi gdk.gl.ffi gtk.gl.ffi ;
IN: ui.backend.gtk

