Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It's been about three years since I was last doing any ES work, so I may be out of date or simply remembering some stuff incorrectly.</p> <ol> <li><p>No, targeting OpenGL for desktop does not equal targeting OpenGL ES, because ES is a subset. ES does not implement immediate mode functions (<code>glBegin()</code>/<code>glEnd()</code>, <code>glVertex*()</code>, ...) Vertex arrays are the main way of sending stuff into the pipeline.</p> <p>Additionally, it depends on what profile you are targetting: at least in the Lite profile, ES does not need to implement floating point functions. Instead you get fixed point functions; think 32-bit integers where first 16 bits mean digits before decimal point, and the following 16 bits mean digits after the decimal point.</p> <p>In other words, even simple code <em>might</em> be unportable if it uses floats (you'd have to replace calls to <code>gl*f()</code> functions with calls to <code>gl*x()</code> functions. </p> <p>See how you might solve this problem in <a href="https://doc-snapshots.qt.io/4.8/opengl-hellogl-es.html" rel="nofollow noreferrer">Trolltech's example</a> (specifically the <code>qtwidget.cpp</code> file; it's Qt example, but still...). You'll see they make this call:</p> <p><code>q_glClearColor(f2vt(0.1f), f2vt(0.1f), f2vt(0.2f), f2vt(1.0f));</code></p> <p>This is meant to replace call to glClearColorf(). Additionally, they use macro <code>f2vt()</code> - meaning <em>float to vertex type</em> - which automagically converts the argument from float to the correct data type.</p></li> <li><p>While I was developing some small demos three years ago for a company, I've had success working with <a href="http://www.imgtec.com/PowerVR/insider/sdkdownloads/" rel="nofollow noreferrer">PowerVR's SDK</a>. It's for Visual C++ under Windows; I haven't tried it under Linux (no need since I was working on company PC).</p></li> </ol> <hr> <p>A small update to reflect my recent experiences with ES. (June 7th 2011)</p> <ul> <li>Today's platforms probably don't use the Lite profile, so you probably don't have to worry about fixed-point decimals</li> <li>When porting your desktop code for mobile (e.g. iOS), quite probably you'll have to do primarily these, and not much else: <ul> <li>replace <code>glBegin()</code>/<code>glEnd()</code> with vertex arrays</li> <li>replace some calls to functions such as <code>glClearColor()</code> with calls such as <code>glClearColorf()</code></li> <li>rewrite your windowing and input system</li> <li>if targeting OpenGL ES 2.0 to get shader functionality, you'll now <i>have</i> to completely replace fixed-function pipeline's built in behavior with shaders - at least the basic ones that reimplement fixed-function pipeline</li> </ul></li> <li>Really important: unless your mobile system is not memory-constrained, you really want to look into using texture compression for your graphics chip; for example, on iOS devices, you'll be uploading PVRTC-compressed data to the chip</li> </ul>
 

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