SurfaceView sample code

偶尔善良 提交于 2019-12-06 07:44:43

This commit of my WorldMap demo app shows you the changes necessary to convert from an android.view.View to an android.view.SurfaceView with an android.view.SurfaceHolder.Callback.

It cheats a bit by using the View's onDraw() from within the SurfaceView's DrawThread and by calling the View's onSizeChanged() from within the SurfaceView's surfaceChanged. It just makes the diff smaller and easier to understand.

I'm not sure if you're needing a GLSurfaceView or not, but glbuffer is one of my favorite examples.

This is the java file where the action happens: GlBufferActivity

The project also relies on native methods and the NDK, so it may not be exactly what you're looking for, but it's a great starting point if you want to work with OpenGL via the normal C apis.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!