Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using deprecated FrameBuffer methods in jme3-core and jme3-desktop #1657

Closed
stephengold opened this issue Nov 16, 2021 · 3 comments · Fixed by #1696
Closed

using deprecated FrameBuffer methods in jme3-core and jme3-desktop #1657

stephengold opened this issue Nov 16, 2021 · 3 comments · Fixed by #1696
Assignees
Milestone

Comments

@stephengold
Copy link
Member

While compiling "master" branch with "-Xlint:deprecation":


/home/sgold/Git/jmonkeyengine/jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java:185: warning: [deprecation] setDepthTexture(com.jme3.texture.Texture2D) in com.jme3.texture.FrameBuffer has been deprecated
                renderFrameBuffer.setDepthTexture(depthTexture);
                                 ^
/home/sgold/Git/jmonkeyengine/jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java:491: warning: [deprecation] setDepthTexture(com.jme3.texture.Texture2D) in com.jme3.texture.FrameBuffer has been deprecated
                renderFrameBufferMS.setDepthTexture(msDepth);
                                   ^
/home/sgold/Git/jmonkeyengine/jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java:492: warning: [deprecation] setColorTexture(com.jme3.texture.Texture2D) in com.jme3.texture.FrameBuffer has been deprecated
                renderFrameBufferMS.setColorTexture(msColor);
                                   ^
/home/sgold/Git/jmonkeyengine/jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java:496: warning: [deprecation] setDepthBuffer(com.jme3.texture.Image.Format) in com.jme3.texture.FrameBuffer has been deprecated
                renderFrameBufferMS.setDepthBuffer(depthFormat);
                                   ^
/home/sgold/Git/jmonkeyengine/jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java:497: warning: [deprecation] setColorBuffer(com.jme3.texture.Image.Format) in com.jme3.texture.FrameBuffer has been deprecated
                renderFrameBufferMS.setColorBuffer(fbFormat);
                                   ^
/home/sgold/Git/jmonkeyengine/jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java:503: warning: [deprecation] setDepthBuffer(com.jme3.texture.Image.Format) in com.jme3.texture.FrameBuffer has been deprecated
            renderFrameBuffer.setDepthBuffer(depthFormat);
                             ^
/home/sgold/Git/jmonkeyengine/jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java:505: warning: [deprecation] setColorTexture(com.jme3.texture.Texture2D) in com.jme3.texture.FrameBuffer has been deprecated
            renderFrameBuffer.setColorTexture(filterTexture);
                             ^
/home/sgold/Git/jmonkeyengine/jme3-core/src/main/java/com/jme3/renderer/Caps.java:522: warning: [deprecation] getDepthBuffer() in com.jme3.texture.FrameBuffer has been deprecated
        RenderBuffer depthBuf = fb.getDepthBuffer();
                                  ^
