开发者

Can OpenGL be run not fullscreen (contained in window or layout instead) in Android?

开发者 https://www.devze.com 2023-02-24 20:46 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号