read_graphic_card_capabilites.html 6.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]--><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="Asciidoctor 1.5.4"><title>Read Graphic Card Capabilites</title><link rel="stylesheet" href="./asciidoctor.css">
  2. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
  3. <link rel="stylesheet" href="./coderay-asciidoctor.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css"><link rel="stylesheet" href="/home/travis/build/jMonkeyEngine/wiki/build/asciidoc/html5/jme3/advanced/twemoji-awesome.css"></head><body class="article toc2 toc-left"><div id="header"><div id="toolbar"><a href="https://github.com/jMonkeyEngine/wiki/edit/master/src/docs/asciidoc/jme3/advanced/read_graphic_card_capabilites.adoc"><i class="fa fa-pencil-square" aria-hidden="true"></i></a><a href="https://github.com/jMonkeyEngine/wiki/new/master/src/docs/asciidoc/jme3/advanced/"><i class="fa fa-plus-square" aria-hidden="true"></i></a><input dir="auto" style="position: relative; vertical-align: top;" spellcheck="false" autocomplete="off" class="searchbox__input aa-input" id="doc-search" name="search" placeholder="Search in the doc" required="required" type="search"></div><h1>Read Graphic Card Capabilites</h1><div class="details"><span class="author" id="author"></span><br><span id="revnumber">version ,</span> <span id="revdate">2016/03/17 20:48</span></div><div id="toc" class="toc2"><div id="toctitle">Table of Contents</div><ul class="sectlevel1"><li><a href="#examples">Examples</a></li></ul></div></div><div id="content"><div id="preamble"><div class="sectionbody"><div class="paragraph"><p>When different people test your new game, you may get feedback that the game doesn&#8217;t run on their hardware, or that some details don&#8217;t look as expected. You need to detect which fetaures the user&#8217;s hardware supports, and offer a replacement for non-supported features on olde hardware (or deactivate them automatically).</p></div>
  4. <div class="paragraph"><p>You can read (and print) the capabilities of the user&#8217;s graphic card using the <code>com.jme3.renderer.Caps</code> class:</p></div>
  5. <div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code data-lang="java"><span class="predefined-type">Collection</span>&lt;Caps&gt; caps = renderer.getCaps();
  6. <span class="predefined-type">Logger</span>.getLogger(HelloWorld.class.getName()).log(<span class="predefined-type">Level</span>.INFO, <span class="error">“</span>Caps: {<span class="integer">0</span>}<span class="error">”</span>, caps.toString());</code></pre></div></div>
  7. <div class="admonitionblock note"><table><tr><td class="icon"><i class="fa icon-note" title="Note"></i></td><td class="content"><div class="paragraph"><p>Replace <code>HelloWorld</code> by the name of the class where you are using this line.</p></div></td></tr></table></div></div></div>
  8. <div class="sect1"><h2 id="examples">Examples</h2><div class="sectionbody"><div class="paragraph"><p>A newer graphic card has modern capabilities, for example OpenGL 2.1 and NonPowerOfTwoTextures:</p></div>
  9. <div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code>INFO: Running on jMonkeyEngine 3.0.0
  10. INFO: Using LWJGL 2.8.2
  11. INFO: Selected display mode: 1280 x 720 x 0 @0Hz
  12. INFO: Adapter: null
  13. INFO: Driver Version: null
  14. INFO: Vendor: ATI Technologies Inc.
  15. INFO: OpenGL Version: 2.1 ATI-7.14.5
  16. INFO: Renderer: AMD Radeon HD 6770M OpenGL Engine
  17. INFO: GLSL Ver: 1.20
  18. INFO: Timer resolution: 1.000 ticks per second
  19. INFO: Capabilities: [FrameBuffer, FrameBufferMRT, FrameBufferMultisample,
  20. OpenGL20, OpenGL21, ARBprogram, GLSL100, GLSL110, GLSL120,
  21. VertexTextureFetch, TextureArray, FloatTexture,
  22. FloatColorBuffer, FloatDepthBuffer, PackedFloatTexture, SharedExponentTexture, PackedFloatColorBuffer,
  23. TextureCompressionLATC, NonPowerOfTwoTextures, MeshInstancing]</code></pre></div></div>
  24. <div class="paragraph"><p>Here is an example of the capabilities of an semi-old graphic card that only supports OpenGL 2.0. If you use OpenGL 2.1 features you need to decide whether to branch to a low-quality replacement of the unsupported features (if you still want to support this card); or whether the game will not start at all and displays an error message explaining the user what capabilities his hardware is missing to be able to play the game.</p></div>
  25. <div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code>INFO: Running on jMonkey Engine 3
  26. INFO: Using LWJGL 2.7.1
  27. INFO: Selected display mode: 1024 x 768 x 0 @0Hz
  28. INFO: Adapter: null
  29. INFO: Driver Version: null
  30. INFO: Vendor: ATI Technologies Inc.
  31. INFO: OpenGL Version: 2.0 ATI-1.6.36
  32. INFO: Renderer: ATI Radeon X1600 OpenGL Engine
  33. INFO: GLSL Ver: 1.20
  34. INFO: Timer resolution: 1.000 ticks per second
  35. INFO: Capabilities: [FrameBuffer, FrameBufferMRT, FrameBufferMultisample,
  36. OpenGL20, ARBprogram, GLSL100, GLSL110, GLSL120,
  37. VertexTextureFetch, FloatTexture,
  38. TextureCompressionLATC, NonPowerOfTwoTextures]</code></pre></div></div>
  39. <div class="paragraph"><p>This next example is lacking <code>NonPowerOfTwoTextures</code>, this tells you that this user&#8217;s graphic card cannot handle textures with sizes that are not square powers of two (such as “128x128).</p></div>
  40. <div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code>INFO: Capabilities: [FrameBuffer, FrameBufferMRT, FrameBufferMultisample,
  41. OpenGL20, ARBprogram, GLSL100, GLSL110, GLSL120,
  42. VertexTextureFetch, FloatTexture, TextureCompressionLATC]</code></pre></div></div></div></div></div><div id="footer"><div id="footer-text">Version <br>Last updated 2019-12-20 23:30:51 +00:00</div></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script><script>docsearch({
  43. apiKey: 'a736b6d93de805e26ec2f49b55013fbd',
  44. indexName: 'jmonkeyengine',
  45. inputSelector: '#doc-search',
  46. debug: false // Set debug to true if you want to inspect the dropdown
  47. });</script></body></html>