1

Pixmap の一部 (指定された Rectangle) を GPU の Texture (指定された位置) にアップロードしたいと思います。

私が達成したいのは

void updateTextureFromPixmap(sourcePixmap,sourceRectangle,destTexture, destRectangle) {  
    destTexture.fill(copyfrom(sourcePixmap),copyarea(SourceRectangle),newArea(destRectangle));
}

glTexSubImage2D を使用する必要がありますか? 私はまだopenglを学んでいます;/

4

2 に答える 2

0
public class PixmapHelper {

    static Pixmap fullGraphics ;
    static Pixmap miniObject;

    public static void  Initialize()
    {

         fullGraphics =AssetLoader.GetPixmap(Settings.TEX_MAP_OBJECTS);



        miniObject=new Pixmap(8,8, Pixmap.Format.RGBA8888);
    }

    static void Draw(TextureRegion textureRegion,Texture dstTexture,int dstX,int dstY)
    {

       miniObject.drawPixmap(fullGraphics, 0,0,   textureRegion.getRegionX(),textureRegion.getRegionY(),
textureRegion.getRegionWidth(),textureRegion.getRegionHeight());


         dstTexture.draw(miniObject,dstX,dstY);


    }
}
于 2014-03-26T18:27:00.047 に答える