| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <!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">
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
- <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’t run on their hardware, or that some details don’t look as expected. You need to detect which fetaures the user’s hardware supports, and offer a replacement for non-supported features on olde hardware (or deactivate them automatically).</p></div>
- <div class="paragraph"><p>You can read (and print) the capabilities of the user’s graphic card using the <code>com.jme3.renderer.Caps</code> class:</p></div>
- <div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code data-lang="java"><span class="predefined-type">Collection</span><Caps> caps = renderer.getCaps();
- <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>
- <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>
- <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>
- <div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code>INFO: Running on jMonkeyEngine 3.0.0
- INFO: Using LWJGL 2.8.2
- INFO: Selected display mode: 1280 x 720 x 0 @0Hz
- INFO: Adapter: null
- INFO: Driver Version: null
- INFO: Vendor: ATI Technologies Inc.
- INFO: OpenGL Version: 2.1 ATI-7.14.5
- INFO: Renderer: AMD Radeon HD 6770M OpenGL Engine
- INFO: GLSL Ver: 1.20
- INFO: Timer resolution: 1.000 ticks per second
- INFO: Capabilities: [FrameBuffer, FrameBufferMRT, FrameBufferMultisample,
- OpenGL20, OpenGL21, ARBprogram, GLSL100, GLSL110, GLSL120,
- VertexTextureFetch, TextureArray, FloatTexture,
- FloatColorBuffer, FloatDepthBuffer, PackedFloatTexture, SharedExponentTexture, PackedFloatColorBuffer,
- TextureCompressionLATC, NonPowerOfTwoTextures, MeshInstancing]</code></pre></div></div>
- <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>
- <div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code>INFO: Running on jMonkey Engine 3
- INFO: Using LWJGL 2.7.1
- INFO: Selected display mode: 1024 x 768 x 0 @0Hz
- INFO: Adapter: null
- INFO: Driver Version: null
- INFO: Vendor: ATI Technologies Inc.
- INFO: OpenGL Version: 2.0 ATI-1.6.36
- INFO: Renderer: ATI Radeon X1600 OpenGL Engine
- INFO: GLSL Ver: 1.20
- INFO: Timer resolution: 1.000 ticks per second
- INFO: Capabilities: [FrameBuffer, FrameBufferMRT, FrameBufferMultisample,
- OpenGL20, ARBprogram, GLSL100, GLSL110, GLSL120,
- VertexTextureFetch, FloatTexture,
- TextureCompressionLATC, NonPowerOfTwoTextures]</code></pre></div></div>
- <div class="paragraph"><p>This next example is lacking <code>NonPowerOfTwoTextures</code>, this tells you that this user’s graphic card cannot handle textures with sizes that are not square powers of two (such as “128x128).</p></div>
- <div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code>INFO: Capabilities: [FrameBuffer, FrameBufferMRT, FrameBufferMultisample,
- OpenGL20, ARBprogram, GLSL100, GLSL110, GLSL120,
- 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({
- apiKey: 'a736b6d93de805e26ec2f49b55013fbd',
- indexName: 'jmonkeyengine',
- inputSelector: '#doc-search',
- debug: false // Set debug to true if you want to inspect the dropdown
- });</script></body></html>
|