OpenGL and layouts
Posted
by Hnefi
on Stack Overflow
See other posts from Stack Overflow
or by Hnefi
Published on 2010-05-24T18:07:37Z
Indexed on
2010/05/24
18:11 UTC
Read the original article
Hit count: 222
I'm using OpenGL to render a game view in my android application. The game is turn based and I wish to add some buttons to the interface. I'd prefer to use standard Android widgets, structured in an XML-generated layout (or, if I have to, a hardcoded layout) and put the OpenGL view in its own window as part of that layout.
So in regards to this, I have 3 questions:
1: Is such a thing possible? I've done a few half-hearted tries, but have had no luck so far.
2: Is such a thing advisable? Does it carry a significant performance penalty, for example, over using OpenGL-based homebrew widgetry?
3: Is it possible to pass particular arguments to instances created in XML layouts? For example, my current OpenGL view has three arguments in its constructor; is it somehow possible for me to invoke that particular constructor with particular parameters when it's part of a layout?
© Stack Overflow or respective owner