Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6432092

OGL: BufferStrategy not recreated appropriately when the display mode is changed on a FS app

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • tbd
    • 6, 13
    • client-libs
    • 2d
    • x86
    • windows_xp

    Description

      I am drawing some graphics onto a FS frame using buffer strategy (with accelerated buffers and true page flipping) and I have rendering loop which keeps repainting the frame at periodic intervals. Now I change the display mode of the frame (say on a mouse click). The display mode changes and I expect the buf stg to lose it's contents and hence to be repainted.

      This works as expected on ddraw but on OpenGL, I get an exception for some display modes where it says the back buffers are not yet created. This is reproduced on WinXP with Nvidia GeForce4 MX4000, FX5900 with 84.21 driver. This is reproducible on Mustang b59d as well as b85.

      I have attached a sample test. Execute the sample test on OpenGL pipeline. Keep clicking the frame frequently. The rectangle rendered at the top-left corner must be properly seen after every display mode change. If you see the following exception on the console, the bug is reproduced.

      Exception in thread "main" java.lang.IllegalStateException: Buffers have not been created
      at sun.awt.windows.WComponentPeer.getBackBuffer(WComponentPeer.java:806)
      at java.awt.Component$FlipBufferStrategy.getBackBuffer(Component.java:3617)
      at java.awt.Component$FlipBufferStrategy.updateInternalBuffers(Component.java:3602)
      at java.awt.Component$FlipBufferStrategy.revalidate(Component.java:3696)
      at java.awt.Component$FlipBufferStrategy.revalidate(Component.java:3678)
      at java.awt.Component$FlipBufferStrategy.getDrawGraphics(Component.java:3670)
      at DisplayModeBufferStrategyTest.renderGraphics(DisplayModeBufferStrategyTest.java:114)
      at DisplayModeBufferStrategyTest.<init>(DisplayModeBufferStrategyTest.java:59)
      at DisplayModeBufferStrategyTest.main(DisplayModeBufferStrategyTest.java:106)

      Attachments

        Issue Links

          Activity

            People

              serb Sergey Bylokhov
              pmohansunw Praveen Mohan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: