{"id":526,"date":"2011-09-30T08:54:00","date_gmt":"2011-09-30T08:54:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/android-game-development-switching-from-canvas-to-opengl-es.html"},"modified":"2018-12-28T11:19:01","modified_gmt":"2018-12-28T09:19:01","slug":"android-game-development-switching-from","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-switching-from.html","title":{"rendered":"Android Game Development &#8211; Switching from Canvas to OpenGL ES"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left\">It is about time we delve into the graphical capabilities of the Android platform. Android supports the OpenGL ES API. Needless to say that offloading graphics handling to a dedicated GPU is way more optimal than doing it in the CPU. Most android devices have such a dedicated GPU.<\/p>\n<p>OpenGL is an API for writing 2D and 3D graphics that is rendered on the GPU. This will free up precious computing resources on the CPU to be used for more complex physics or more entities or anything not related to graphics.<\/p>\n<p>There are a few notions that need to be understood but I will introduce them when we will bump into them during the course.<\/p>\n<p>If you followed the articles related to displaying graphics on an android device, you already know that in order to display graphical elements, we need a surface and a renderer. We used a basic <strong>SurfaceView<\/strong> from which we obtained the <strong>Canvas<\/strong> and we drew everything onto it by calling the supported <strong>draw<\/strong> method from within our game loop.<\/p>\n<p>Using OpenGL is not much different. Android comes with a dedicated implementation of the <strong>SurfaceView<\/strong> interface for displaying images rendered by OpenGL.<\/p>\n<p>Let\u2019s create the android project the usual way.<\/p>\n<div class=\"wp-caption alignnone\" style=\"width: 537px\">\n<table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"tr-caption-container\" style=\"margin-left: auto;margin-right: auto;text-align: center\">\n<tbody>\n<tr>\n<td style=\"text-align: center\"><a href=\"http:\/\/obviam.net\/wp-content\/uploads\/2011\/01\/Screen-shot-2011-01-22-at-19.10.15.png\"><img decoding=\"async\" alt=\"New Project Wizard\" class=\"size-full wp-image-653\" height=\"640\" src=\"http:\/\/obviam.net\/wp-content\/uploads\/2011\/01\/Screen-shot-2011-01-22-at-19.10.15.png\" width=\"431\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td class=\"tr-caption\" style=\"text-align: center\"><span class=\"Apple-style-span\" style=\"font-size: small\">New Project Wizard<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"wp-caption-text\"><\/div>\n<\/div>\n<p>I call the activity simply <strong>Run<\/strong>. Check what the wizard has generated and it should look like this:<\/p>\n<pre class=\"brush: java;\">public class Run extends Activity {\r\n    \/** Called when the activity is first created. *\/\r\n    @Override\r\n    public void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        setContentView(R.layout.main);\r\n    }\r\n}\r\n<\/pre>\n<p>Nothing special.<\/p>\n<h2>    Creating the OpenGL renderer<\/h2>\n<p>Let\u2019s build the renderer. Create a class <strong>GlRenderer<\/strong> which implements the <strong>android.opengl.GLSurfaceView.Renderer<\/strong> interface.<\/p>\n<p>It will look like this:<\/p>\n<pre class=\"brush: java;\">import javax.microedition.khronos.egl.EGLConfig;\r\nimport javax.microedition.khronos.opengles.GL10;\r\n\r\nimport android.opengl.GLSurfaceView.Renderer;\r\n\r\npublic class GlRenderer implements Renderer {\r\n\r\n\t@Override\r\n\tpublic void onDrawFrame(GL10 gl) {\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void onSurfaceChanged(GL10 gl, int width, int height) {\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void onSurfaceCreated(GL10 gl, EGLConfig config) {\r\n\t}\r\n}\r\n<\/pre>\n<p>We need to implement the above 3 methods. Currently they are empty and do nothing.<\/p>\n<h2>    The methods<\/h2>\n<p><strong>onSurfaceCreated(GL10 gl, EGLConfig config)<\/strong>created or <strong>recreated<\/strong>. It is important to bear the <strong>recreated<\/strong> bit in mind as it means every time the device goes to sleep for example and awakes, the surface gets recreated. Because the context which holds the resources gets destroyed too, this is the place where we will load our resources (images for textures, etc).<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p><strong>onSurfaceChanged(GL10 gl, int width, int height)<\/strong> is called whenever the surface size changes. This mainly affects our viewport. The <strong>viewport<\/strong> is just a rectangular region through which we see our game world.<br \/>\n&nbsp;<br \/>\n<strong>onDrawFrame(GL10 gl)<\/strong> is called by the rendering thread to draw each frame. This is where all the drawing happens. We don&#8217;t need to call it explicitly. A rendering thread is created by android for us and that will call it.<\/p>\n<p>Let&#8217;s switch to the OpenGL renderer. Check out the new <strong>Run<\/strong> activity.<\/p>\n<pre class=\"brush: java;\">package net.obviam.opengl;\r\n\r\nimport android.app.Activity;\r\nimport android.opengl.GLSurfaceView;\r\nimport android.os.Bundle;\r\nimport android.view.Window;\r\nimport android.view.WindowManager;\r\n\r\npublic class Run extends Activity {\r\n\r\n\t\/** The OpenGL view *\/\r\n\tprivate GLSurfaceView glSurfaceView;\r\n\r\n    \/** Called when the activity is first created. *\/\r\n    @Override\r\n    public void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n\r\n        \/\/ requesting to turn the title OFF\r\n        requestWindowFeature(Window.FEATURE_NO_TITLE);\r\n        \/\/ making it full screen\r\n\t\tgetWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,\r\n\t\t\t\tWindowManager.LayoutParams.FLAG_FULLSCREEN);\r\n\r\n        \/\/ Initiate the Open GL view and\r\n        \/\/ create an instance with this activity\r\n        glSurfaceView = new GLSurfaceView(this);\r\n\r\n        \/\/ set our renderer to be the main renderer with\r\n        \/\/ the current activity context\r\n        glSurfaceView.setRenderer(new GlRenderer());\r\n        setContentView(glSurfaceView);\r\n    }\r\n\r\n\t\/** Remember to resume the glSurface  *\/\r\n\t@Override\r\n\tprotected void onResume() {\r\n\t\tsuper.onResume();\r\n\t\tglSurfaceView.onResume();\r\n\t}\r\n\r\n\t\/** Also pause the glSurface  *\/\r\n\t@Override\r\n\tprotected void onPause() {\r\n\t\tsuper.onPause();\r\n\t\tglSurfaceView.onPause();\r\n\t}\r\n}\r\n<\/pre>\n<p>In line <strong>12<\/strong> we declare a <strong>GLSurfaceView<\/strong> member variable. This is our OpenGL view provided by android. When we instantiate it (line <strong>27<\/strong>) we have to make it context aware. That is, for the view to have access to the application environment.<\/p>\n<p>All we need to do is to add our renderer to this view. This we do in line <strong>31<\/strong>.<\/p>\n<p>Line <strong>32<\/strong> tells the activity to use our OpenGL view. <\/p>\n<p>The <strong>onResume()<\/strong> and <strong>onPause()<\/strong> methods are being overridden and trigger the respective methods in our view.<\/p>\n<p>You can run the application as an Android app and you should see a blank black screen.<\/p>\n<p>That is it. We have switched from the canvas to the OpenGL renderer.<\/p>\n<p>Download the source code and eclipse project <a href=\"http:\/\/obviam.net\/source_code\/obviam.opengl.p01.tgz\">here (obviam.opengl.p01.tgz)<\/a><\/p>\n<p><strong>Reference:<\/strong>&nbsp;<a href=\"http:\/\/obviam.net\/index.php\/opengl-es-with-android-switching-from-canvas-to-opengl\/\">OpenGL ES with Android Tutorial- Switching from Canvas to OpenGL<\/a>&nbsp;from our&nbsp;<a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG<\/a>&nbsp;partner Tamas Jano&nbsp;from &#8220;<a href=\"http:\/\/obviam.net\/\">Against The Grain<\/a>&#8221; blog.<\/p>\n<div style=\"margin: 0px\">Do not forget to check out our new <strong><i>Android Game<\/i><\/strong> <strong><i><a href=\"http:\/\/www.javacodegeeks.com\/2011\/06\/jcg-studios-arkdroid-official-launch.html\">ArkDroid<\/a>&nbsp;<span class=\"Apple-style-span\" style=\"font-weight: normal\"><span class=\"Apple-style-span\" style=\"font-style: normal\">(screenshots below)<\/span><\/span><\/i><\/strong>. You feedback will be more than helpful!<\/div>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/1.bp.blogspot.com\/-0dr410FpxAA\/TgdJc44bfvI\/AAAAAAAAADg\/GyMLvayT_rc\/s1600\/arkdroid_ingame.jpg\"><img decoding=\"async\" border=\"0\" height=\"200\" src=\"http:\/\/1.bp.blogspot.com\/-0dr410FpxAA\/TgdJc44bfvI\/AAAAAAAAADg\/GyMLvayT_rc\/s200\/arkdroid_ingame.jpg\" width=\"133\" \/><\/a><a href=\"http:\/\/1.bp.blogspot.com\/-sEqMxR7YZnY\/ThBGdHcIYnI\/AAAAAAAAABs\/S6iKs2lycyk\/s1600\/multiple_sticky.jpg\"><img decoding=\"async\" border=\"0\" height=\"200\" src=\"http:\/\/1.bp.blogspot.com\/-sEqMxR7YZnY\/ThBGdHcIYnI\/AAAAAAAAABs\/S6iKs2lycyk\/s200\/multiple_sticky.jpg\" width=\"133\" \/><\/a><a href=\"http:\/\/3.bp.blogspot.com\/-n99pqdxWzqM\/ThBFy-5CGmI\/AAAAAAAAABg\/LfSrtmW-RaQ\/s1600\/multiple_laser.jpg\"><img decoding=\"async\" border=\"0\" height=\"200\" src=\"http:\/\/3.bp.blogspot.com\/-n99pqdxWzqM\/ThBFy-5CGmI\/AAAAAAAAABg\/LfSrtmW-RaQ\/s200\/multiple_laser.jpg\" width=\"133\" \/><\/a><\/div>\n<div style=\"margin: 0px\"><strong>Related Articles:<\/strong><\/div>\n<ul style=\"text-align: left\">\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/06\/android-game-development-tutorials.html\">Android Game Development Tutorials Introduction<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/07\/android-game-development-game-idea.html\">Android Game Development &#8211; The Game Idea<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/07\/android-game-development-create-project.html\">Android Game Development &#8211; Create The Project<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/07\/android-game-development-basic-game.html\">Android Game Development &#8211; A Basic Game Architecture<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/07\/android-game-development-basic-game_05.html\">Android Game Development &#8211; A Basic Game Loop<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/07\/android-game-development-displaying.html\">Android Game Development &#8211; Displaying Images with Android<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/07\/android-game-development-moving-images.html\">Android Game Development &#8211; Moving Images on Screen<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/07\/android-game-development-game-loop.html\">Android Game Development &#8211; The Game Loop<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/07\/android-game-development-measuring-fps.html\">Android Game Development &#8211; Measuring FPS<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/07\/android-game-development-sprite.html\">Android Game Development &#8211; Sprite Animation<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/08\/android-game-development-particle.html\">Android Game Development &#8211; Particle Explosion<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/08\/android-game-development-design-in-game.html\">Android Game Development &#8211; Design In-game Entities &#8211; The Strategy Pattern<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-using-bitmap.html\">Android Game Development &#8211; Using Bitmap Fonts<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/10\/android-game-development-displaying.html\">Android Game Development \u2013 Displaying Graphical Elements (Primitives) with OpenGL ES<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/10\/android-game-development-opengl-texture.html\">Android Game Development \u2013 OpenGL Texture Mapping<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/10\/android-game-development-design-in-game.html\">Android Game Development \u2013 Design In-game Entities \u2013 The State Pattern<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/?tag=android-games\">Android Games Article Series<\/a><\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>It is about time we delve into the graphical capabilities of the Android platform. Android supports the OpenGL ES API. Needless to say that offloading graphics handling to a dedicated GPU is way more optimal than doing it in the CPU. Most android devices have such a dedicated GPU. OpenGL is an API for writing &hellip;<\/p>\n","protected":false},"author":27,"featured_media":46,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-526","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android-games"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Android Game Development - Switching from Canvas to OpenGL ES - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"It is about time we delve into the graphical capabilities of the Android platform. Android supports the OpenGL ES API. Needless to say that offloading\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-switching-from.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android Game Development - Switching from Canvas to OpenGL ES - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"It is about time we delve into the graphical capabilities of the Android platform. Android supports the OpenGL ES API. Needless to say that offloading\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-switching-from.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2011-09-30T08:54:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-12-28T09:19:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Impaler\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Impaler\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/09\\\/android-game-development-switching-from.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/09\\\/android-game-development-switching-from.html\"},\"author\":{\"name\":\"Impaler\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/6bad1a2db4fb0129703629617c049f8c\"},\"headline\":\"Android Game Development &#8211; Switching from Canvas to OpenGL ES\",\"datePublished\":\"2011-09-30T08:54:00+00:00\",\"dateModified\":\"2018-12-28T09:19:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/09\\\/android-game-development-switching-from.html\"},\"wordCount\":725,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/09\\\/android-game-development-switching-from.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"articleSection\":[\"Android Games\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/09\\\/android-game-development-switching-from.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/09\\\/android-game-development-switching-from.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/09\\\/android-game-development-switching-from.html\",\"name\":\"Android Game Development - Switching from Canvas to OpenGL ES - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/09\\\/android-game-development-switching-from.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/09\\\/android-game-development-switching-from.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"datePublished\":\"2011-09-30T08:54:00+00:00\",\"dateModified\":\"2018-12-28T09:19:01+00:00\",\"description\":\"It is about time we delve into the graphical capabilities of the Android platform. Android supports the OpenGL ES API. Needless to say that offloading\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/09\\\/android-game-development-switching-from.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/09\\\/android-game-development-switching-from.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/09\\\/android-game-development-switching-from.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/09\\\/android-game-development-switching-from.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/android\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Android Games\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/android\\\/android-games\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Android Game Development &#8211; Switching from Canvas to OpenGL ES\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/6bad1a2db4fb0129703629617c049f8c\",\"name\":\"Impaler\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/def7cf34ac1eee0f6c2de98be951379d6bf14fd498acf7d3864e2e570ece357c?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/def7cf34ac1eee0f6c2de98be951379d6bf14fd498acf7d3864e2e570ece357c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/def7cf34ac1eee0f6c2de98be951379d6bf14fd498acf7d3864e2e570ece357c?s=96&d=mm&r=g\",\"caption\":\"Impaler\"},\"sameAs\":[\"http:\\\/\\\/obviam.net\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Impaler\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android Game Development - Switching from Canvas to OpenGL ES - Java Code Geeks","description":"It is about time we delve into the graphical capabilities of the Android platform. Android supports the OpenGL ES API. Needless to say that offloading","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-switching-from.html","og_locale":"en_US","og_type":"article","og_title":"Android Game Development - Switching from Canvas to OpenGL ES - Java Code Geeks","og_description":"It is about time we delve into the graphical capabilities of the Android platform. Android supports the OpenGL ES API. Needless to say that offloading","og_url":"https:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-switching-from.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2011-09-30T08:54:00+00:00","article_modified_time":"2018-12-28T09:19:01+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","type":"image\/jpeg"}],"author":"Impaler","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Impaler","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-switching-from.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-switching-from.html"},"author":{"name":"Impaler","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/6bad1a2db4fb0129703629617c049f8c"},"headline":"Android Game Development &#8211; Switching from Canvas to OpenGL ES","datePublished":"2011-09-30T08:54:00+00:00","dateModified":"2018-12-28T09:19:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-switching-from.html"},"wordCount":725,"commentCount":4,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-switching-from.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","articleSection":["Android Games"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-switching-from.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-switching-from.html","url":"https:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-switching-from.html","name":"Android Game Development - Switching from Canvas to OpenGL ES - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-switching-from.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-switching-from.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","datePublished":"2011-09-30T08:54:00+00:00","dateModified":"2018-12-28T09:19:01+00:00","description":"It is about time we delve into the graphical capabilities of the Android platform. Android supports the OpenGL ES API. Needless to say that offloading","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-switching-from.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-switching-from.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-switching-from.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2011\/09\/android-game-development-switching-from.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Android","item":"https:\/\/www.javacodegeeks.com\/category\/android"},{"@type":"ListItem","position":3,"name":"Android Games","item":"https:\/\/www.javacodegeeks.com\/category\/android\/android-games"},{"@type":"ListItem","position":4,"name":"Android Game Development &#8211; Switching from Canvas to OpenGL ES"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/6bad1a2db4fb0129703629617c049f8c","name":"Impaler","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/def7cf34ac1eee0f6c2de98be951379d6bf14fd498acf7d3864e2e570ece357c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/def7cf34ac1eee0f6c2de98be951379d6bf14fd498acf7d3864e2e570ece357c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/def7cf34ac1eee0f6c2de98be951379d6bf14fd498acf7d3864e2e570ece357c?s=96&d=mm&r=g","caption":"Impaler"},"sameAs":["http:\/\/obviam.net\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/Impaler"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=526"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/526\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/46"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}