Ejemplo n.º 1
0
        /// <summary>
        /// Creates a Texture and loads it
        /// </summary>
        /// <param name="engine"></param>
        /// <param name="name"></param>
        public Texture2D(VisualEngine engine, StringBuilder name, StringBuilder fullPath)
            : base(engine, name)
        {
            Engine.Log.AddInformation(TAG, new StringBuilder("Creating " + name));

            FullPath = fullPath;

            Internal = new GraphicsEngineSpace._Texture2D(engine.Device, name.ToString());

            LoadFromFile();
        }
Ejemplo n.º 2
0
        void Create(StringBuilder name, int width, int height, TextureFormat format, bool renderTargetUse)
        {
            Engine.Log.AddInformation(TAG, new StringBuilder("Creating " + name));

            this.Format = format;

            DXGIFORMAT dxFormat = (DXGIFORMAT)0;

            if (format == TextureFormat.RGBA)
            {
                dxFormat = DXGIFORMAT.DXGI_FORMAT_R8G8B8A8_UNORM;
            }

            Internal = new GraphicsEngineSpace._Texture2D(Engine.Device, name.ToString());

            InternalTexture2D.Create(width, height, dxFormat, renderTargetUse);
        }