gl_draw_loop   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/examples/contrib/nuklear.xtm

Implementation

(bind-func gl_draw_loop
  (let ((layout:nk_panel* null)
        (combo:nk_panel* null)
        (easy:i32 0)
        (hard:i32 1) (op easy)
        (property:i32 20)
        (bg:|4,float|* (alloc)))
    (lambda (time:i64 delta_t:double)
      (if (= (glfwWindowShouldClose window) 1)
          (begin (nk_glfw3_shutdown)
                 (glfwTerminate)
                 (println "Window closed, stopping draw loop."))
          (begin
           (glClear GL_COLOR_BUFFER_BIT)
           (glfwPollEvents)
           (nk_glfw3_new_frame)
           (if (= (nk_begin ctx layout "Demo" (pref (nk_rect 50. 50. 230. 250.) 0)
                            (+ NK_WINDOW_BORDER NK_WINDOW_MOVABLE NK_WINDOW_SCALABLE
                               NK_WINDOW_MINIMIZABLE NK_WINDOW_TITLE))
                  nk_true)
               (begin
                 (nk_layout_row_static ctx 30. 80 1)
                 (if (= (nk_button_label ctx "button" NK_BUTTON_DEFAULT) nk_true)
                     (println "button pressed"))
                 (nk_layout_row_dynamic ctx 30. 2)
                 (if (= (nk_option_label ctx "easy" (convert (= op easy))) nk_true)
                     (set! op easy))
                 (if (= (nk_option_label ctx "hard" (convert (= op hard))) nk_true)
                     (set! op hard))
                 (nk_layout_row_dynamic ctx 20. 1)
                 (nk_label ctx "background:" NK_TEXT_LEFT)
                 (nk_layout_row_dynamic ctx 25. 1)
                 (if (= (nk_combo_begin_color ctx combo (nk_rgb 28 48 62) 400) nk_true)
                     (begin (nk_layout_row_dynamic ctx 120. 1)
                            (set! background (nk_color_picker ctx (nk_rgb 28 48 62) NK_RGBA))
                            (nk_layout_row_dynamic ctx 25. 1)
                            (tset! background 0
                                   (convert (nk_propertyi ctx "#R:" 0 (convert (tref background 0)) 255 1 1)))
                            (tset! background 1
                                   (convert (nk_propertyi ctx "#G:" 0 (convert (tref background 1)) 255 1 1)))
                            (tset! background 2
                                   (convert (nk_propertyi ctx "#B:" 0 (convert (tref background 2)) 255 1 1)))
                            (tset! background 3
                                   (convert (nk_propertyi ctx "#A:" 0 (convert (tref background 3)) 255 1 1)))
                            (nk_combo_end ctx)))
                 (nk_end ctx)))
           ;; draw
           (nk_color_fv (aref-ptr bg 0) (nk_rgb 28 48 62))
           ;; (glfwGetWindowSize win &width &height)
           ;; (glViewport 0 0 width height)
           (glClear GL_COLOR_BUFFER_BIT)
           (glClearColor (aref bg 0) (aref bg 1) (aref bg 2) (aref bg 3))
           ;; /* IMPORTANT: `nk_glfw_render` modifies some global OpenGL state
           ;;  * with blending, scissor, face culling, depth test and viewport and
           ;;  * defaults everything back into a default state.
           ;;  * Make sure to either a.) save and restore or b.) reset your own state after
           ;;  * rendering the UI. */
           (nk_glfw3_render NK_ANTI_ALIASING_ON MAX_VERTEX_BUFFER MAX_ELEMENT_BUFFER)
           (glfwSwapBuffers window)
           (let ((next_time (+ time (convert (* 44100. delta_t)))))
             (callback next_time gl_draw_loop next_time delta_t)))))))


Back to Index

