Note that there are some explanatory texts on larger screens.

plurals
  1. POJava Hardware Acceleration not working with Intel Integrated Graphics
    primarykey
    data
    text
    <p>Hi everyone I hope someone can help me solve this problem. I'm having trouble getting hardware acceleration to work on a laptop with Intel Integrated Graphics.</p> <h1>The Problem:</h1> <p>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.</p> <hr> <h1>Details</h1> <p>Graphics Card: Intel(R) HD Graphics 4000<br/> JRE: Java 7 Update 11<br/> OS: Windows 7, Windows 8<br/></p> <hr> <h1>Expected Results</h1> <p><img src="https://i.stack.imgur.com/PmCoZ.png" alt="Image of expected results (http://i.stack.imgur.com/PmCoZ.png)."></p> <hr> <h1>Actual Results</h1> <p><img src="https://i.stack.imgur.com/P3gkb.png" alt="Image of actual results (http://i.stack.imgur.com/P3gkb.png)."></p> <hr> <h1> Resources </h1> <p>If you want to verify the problem you can download the app I created for testing at: <a href="http://ndcubed.com/downloads/GraphicsTest.zip" rel="nofollow noreferrer">http://ndcubed.com/downloads/GraphicsTest.zip</a><br/><br/> If you don't feel comfortable downloading a compiled JAR file you can compile the app yourself using the following source code:</p> <pre><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) &gt; getHeight() || y &lt; 0) { delta *= -1; } g2.setColor(Color.blue); g2.fillRect(getWidth()-50, y, 50, 50); } } </code></pre> <h1>Conclusions</h1> <p>Without hardware acceleration a lot of apps that I've created that require it run slowly on the machine with Integrated Graphics. Its really baffling to me why its not working specifically with this type of graphics card. Anyway thank you for reading all this hopefully we can get to the bottom of this :)!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload