Results 1 to 3 of 3
- 02-01-2013, 02:20 AM #1
Member
- Join Date
- Mar 2012
- Posts
- 5
- Rep Power
- 0
Java Hardware Acceleration / Direct3D Doesn't work with Intel Integrated Graphics?
Hi everyone
I have a strange problem that I hope someone can help me with. I can't seem to get page flipping / hardware acceleration to work on my notebook with Java using a JFrame and a BufferStrategy for animation. It appears that every computer that I've tried my app on with Intel Integrated Graphics doesn't support hardware acceleration or page flipping with Java and doesn't use Direct3D. I was wondering if anyone can confirm this with the short app I created to demo the problem? And does anyone get hardware acceleration with this configuration, is there some way to fix it since it makes animation really slow?
Thank you!
The Problem:
Hardware Acceleration using Java 7 update 11 doesn't appear to be working with Intel Integrated Graphics on a Windows 7 and 8 machine using a BufferStrategy with a JFrame.
Details:
Graphics Card: Intel(R) HD Graphics 4000
JRE: Java 7 Update 11
OS: Windows 7, Windows 8
When trying to explicitly enable the direct3d pipeline using -Dsun.java2d.d3d=True the following error occurs: Could not enable direct3d pipeline on screen 0
Expected Results:

Actual Results:

Resources:
If you want to verify the problem you can download the app I created for testing at: http://ndcubed.com/downloads/GraphicsTest.zip
If you don't feel comfortable downloading a compiled JAR file you can compile the app yourself using the following source code however the compiled jar has a few more features I added but left out in the source below for simplicity, it simply outputs the BufferStrategy's capabilities:
A variant of this question is posted here with no solution.Java Code:package graphicstest; import javax.swing.*; import java.awt.*; import java.awt.image.BufferStrategy; public class GraphicsTest extends JFrame { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { new GraphicsTest(); } }); } GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration(); BufferCapabilities bufferCapabilities; BufferStrategy bufferStrategy; int y = 0; int delta = 1; public GraphicsTest() { setTitle("Hardware Acceleration Test"); setSize(500, 300); setLocationRelativeTo(null); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setVisible(true); createBufferStrategy(2); bufferStrategy = getBufferStrategy(); bufferCapabilities = gc.getBufferCapabilities(); new AnimationThread().start(); } class AnimationThread extends Thread { @Override public void run() { while(true) { Graphics2D g2 = null; try { g2 = (Graphics2D) bufferStrategy.getDrawGraphics(); draw(g2); } finally { if(g2 != null) g2.dispose(); } bufferStrategy.show(); try { Thread.sleep(16); } catch(Exception err) { err.printStackTrace(); } } } } public void draw(Graphics2D g2) { if(!bufferCapabilities.isPageFlipping() || bufferCapabilities.isFullScreenRequired()) { g2.setColor(Color.black); g2.fillRect(0, 0, getWidth(), getHeight()); g2.setColor(Color.red); g2.drawString("Hardware Acceleration is not supported...", 100, 100); g2.setColor(Color.white); g2.drawString("Page Flipping: " + (bufferCapabilities.isPageFlipping() ? "Available" : "Not Supported"), 100, 130); g2.drawString("Full Screen Required: " + (bufferCapabilities.isFullScreenRequired() ? "Required" : "Not Required"), 100, 160); g2.drawString("Multiple Buffer Capable: " + (bufferCapabilities.isMultiBufferAvailable() ? "Yes" : "No"), 100, 190); } else { g2.setColor(Color.black); g2.fillRect(0, 0, getWidth(), getHeight()); g2.setColor(Color.white); g2.drawString("Hardware Acceleration is Working...", 100, 100); g2.drawString("Page Flipping: " + (bufferCapabilities.isPageFlipping() ? "Available" : "Not Supported"), 100, 130); g2.drawString("Full Screen Required: " + (bufferCapabilities.isFullScreenRequired() ? "Required" : "Not Required"), 100, 160); g2.drawString("Multiple Buffer Capable: " + (bufferCapabilities.isMultiBufferAvailable() ? "Yes" : "No"), 100, 190); } y += delta; if((y + 50) > getHeight() || y < 0) { delta *= -1; } g2.setColor(Color.blue); g2.fillRect(getWidth()-50, y, 50, 50); } }
- 02-01-2013, 04:54 AM #2
Re: Java Hardware Acceleration / Direct3D Doesn't work with Intel Integrated Graphics
Moved from Advanced Java
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 03-09-2013, 03:26 AM #3
Re: Java Hardware Acceleration / Direct3D Doesn't work with Intel Integrated Graphics
When you say Intel integrated graphics, I assume you mean "Intel HD" graphics. I have a Sandy Bridge Celeron in a Gigabyte GA-Z77-HD3 running Ubuntu 12.04, and I'm using the on-board HDMI. Your app says hardware acceleration is working, page flipping available, full screen not required, but not multiple buffer capable.
Get in the habit of using standard Java naming conventions!
Similar Threads
-
I don't understand why my java code doesn't work.....:(
By nonny in forum New To JavaReplies: 13Last Post: 10-04-2012, 07:45 PM -
Java Swing - JLabel setText() doesn't work
By Zyril in forum New To JavaReplies: 6Last Post: 07-29-2012, 09:51 PM -
Intel HD Integrated Graphics 3000, Java Trace, Hardware Accelerated?
By neptune296 in forum Java 2DReplies: 2Last Post: 07-03-2012, 08:09 AM -
JAVA RMI - Can't create server, because casting to it's interface doesn't work?
By arcelivez in forum NetworkingReplies: 9Last Post: 02-26-2012, 09:13 PM -
2D graphics acceleration
By matiasmorant in forum Advanced JavaReplies: 8Last Post: 01-18-2012, 01:06 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks