OpenGL vs OpenGL ES 2.0 - Can an OpenGL Application Be Easily Ported? -


I am working on the gaming framework, and am a newcomer to OpenGL. Most books do not give very clear answers to this question, and I want to develop OpenGL on my desktop, but executing code in the OpenGL ES 2.0 environment. My question is two times:

  1. If I target my framework for OpenGL on desktop, will it run without any modification in the surroundings of OpenGL ES 2.0?
  2. If not, then there is a good emulator, PC or Mac; Is there a script that I can convert to my OpenGL code in OpenGL ES code, or flag things that will not work?
  3. It has been around three years since I was finally working on any ES , So I can be old or remember just a few things wrongly

    1. No, targeting OpenGL for desktop is not similar to the target of OpenGL, because EE is a subset of ES instantaneous mode functions ( glBegin () , > does not apply glEnd () glVertex * () , ...) The main way to send goods in the pipeline is to Vertex arrays.

      In addition, it depends on you which product you are targeting: At least in Lite profile, e does not need to implement the floating point function, instead you can set a fixed point Get the Function; 32-bit integers think that where the first 16 bits means the digits before the decimal point, and the following 16 bits mean digits after the decimal point.

      In other words, even ordinary code can be if it uses floats, then you can not find the answer (you have gl * F () calls have to be called to call with the gl * x () function.

      See how you can solve this problem (Especially qtwidget.cpp file; this is a Qt example, but still ...). You will see that they call:

      q_glClearColor (F2vt (0.1f), f2vt (0.1f), f2vt (0.2f), F2vt (1.0f));

      To call it glClearColorf (). Additionally, those macros f2vt () mean - float type - which automatically converts float to the correct data type from the logic.

    2. When I developed a small demo three years ago for a company I was successful, I have worked successfully. It is under Visual C ++ for Windows, I have not seen it under Linux (not required because I Not the company was working on a PC).


    A small update to reflect on my recent experiences with ES (7 June 2011)

    • Today's Platforms probably do not use Lite Profile, so you definitely do not have to worry about fixed point dots
    • Desktop codes for mobile (like IOS), maybe you get them mainly Do not do more:
      • Change glBegin () / glEnd () Top head With some
      • glClearColor () to replace some calls to act as glClearColorf ()
      • If OpenGL ES 2.0 is targeted to get shader functionality, then now you is to the Fade-Function Pipeline Shader Made in practice with at least basic things that replenish the fixed function pipeline
    • really important: as long as there is no barrier-mobile system memory, you really want to use texture compression for your graphics fragment; For example, on iOS device, you will upload PVRTC-compiled data to a chip

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -