2D Control Buttons on Top of 3D OpenGl.

Member
Posts: 95
Joined: 2009.09
Post: #1
I have another question to ask you guys!

I have a nice 3D Scene which is leaving the corners of the Iphone free.
Now I wanna place some 2D-Buttons there, looking a bit like a HUD.

What is the preferred way to do something like this?
I understand there'll probably be many games using this since it seems quiet natural.

My first 2 guesses were
  • a special 2D Layer on top of OpenGL 3D
  • some Triangles facing the Screen, that are incorporated into my 3DScene, having textures that look like the buttons

Which way is more natural or less Performance heavy?
Or are there even some Demo-Apps out there who do exactly this?

I searched for it, but couldn't really find anything that adressed this issue.
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #2
Putting Cocoa buttons over your GL view will take a pretty hefty performance cost. It's easy enough to try, but you probably don't want to go that route.

The usual way is just to draw your scene using your normal method, then draw the UI/HUD using an orthographic camera projection with depth testing disabled.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Attempting to add landscape IB buttons to an openGL View Madrayken 1 3,734 Oct 17, 2010 07:03 AM
Last Post: iamflimflam1
  How do I misuse volume buttons? jaber 15 6,479 Aug 26, 2009 11:24 AM
Last Post: Frank C.
  Translucent buttons 9livesoftware 0 2,268 Aug 8, 2009 03:27 PM
Last Post: 9livesoftware
  Shoulder buttons... jaber 1 2,329 Jun 13, 2009 08:52 PM
Last Post: AnotherJake
  Custom menus, buttons and UI elements technocrat9000 3 4,130 Nov 11, 2008 02:49 PM
Last Post: longjumper