示例#1
0
        private void createTexture(int size)
        {
            VideoDriver drv = device.VideoDriver;

            Texture o = texture;

            texture = drv.AddTexture(new Dimension2Di(size), "tex");

            TexturePainter p = texture.Painter;

            p.Lock(TextureLockMode.WriteOnly);
            for (int i = 0; i < p.MipMapLevelHeight; i++)
            {
                p.SetLine(0, i, p.MipMapLevelWidth - 1, i, new Color(200, 200, 200));
            }
            p.Unlock(true);

            guiImage.Image = texture;
            sceneNodePainter.SetMaterialTexture(0, texture);

            if (o != null)
            {
                drv.RemoveTexture(o);
            }
        }