provide swapbuffers # load opengl <-> graphics system bindings for X11 # provides: makecurrent swapbuffers events screendims movewindow fullscreen display # context window # in addition, it specifies an interface to open/close more windows # and to set the current window context. # todo: surface specific interface (for 3dp) load-x11 defer surface "( -- surface )\tReturns current surface (drawing context)" doc : window ":0" x11:make-glx constant ; "( -- )\tCreate a window object. Parses word." doc # create window context (FIXME: x11 specific) # ":0" x11:make-glx constant window # create global window object (not mapped yet) # FIXME hardcoded system specific stuff : makecurrent surface x11:makecurrent ;; : swapbuffers surface x11:swapbuffers ;; : events surface x11:events ;; : screendims surface x11:dims@ ;; # glx specific : movewindow surface x11:move ;; : fullscreen surface x11:fullscreen ;; # call this before uploading textures : display surface x11:dims! makecurrent swapbuffers ; # cursor : cursor surface x11:cursor ; # if there's no window created manually, we do it on the fly variable default-window : w default-window @ ; : dormant # ":0" "" x11:make-glx default-window ! ['] w [is] surface surface ;; ' dormant is surface # instead of manually: # window w ' w is surface