Can OpenGL be run not fullscreen (contained in window or layout instead) in Android?
This might be an odd question. I'm basically wondering if there's a way to use OpenGL content, but not have it take up the entire screen. My desire is to use OpenGL t开发者_C百科o render some objects, and below that have working buttons that determine what will happen to said objects.
Rather than use a GLSurfaceViewActivity, create a normal Activity and embed a GLSurfaceView into a ViewGroup where you need it. There is probably some other glue you'll find you need that GLSurfaceViewActivity generates automatically.
However, note, that due to the vastly different rendering mechanisms between Surfaces and other Views, you may find some unexpected rendering issues. The SurfaceView will effectively be a "window" through which the OpenGL will be revealed, and other normal views may be allowed to draw above that window. Also, its a good idea to make sure the GLSurfaceView is the only SurfaceView in the hierarchy.
精彩评论