开发者

android opengl es background image

开发者 https://www.devze.com 2023-02-22 11:29 出处:网络
Hi I am using opengl to draw sprites for a game. When I draw the level background the game slows down. Is there a way I can draw the background separately? The background is j开发者_Go百科ust a simple

Hi I am using opengl to draw sprites for a game. When I draw the level background the game slows down. Is there a way I can draw the background separately? The background is j开发者_Go百科ust a simple image that does not change or animate and as such does not need to be drawn every frame.


Try this:

glSurfaceView = ...
glSurfaceView.setBackgroundResource(R.drawable.my_background);
glSurfaceView.setZOrderOnTop(true);

More details here: https://stackoverflow.com/a/19009278/1186286

0

精彩评论

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