/home/sgold/Git/jmonkeyengine/jme3-core/src/main/java/com/jme3/renderer/Caps.java:537: warning: [deprecation] getNumColorBuffers() in com.jme3.texture.FrameBuffer has been deprecated
        for (int i = 0; i < fb.getNumColorBuffers(); i++){
                              ^
/home/sgold/Git/jmonkeyengine/jme3-core/src/main/java/com/jme3/renderer/Caps.java:538: warning: [deprecation] getColorBuffer(int) in com.jme3.texture.FrameBuffer has been deprecated
            if (!supportsColorBuffer(caps, fb.getColorBuffer(i))){
                                             ^

Apparently caused by PR #1401. Issue #1554 covers similar warnings in jme3-examples. For hints, see PR #1616.

@stephengold stephengold added this to the v3.5.0 milestone Nov 16, 2021
@stephengold
Copy link
Member Author

Other related warnings:

/home/sgold/Git/jmonkeyengine/jme3-core/src/main/java/com/jme3/post/Filter.java:113: warning: [deprecation] setDepthBuffer(com.jme3.texture.Image.Format) in com.jme3.texture.FrameBuffer has been deprecated
                renderFrameBuffer.setDepthBuffer(depthBufferFormat);
                                 ^
/home/sgold/Git/jmonkeyengine/jme3-core/src/main/java/com/jme3/post/Filter.java:116: warning: [deprecation] setDepthTexture(com.jme3.texture.Texture2D) in com.jme3.texture.FrameBuffer has been deprecated
                    renderFrameBuffer.setDepthTexture(depthTexture);
                                     ^
/home/sgold/Git/jmonkeyengine/jme3-core/src/main/java/com/jme3/post/Filter.java:121: warning: [deprecation] setDepthBuffer(com.jme3.texture.Image.Format) in com.jme3.texture.FrameBuffer has been deprecated
                renderFrameBuffer.setDepthBuffer(depthBufferFormat);
                                 ^
/home/sgold/Git/jmonkeyengine/jme3-core/src/main/java/com/jme3/post/Filter.java:124: warning: [deprecation] setDepthTexture(com.jme3.texture.Texture2D) in com.jme3.texture.FrameBuffer has been deprecated
                    renderFrameBuffer.setDepthTexture(depthTexture);
                                     ^
/home/sgold/Git/jmonkeyengine/jme3-core/src/main/java/com/jme3/post/Filter.java:128: warning: [deprecation] setColorTexture(com.jme3.texture.Texture2D) in com.jme3.texture.FrameBuffer has been deprecated
            renderFrameBuffer.setColorTexture(renderedTexture);
                             ^

@stephengold
Copy link
Member Author

Extending this issue to jme3-desktop:

> Task :jme3-desktop:compileJava
/home/sgold/Git/jmonkeyengine/jme3-desktop/src/main/java/com/jme3/system/AWTFrameProcessor.java:623: warning: [deprecation] setDepthBuffer(com.jme3.texture.Image.Format) in com.jme3.texture.FrameBuffer has been deprecated
			frameBuffer.setDepthBuffer(Image.Format.Depth);
			           ^
/home/sgold/Git/jmonkeyengine/jme3-desktop/src/main/java/com/jme3/system/AWTFrameProcessor.java:624: warning: [deprecation] setColorBuffer(com.jme3.texture.Image.Format) in com.jme3.texture.FrameBuffer has been deprecated
			frameBuffer.setColorBuffer(Image.Format.RGBA8);
			           ^
/home/sgold/Git/jmonkeyengine/jme3-desktop/src/main/java/com/jme3/system/AWTComponentRenderer.java:189: warning: [deprecation] setDepthBuffer(com.jme3.texture.Image.Format) in com.jme3.texture.FrameBuffer has been deprecated
      this.frameBuffer.setDepthBuffer(Image.Format.Depth);
                      ^
/home/sgold/Git/jmonkeyengine/jme3-desktop/src/main/java/com/jme3/system/AWTComponentRenderer.java:190: warning: [deprecation] setColorBuffer(com.jme3.texture.Image.Format) in com.jme3.texture.FrameBuffer has been deprecated
      this.frameBuffer.setColorBuffer(Image.Format.RGBA8);
                      ^
/home/sgold/Git/jmonkeyengine/jme3-desktop/src/main/java/com/jme3/system/awt/AwtPanel.java:245: warning: [deprecation] setDepthBuffer(com.jme3.texture.Image.Format) in com.jme3.texture.FrameBuffer has been deprecated
        fb.setDepthBuffer(Format.Depth);
          ^
/home/sgold/Git/jmonkeyengine/jme3-desktop/src/main/java/com/jme3/system/awt/AwtPanel.java:246: warning: [deprecation] setColorBuffer(com.jme3.texture.Image.Format) in com.jme3.texture.FrameBuffer has been deprecated
        fb.setColorBuffer(Format.RGB8);
          ^
6 warnings

@stephengold stephengold changed the title using deprecated FrameBuffer methods in jme3-core using deprecated FrameBuffer methods in jme3-core and jme3-desktop Nov 16, 2021
bob0bob added a commit to bob0bob/jmonkeyengine that referenced this issue Dec 3, 2021
…MonkeyEngine#1657

Updating all references to setDepthTexture  and setColorTexture from old system to the new system.
@bob0bob
Copy link
Contributor

bob0bob commented Dec 3, 2021

I submitted a pull request for updating all these calls.

stephengold added a commit that referenced this issue Dec 9, 2021
…1657  (#1696)

* This is a very simple addition. It allows a person to set 3 variables in AppSettings. ‘CenterWindow’, ‘WindowXPosition’ and ‘WindowYPosition’ variables. This way these variable will be saved in the profile when the profile is saved, and be reloaded. I added ‘CenterWindow’ to be added with a ‘true’ value for the default value so it will run just like it did before.

But if you set ‘CenterWindow’ to ‘false’ then inside LwjglWindow.java (lwjgl3 code) it will look at these new values, it will determine to center the window or use the position values to place the window back at the location the user last moved it to.

Of course, these values are only updated if the “program” updates this value. So if you want to save screen position, you can save them on closing to and on restart put the window back into the same location.

* formatting and comments changes.

* jme3test.app.TestApplication hangs with LWJGL3 #1193
LWJGL3-JME library would block the current thread when executing LWJGL3.    Instead of calling run() that is blocking,  made it work like LWJGL2-JME library when they start it as a thread so run gets called. I commented out the run() function and replaced it with Thread.start().

* removing unwanted changes, since you can't do multiple pull requests at once.

* formatting issues.

* changed parameter naming to be more consistency with other items.

* jme3test.app.TestApplication hangs with LWJGL3 #1193

LWJGL3-JME projects was doing a call that is blocking the current thread.  I changed it to match how LWJGL2-JME project launches the Context Window.

* jme3test.app.TestApplication hangs with LWJGL3 #1193 (#3)

LWJGL3-JME projects was doing a call that is blocking the current thread.  I changed it to match how LWJGL2-JME project launches the Context Window.

* removing unwanted changes.

* AppSettings:  enhance the new javadoc

* AppSettings:  capitalize Window{X/Y}Position consistent w/other settings

* LwjglWindow:  convert tabs to spaces

* AppSettings:  re-arrange @see tags in javadoc

* using deprecated FrameBuffer methods in jme3-core and jme3-desktop #1657

Updating all references to setDepthTexture  and setColorTexture from old system to the new system.

* Removing unused imports.

* missed an unused import.

* FrameBuffer:  improve formatting of the added sourcecode

* tweak the whitespace

Co-authored-by: Stephen Gold <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants