Texture doesn't draw

后端 未结 2 1887
轻奢々
轻奢々 2021-01-26 15:00

I want to draw a image to the screen, but what I get is the black square but without the texture on it. The image path is correct and loaded, because the rect have the correct s

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-26 15:25

    I had similar problems with my textures not being drawn (black screen) when using the same open gl commands.

    To render the texture on the screen I also added some additional open gl commands to draw the texture using a vertex shader.

    See this project for using a open gl vertex shader Simply calling the renderTexture method with the texture handle and appropriate width and height should fix your problems https://github.com/rsri/Pic2Fro/blob/b4fe69b44343dab2515c3fd6e769f3370bf31312/app/src/main/java/com/pic2fro/pic2fro/util/Util.java

提交回复
热议问题