[Lazarus] Fast drawing to canvas

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Sat Feb 11 09:56:21 CET 2012


On Fri, Feb 10, 2012 at 7:58 PM, Reimar Grabowski <reimgrab at web.de> wrote:
> 2D projection functions have never been part of OpenGL AFAIK, mind telling me which functions you talk about?

  glMatrixMode(GL_PROJECTION);
  glLoadIdentity;
  glOrtho(0, OpenGLControl1.Width, OpenGLControl1.Height, 0, 0, 1);
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  glDisable(GL_DEPTH_TEST);
  glViewport(0, 0, OpenGLControl1.Width, OpenGLControl1.Height);
  glGenTextures(1, @TextureId);
  glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);

> OpenGL ES 2.0 did not change everything. It just removed the fixed function pipeline (as OpenGL 3 did) in favor of the programmable one, which is a Good Thing(tm).

Not good for people drawing 2D bitmaps

> And nobody forces you to use ES 2 just use 1.x if you like it more.

Since it is version 2 I suppose people will start dropping support for
version 1 in the future.

> It is not, the two are very, very similar.

lol! But just read any OpenGL tutorial which you can imagine. It
always starts with glBegin, glEnd and boom ... doesnt work in OpenGL
ES. And, read the code here:

http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/components/fpvectorial/examples/fpv3d_mainform.pas?root=lazarus&revision=35186&content-type=text%2Fplain

Which part of this code works in OpenGL ES 2? And it isnt even 2D, it
is 3D triangles. Anything from it works at all?

But my real question is: how can you have 1 code for all those OpenGL
versions to draw 2D bitmaps? Seriously, Id like to know. If it is
impossible then how can one say they are very similar?

> This is what it may look like for a beginner.

For me, not beginner friendly is a very strong indicator of a bad design.

-- 
Felipe Monteiro de Carvalho




More information about the Lazarus mailing list