Similar Entries

  • AudioBuffer_read_looped    xtlang
  • AudioBuffer_read_looped    xtlang
  • Rectangle    xtlang
  • Rectangle    xtlang
  • VAO_bind_and_draw_arrays    xtlang
  • _glib_main_loop_call    xtlang
  • _glib_main_loop_call    xtlang
  • _glib_main_loop_call    xtlang
  • _gst_main_loop_call    xtlang
  • ai_load_ogl_texture    xtlang
  • ai_load_ogl_texture_from_buffer    xtlang
  • beat_loop    xtlang
  • bind-gl-proc    macro
  • bind-glew    macro
  • cairo_draw_image    xtlang
  • cpvforangle    xtlang
  • cpvtoangle    xtlang
  • create_triangle_shader    xtlang
  • create_triangle_shader    xtlang
  • draw    xtlang
  • draw    xtlang
  • draw-skeleton    xtlang
  • draw_a_circle    xtlang
  • draw_a_circle    xtlang
  • draw_a_line    xtlang
  • draw_a_line    xtlang
  • draw_barplot    xtlang
  • draw_color_body_frame    xtlang
  • draw_color_body_frame_with_hands    xtlang
  • draw_frame    xtlang
  • draw_frame    xtlang
  • draw_frame    xtlang
  • draw_quad    xtlang
  • draw_rgb_frame    xtlang
  • draw_scatterplot    xtlang
  • draw_scene    xtlang
  • draw_seg    xtlang
  • draw_spectral_bar    xtlang
  • draw_spectrum_key    xtlang
  • dv_draw_axes_2D    xtlang
  • dv_draw_axis_labels_2D    xtlang
  • dv_draw_bars    xtlang
  • dv_draw_line    xtlang
  • dv_draw_line_segments    xtlang
  • dv_draw_scatter_points    xtlang
  • dv_draw_scatter_points    xtlang
  • dv_draw_title    xtlang
  • forced-gl-getprocaddress    scheme
  • forced-gl-getprocaddress    scheme
  • gl-draw    xtlang
  • gl-loop    scheme
  • gl-loop    scheme
  • gl-loop    scheme
  • gl-loop    scheme
  • gl-loop    scheme
  • gl-loop    xtlang
  • gl-loop    xtlang
  • gl-loop    xtlang
  • gl-loop    scheme
  • gl-loop    scheme
  • gl-loop    scheme
  • glCube    xtlang
  • gl_cp    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw    xtlang
  • gl_draw_arrows    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_loop    xtlang
  • gl_draw_particles    xtlang
  • gl_load_image    xtlang
  • gl_load_image_rect    xtlang
  • gl_load_movie_textures    xtlang
  • gl_load_movie_textures    xtlang
  • gl_load_tex    xtlang
  • gl_load_tex_bgr    xtlang
  • gl_load_tex_ext    xtlang
  • gl_load_tex_ext_bgr    xtlang
  • gl_load_tex_rect    xtlang
  • gl_look_at    xtlang
  • gl_print_driver_info    xtlang
  • gl_print_driver_info    xtlang
  • gl_print_driver_info    xtlang
  • gl_print_error    xtlang
  • gl_print_error    xtlang
  • gl_print_error    xtlang
  • gl_print_error    xtlang
  • gl_print_error_no_msg    xtlang
  • gl_print_error_with_msg    xtlang
  • gl_render    xtlang
  • gl_render    xtlang
  • gl_render    xtlang
  • gl_render    xtlang
  • gl_render    xtlang
  • gl_render    xtlang
  • gl_render    xtlang
  • gl_render    xtlang
  • gl_render    xtlang
  • gl_render    xtlang
  • gl_render    xtlang
  • gl_render    xtlang
  • gl_render    xtlang
  • gl_render    xtlang
  • gl_render    xtlang
  • gl_set_proc_address    xtlang
  • gl_set_view    xtlang
  • gl_setup    xtlang
  • gl_tex_height    xtlang
  • gl_tex_height_rect    xtlang
  • gl_tex_width    xtlang
  • gl_tex_width_rect    xtlang
  • glctx    scheme
  • glctx    scheme
  • glctx    scheme
  • glctx    scheme
  • glew-name-from-gl-name    scheme
  • glew_init    xtlang
  • glfw_char_callback:GLFWcharfun    xtlang
  • glfw_create_fullscreen_interaction_window    xtlang
  • glfw_create_fullscreen_interaction_window    xtlang
  • glfw_create_fullscreen_window    xtlang
  • glfw_create_fullscreen_window    xtlang
  • glfw_create_interaction_window    xtlang
  • glfw_create_window    xtlang
  • glfw_cursor_position_callback:GLFWcursorposfun    xtlang
  • glfw_destroy_window    xtlang
  • glfw_error_callback:GLFWerrorfun    xtlang
  • glfw_get_framebuffer_height    xtlang
  • glfw_get_framebuffer_width    xtlang
  • glfw_get_pixel_ratio    xtlang
  • glfw_get_window_height    xtlang
  • glfw_get_window_width    xtlang
  • glfw_init    xtlang
  • glfw_init_and_create_compatibility_window    xtlang
  • glfw_init_and_create_fullscreen_compatibility_window    xtlang
  • glfw_init_and_create_fullscreen_interaction_compatibility_window    xtlang
  • glfw_init_and_create_fullscreen_interaction_window    xtlang
  • glfw_init_and_create_fullscreen_interaction_window    xtlang
  • glfw_init_and_create_fullscreen_window    xtlang
  • glfw_init_and_create_fullscreen_window    xtlang
  • glfw_init_and_create_interaction_compatibility_window    xtlang
  • glfw_init_and_create_interaction_window    xtlang
  • glfw_init_and_create_window    xtlang
  • glfw_key_callback:GLFWkeyfun    xtlang
  • glfw_make_context_current    xtlang
  • glfw_mouse_button_callback:GLFWmousebuttonfun    xtlang
  • glfw_poll_events    xtlang
  • glfw_print_primary_monitor_details    xtlang
  • glfw_print_version_string    xtlang
  • glfw_print_video_mode_details    xtlang
  • glfw_set_compatibility_profile    xtlang
  • glfw_set_core_profile    xtlang
  • glfw_swap_buffers    xtlang
  • glfw_terminate    xtlang
  • glfw_window_focus_callback:GLFWwindowfocusfun    xtlang
  • glfw_window_position_callback:GLFWwindowposfun    xtlang
  • glfw_window_should_close    xtlang
  • glib-main-loop    scheme
  • glib-main-loop    scheme
  • glib_main_loop    xtlang
  • global_transform2d    xtlang
  • global_var_test1    xtlang
  • global_var_test1b    xtlang
  • glong_alloc    xtlang
  • glong_halloc    xtlang
  • glong_zalloc    xtlang
  • glwrapper-arg-list-symbols    scheme
  • glwrapper-arg-list-symbols    scheme
  • godot_global_get_singleton    xtlang
  • gst-main-loop    scheme
  • gui_draw_circle    xtlang
  • gui_draw_rect    xtlang
  • gui_draw_text_in_bounds    xtlang
  • gui_render_loop    xtlang
  • impc:aot:insert-ext-globalvar-binding-details    scheme
  • impc:aot:insert-gl-proc-binding-details    scheme
  • impc:aot:insert-globalvar-binding-details    scheme
  • impc:ir:compiler:loop    scheme
  • impc:ir:compiler:loop    scheme
  • impc:ir:compiler:while-loop    scheme
  • impc:ir:make-arglist-str    scheme
  • impc:ti:doloop    scheme
  • impc:ti:get-global-var-types    scheme
  • impc:ti:get-globalvar-docstring    scheme
  • impc:ti:get-globalvar-type    scheme
  • impc:ti:gl-proc-alist-index    scheme
  • impc:ti:globalvar-exists?    scheme
  • impc:ti:print-globalvar-cache    scheme
  • impc:ti:register-new-globalvar    scheme
  • impc:ti:remove-single-element-lists    scheme
  • impc:ti:reset-globalvar-cache    scheme
  • impc:ti:set-globalvar-docstring    scheme
  • init_draw_quad    xtlang
  • init_gl    xtlang
  • init_globals    xtlang
  • loop    scheme
  • loop    scheme
  • loop    scheme
  • loop    scheme
  • loop    scheme
  • loop    scheme
  • loop    scheme
  • loop    scheme
  • loop2    scheme
  • loop2    scheme
  • mainLoop    xtlang
  • mainLoop    xtlang
  • midi-loop    scheme
  • midi-loop    scheme
  • midi_read_loop    xtlang
  • move_triangle    xtlang
  • my-gl-loop    xtlang
  • node_reply_loop    xtlang
  • node_reply_loop_stop    xtlang
  • nonblocking_read_loop    xtlang
  • nonblocking_read_loop    xtlang
  • nonblocking_read_loop    xtlang
  • nonblocking_read_loop    xtlang
  • nvg_draw_loop    xtlang
  • nvg_draw_loop    xtlang
  • nvg_draw_loop    xtlang
  • nvg_draw_loop    xtlang
  • nvg_draw_text    xtlang
  • ocv_rectangle    xtlang
  • opengl-loop    scheme
  • opengl-loop    scheme
  • opengl-loop    scheme
  • opengl-loop    scheme
  • opengl-test    scheme
  • opengl-test    scheme
  • opengl-test    scheme
  • opengl-test    xtlang
  • psystem_draw    xtlang
  • psystem_draw    xtlang
  • receiver_loop    xtlang
  • reply_loop    xtlang
  • rmap-loop-runner    macro
  • run_main_event_loop    xtlang
  • shader_prepare_draw    xtlang
  • shader_prepare_draw    xtlang
  • shader_prepare_draw    xtlang
  • shader_prepare_draw    xtlang
  • shader_prepare_draw    xtlang
  • shadertoy-loop    scheme
  • some_gl_init    xtlang
  • xtm-setup-and-start-gl-loop    scheme
  • xtm_draw_arc    xtlang
  • xtm_draw_arc_fill    xtlang
  • xtm_draw_arc_fill    xtlang
  • xtm_draw_arc_fill    xtlang
  • xtm_draw_arc_fill    xtlang
  • xtm_draw_arc_fill    xtlang
  • xtm_draw_arc_fill    xtlang
  • xtm_draw_arc_fill    xtlang
  • xtm_draw_arc_fill    xtlang
  • xtm_draw_arc_stroke    xtlang
  • xtm_draw_arc_stroke    xtlang
  • xtm_draw_arc_stroke    xtlang
  • xtm_draw_arc_stroke    xtlang
  • xtm_draw_arc_stroke    xtlang
  • xtm_draw_arc_stroke    xtlang
  • xtm_draw_arc_stroke    xtlang
  • xtm_draw_arc_stroke    xtlang
  • xtm_draw_arcd    xtlang
  • xtm_draw_bezier_fill    xtlang
  • xtm_draw_bezier_fill    xtlang
  • xtm_draw_bezier_fill    xtlang
  • xtm_draw_bezier_fill    xtlang
  • xtm_draw_bezier_stroke    xtlang
  • xtm_draw_bezier_stroke    xtlang
  • xtm_draw_bezier_stroke    xtlang
  • xtm_draw_bezier_stroke    xtlang
  • xtm_draw_circle_fill    xtlang
  • xtm_draw_circle_fill    xtlang
  • xtm_draw_circle_fill    xtlang
  • xtm_draw_circle_fill    xtlang
  • xtm_draw_circle_stroke    xtlang
  • xtm_draw_circle_stroke    xtlang
  • xtm_draw_circle_stroke    xtlang
  • xtm_draw_circle_stroke    xtlang
  • xtm_draw_ellipse    xtlang
  • xtm_draw_ellipse_fill    xtlang
  • xtm_draw_ellipse_fill    xtlang
  • xtm_draw_ellipse_fill    xtlang
  • xtm_draw_ellipse_fill    xtlang
  • xtm_draw_ellipse_stroke    xtlang
  • xtm_draw_ellipse_stroke    xtlang
  • xtm_draw_ellipse_stroke    xtlang
  • xtm_draw_ellipse_stroke    xtlang
  • xtm_draw_ellipsed    xtlang
  • xtm_draw_line    xtlang
  • xtm_draw_line    xtlang
  • xtm_draw_line    xtlang
  • xtm_draw_line    xtlang
  • xtm_draw_line    xtlang
  • xtm_draw_lined    xtlang
  • xtm_draw_mesh    xtlang
  • xtm_draw_mesh    xtlang
  • xtm_draw_model    xtlang
  • xtm_draw_model    xtlang
  • xtm_draw_path    xtlang
  • xtm_draw_path_keep    xtlang
  • xtm_draw_poly    xtlang
  • xtm_draw_polyd    xtlang
  • xtm_draw_quad    xtlang
  • xtm_draw_quad_fill    xtlang
  • xtm_draw_quad_fill    xtlang
  • xtm_draw_quad_fill    xtlang
  • xtm_draw_quad_fill    xtlang
  • xtm_draw_quad_stroke    xtlang
  • xtm_draw_quad_stroke    xtlang
  • xtm_draw_quad_stroke    xtlang
  • xtm_draw_quad_stroke    xtlang
  • xtm_draw_quadd    xtlang
  • xtm_draw_rect    xtlang
  • xtm_draw_rect_fill    xtlang
  • xtm_draw_rect_fill    xtlang
  • xtm_draw_rect_fill    xtlang
  • xtm_draw_rect_fill    xtlang
  • xtm_draw_rect_stroke    xtlang
  • xtm_draw_rect_stroke    xtlang
  • xtm_draw_rect_stroke    xtlang
  • xtm_draw_rect_stroke    xtlang
  • xtm_draw_rectd    xtlang
  • xtm_draw_round_rect    xtlang
  • xtm_draw_round_rectd    xtlang
  • xtm_draw_rounded_rect_fill    xtlang
  • xtm_draw_rounded_rect_fill    xtlang
  • xtm_draw_rounded_rect_fill    xtlang
  • xtm_draw_rounded_rect_fill    xtlang
  • xtm_draw_rounded_rect_stroke    xtlang
  • xtm_draw_rounded_rect_stroke    xtlang
  • xtm_draw_rounded_rect_stroke    xtlang
  • xtm_draw_rounded_rect_stroke    xtlang
  • xtm_draw_rounded_rect_varying_fill    xtlang
  • xtm_draw_rounded_rect_varying_fill    xtlang
  • xtm_draw_rounded_rect_varying_fill    xtlang
  • xtm_draw_rounded_rect_varying_fill    xtlang
  • xtm_draw_rounded_rect_varying_stroke    xtlang
  • xtm_draw_rounded_rect_varying_stroke    xtlang
  • xtm_draw_rounded_rect_varying_stroke    xtlang
  • xtm_draw_rounded_rect_varying_stroke    xtlang
  • xtm_draw_tex    xtlang
  • xtm_draw_tex    xtlang
  • xtm_draw_tex    xtlang
  • xtm_draw_tex    xtlang
  • xtm_draw_tex    xtlang
  • xtm_draw_tex    xtlang
  • xtm_draw_tex    xtlang
  • xtm_draw_tri    xtlang
  • xtm_draw_tri_fill    xtlang
  • xtm_draw_tri_fill    xtlang
  • xtm_draw_tri_fill    xtlang
  • xtm_draw_tri_fill    xtlang
  • xtm_draw_tri_stroke    xtlang
  • xtm_draw_tri_stroke    xtlang
  • xtm_draw_tri_stroke    xtlang
  • xtm_draw_tri_stroke    xtlang
  • xtm_draw_trid    xtlang
  • xtm_draw_vao    xtlang
  • xtm_draw_vao    xtlang
  • xtm_draw_vgimage    xtlang
  • xtm_light_angle    xtlang
  • xtm_scale_and_draw_vgimage    xtlang
  • xtm_scale_and_draw_vgimaged    xtlang
  • xtmdoc-globalvar-handler    scheme