Hello all,
Since last being on the forum I graduated with a programming degree and now actually work as a programmer *yeah*  
Anyway I am working on building a game on the android system.  currently I am using a SurfaceView but I have noticed some places mentioning GLSurfaceView. My question is, when should I consider using openGL? What exactly is it good for? 
I am making a match 3/ rpg game like dungeon raid on iphone. That may give an idea of what I am dealing with. Here is a screenshot.
			
			
									
						
										
						When to use openGL
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: When to use openGL
OpenGL is pretty much a 3D graphics rendering engine. I think it does have some 2D capabilities, but you would not want to use them for iOS or Android. So if your game doesn't use 3D graphics, don't even bother with OpenGL. It is extremely low-level as well. You don't typically crack into OpenGL unless you are wanting to build a graphics rendering engine, since making a competent one, even for a mobile device, would take well over a year and an extremely skilled programmer at graphics programming. To make a 3D game, you typically want to start with a game engine, and the makers of said game engine would be the ones fooling with the low-level implementation and optimization of OpenGL. But, again, for a 2D game you wouldn't worry about it at all.
			
			
									
						
							The indelible lord of tl;dr
			
						Re: When to use openGL
OpenGL ES is what you might want to look into. It doesn't use as many resources as you might think and is quite useful for 2d as well as 3d graphics. To say it is low-level and render it as useless is missing the point of OpenGL, it is supposed to be low-level helping it stay lightweight.
			
			
									
						
							Fighting for peace is declaring war on war. If you want peace be peaceful.
			
						- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: When to use openGL
congrats on graduating and getting a job!
			
			
									
						
										
						- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: When to use openGL
I never said it was useless! Just that is is difficult to use, and it is not used for 2D on Android and iOS because it is not economical. iOS and Android already have much more user-friendly 2D capabilities. On the contrary, it is very useful, and as I said, it underlies pretty much every iOS 3D game engine. But that doesn't really mean a game developer wanting to make a 3D game should just dig right into OpenGL to make it. That would take forever and would be a huge waste of time! Why would you want to spend months working out pixel-lighting algorithms when you really want to make a game? Especially when there are already plenty of easy to use 3D engines that could possibly allow you to finish your entire game before you even finished creating the rendering engine on your own?Chris wrote:OpenGL ES is what you might want to look into. It doesn't use as many resources as you might think and is quite useful for 2d as well as 3d graphics. To say it is low-level and render it as useless is missing the point of OpenGL, it is supposed to be low-level helping it stay lightweight.
The golden rule of traditional 3D game development has been said to be this: You build engines if you want to build engines, but you use engines if you want to build games. That is why things like Unity 3D are so popular!

The indelible lord of tl;dr
			
						Re: When to use openGL
Are you working in 2D or 3D?  That android emulator screenshot is 2D.  Is your goal building a game or engine?  The only thing in that screenshot that I could not accomplish with a Listview and custom drawables is the blue line between the icons.  I'd have to use a scrollview and a relative layout instead.    Working directly in OpenGL will raise your effort tenfold.  Are you really sure that you need to do that?  (unless you are mucking with the opengl for its own sake).
   Working directly in OpenGL will raise your effort tenfold.  Are you really sure that you need to do that?  (unless you are mucking with the opengl for its own sake).
			
			
									
						
										
						 Working directly in OpenGL will raise your effort tenfold.  Are you really sure that you need to do that?  (unless you are mucking with the opengl for its own sake).
   Working directly in OpenGL will raise your effort tenfold.  Are you really sure that you need to do that?  (unless you are mucking with the opengl for its own sake).- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: When to use openGL
That is pretty much what I have been getting at hereCayle wrote: Working directly in OpenGL will raise your effort tenfold.

The indelible lord of tl;dr
			
						- 
				seanoseanohay
- Posts: 25
- Joined: Mon Mar 15, 2010 8:27 pm
Re: When to use openGL
Cayle wrote:Are you working in 2D or 3D? That android emulator screenshot is 2D. Is your goal building a game or engine? The only thing in that screenshot that I could not accomplish with a Listview and custom drawables is the blue line between the icons. I'd have to use a scrollview and a relative layout instead.Working directly in OpenGL will raise your effort tenfold. Are you really sure that you need to do that? (unless you are mucking with the opengl for its own sake).
The graphics I am using are 2d...I am thinking I don't need OpenGL ES but I was not sure. I was just wondering if there are any speed benefits from using it I guess...


