Recent

Author Topic: How to use the OpenGLEs Library  (Read 3110 times)

karika

  • New Member
  • *
  • Posts: 20
How to use the OpenGLEs Library
« on: March 05, 2019, 09:50:52 am »
hi all
How to use the OpenGLEs Library
For example, I need a square drawing

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: How to use the OpenGLEs Library
« Reply #1 on: March 05, 2019, 04:01:42 pm »

LAMW???

Go to demos/GUI:

"AppDrawingViewDemo1"

and

"glTest1"   [direct pascal openGL]

"AppDemo1"     [direct pascal openGL]
« Last Edit: March 05, 2019, 04:11:24 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: How to use the OpenGLEs Library
« Reply #2 on: March 05, 2019, 07:27:37 pm »
LAMW supports OpenGL ES1 and OpenGL ES2. You can find those components in the Android Bridges tab:
- jCanvasES1
- jCanvasES2

I ever quickly tested jCanvasES1 but it has problem with (if I remember correctly) perspective distortion.

And jCanvasES2 has problem too. If you quickly repeatedly click it, the app with crash and exit.

@karika

Have you ever write simple games, animations or whatever using OpenGL? Learning OpenGL ES is harder, you should have basic knowledge in using OpenGL before you start to learn OpenGL ES.

If you just want to draw square and you don't need perspective distortion, OpenGL ES1 should be enough for you.

For your information, current latest version of OpenGL ES is version 4. OpenGL ES4 is fully compatible with OpenGL ES3. ES3 is backward compatible with OpenGL ES2 but OpenGL ES2 is not backward compatible with OpenGL ES1. Most programmers now won't use OpenGL ES version 1 to build new programs.

Here are the functions in jCanvasES2 for drawing:
- DrawArray
- DrawLine
- DrawRect
- DrawRectFill
- DrawPoly
- DrawPolyFill
- DrawMask
- DrawTexture
- DrawTile
- DrawCircle
« Last Edit: March 05, 2019, 08:24:22 pm by Handoko »

karika

  • New Member
  • *
  • Posts: 20
Re: How to use the OpenGLEs Library
« Reply #3 on: March 16, 2019, 09:10:18 pm »
Thank you
But why it does not appear full screen
Code: Pascal  [Select][+][-]
  1. procedure TAndroidModule1.jCanvasES2_1GLDraw(Sender: TObject);
  2. begin
  3.  
  4.   jCanvasES2_1.Screen_Setup (jCanvasES2_1.Width, jCanvasES2_1.Height, xp2D,cCull_YES);
  5.   jCanvasES2_1.Screen_Clear(4,0,5,3);
  6.  
  7.  
  8. end;
  9.  

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: How to use the OpenGLEs Library
« Reply #4 on: March 17, 2019, 02:23:29 am »
jCansvasES2.Screen_Setup is not used to make it full screen.

Instead, set the both jCanvasES2.LayoutParamH and jCanvasES2.LayoutParamW to lpMatchParent on design time.

karika

  • New Member
  • *
  • Posts: 20
Re: How to use the OpenGLEs Library
« Reply #5 on: March 17, 2019, 03:30:03 pm »
Thank you so much

karika

  • New Member
  • *
  • Posts: 20
Re: How to use the OpenGLEs Library
« Reply #6 on: March 18, 2019, 02:32:42 pm »
LAMW supports OpenGL ES1 and OpenGL ES2. You can find those components in the Android Bridges tab:
- jCanvasES1
- jCanvasES2

I ever quickly tested jCanvasES1 but it has problem with (if I remember correctly) perspective distortion.

And jCanvasES2 has problem too. If you quickly repeatedly click it, the app with crash and exit.

@karika

Have you ever write simple games, animations or whatever using OpenGL? Learning OpenGL ES is harder, you should have basic knowledge in using OpenGL before you start to learn OpenGL ES.

If you just want to draw square and you don't need perspective distortion, OpenGL ES1 should be enough for you.

For your information, current latest version of OpenGL ES is version 4. OpenGL ES4 is fully compatible with OpenGL ES3. ES3 is backward compatible with OpenGL ES2 but OpenGL ES2 is not backward compatible with OpenGL ES1. Most programmers now won't use OpenGL ES version 1 to build new programs.

Here are the functions in jCanvasES2 for drawing:
- DrawArray
- DrawLine
- DrawRect
- DrawRectFill
- DrawPoly
- DrawPolyFill
- DrawMask
- DrawTexture
- DrawTile
- DrawCircle
How to use this procedure
jCanvasES2_1.DrawRect.....
jCanvasES2_1.DrawRect(5,10,colbrGray,0.3,true);

 

TinyPortal © 2005-2018