static void Frame() { int[] pixels = Fire.Run(); fixed(int *pImg = pixels) { sg_image_content content = new sg_image_content { content0 = new sg_subimage_content { ptr = pImg, size = pixels.Length * sizeof(int), } }; sg_update_image(img, &content); } sgl_defaults(); sgl_enable_texture(); sgl_texture(img); sgl_begin_quads(); sgl_v2f_t2f(-1.0f, -1.0f, 1.0f, 1.0f); sgl_v2f_t2f(1.0f, -1.0f, 0.0f, 1.0f); sgl_v2f_t2f(1.0f, 1.0f, 0.0f, 0.0f); sgl_v2f_t2f(-1.0f, 1.0f, 1.0f, 0.0f); sgl_end(); sg_pass_action pass_action = new sg_pass_action(); sg_begin_default_pass(&pass_action, sapp_width(), sapp_height()); sgl_draw(); sg_end_pass(); sg_commit(); }
public static extern void sg_begin_pass(sg_pass pass, [In] ref sg_pass_action pass_action);
public static extern void sg_begin_default_pass([In] ref sg_pass_action pass_action, int width, int height);