Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    When using copyImage() on the framebuffer, it captures the previous frame.

    Bug Reporting (FUZE 4 Nintendo Switch)
    2
    2
    167
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • vinicity
      vinicity F last edited by vinicity

      CopyImage() is a great tool if you want to capture and manipulate what is currently displayed on the framebuffer.

      The problem is that it is not capturing the current frame, it is capturing the one before the current frame. Consider this program:

      for t = 0 to 10 loop
        clear()
        print(t)
        update()
      
        screenGrab = copyImage(frameBuffer, {0, 0, gWidth(), gHeight()})
        drawImage(screenGrab, gWidth() / 2, 0)
        update()
      
        sleep(1)
      repeat
      

      First it prints a number on the screen, calling update() to make sure it is shown.
      Then it does copyImage() from the framebuffer, and prints the result next to the
      previous number so you can compare them.

      I would expect the same number to show up twice on the screen.

      What actually happens is that the number is shown, and next to it is a copy of the previous frame, which is evident since the number shown is one less.

      This feels like a bug.

      Weirdly enough, adding an extra update() after row 4 makes no difference, but adding two extra update() makes the program show the same frame both left and right, like this:

      for t = 0 to 10 loop
        clear()
        print(t)
        update()
        update()
        update()
      
        screenGrab = copyImage(frameBuffer, {0, 0, gWidth(), gHeight()})
        drawImage(screenGrab, gWidth() / 2, 0)
        update()
      
        sleep(1)
      repeat
      

      I have shared my example program, ID: NXYUURKD5C

      1 Reply Last reply Reply Quote 1
      • Willpowered
        Willpowered Fuze Team last edited by

        Thanks for the report- We're aware of various issues like this, and I've put this in the log for reference. The short answer is that it has to do with how the drawing instructions for each frame are processed internally, which are not necessarily synchronized with what the program is doing.

        1 Reply Last reply Reply Quote 2
        • First post
          Last post