5/3/2023 0 Comments Simpleimage opengl androidWe need to start somewhere and, generally, it’s best to start at the beginning. Or, better yet, the amazing tutorial on Android developer’s website : GLSurfaceView and the Renderer Please note everything has been put into one file on purpose to try to ease the reading. To know how everything goes together, go check the example project which goes along this article. In the next sections, I will introduce some important points and “ gotchas” without getting into implementation details. Nevertheless, that should be enough to start and launch you for OpenGL ES 3.0 or 3.1 should you need it. I am only going to talk about OpenGL ES 2.0 because it is the one supported on most Android phones (Android 2.2+). But there will be still time to care about this if and when such problems arise ! Let’s dive in ! When you use OpenGL, you speak directly to the graphic driver and so it is possible the same Java code doesn’t work the same way on all phones. “I thought Android was made in Java and I didn’t have to care about the hardware unless I would use native code (C or C++)” That means some code working on your computer may not be working as is on your phone but almost. OK, ok ! That’s not that bad, there are differences but nothing major. OpenGL ES is a variant of OpenGL’s specifications for embedded system. Android doesn’t support OpenGL but OpenGL ES. You had figured it out, it was too nice to be true, there is a catch. As for Android devices, they supports : * OpenGL ES 1.0 & 1.1 since Android 1.0 (API 4) * OpenGL ES 2.0 since Android 2.2 (API 8) * OpenGL ES 3.0 since Android 4.3 (API 18) ( almost) * OpenGL ES 3.1 since Android 5.0 (API 21) ES what now ? … It could be a phone, a computer, a TV screen or any other device that supports OpenGL. OpenGL is a programming interface which let you talk to the device’s graphic driver. To be sure we are talking about the same thing, let’s clear things up right away. ‘guardedRun’ is the method containing all the code executed by the thread which calls your Renderer.
0 Comments
Leave a Reply. |