예제 #1
0
        /// <summary>Sets pixel data (with byte offset)</summary>
        /// <param name="level">Mipmap level (0 to LevelCount-1)</param>
        /// <param name="cubeFace">Cube surface</param>
        /// <param name="pixels">Pixel data</param>
        /// <param name="offset">Byte offset of pixel data</param>
        /// <param name="pitch">Byte pitch of pixel data</param>
        /// <remarks>Sets the pixel data to the cube surface of the specified mipmap level.</remarks>
        public void SetPixels(int level, TextureCubeFace cubeFace, Array pixels, int offset, int pitch)
        {
            int mipmapWidth  = base.GetMipmapWidth(level);
            int mipmapHeight = base.GetMipmapHeight(level);

            this.SetPixels(level, cubeFace, pixels, PixelFormat.None, offset, pitch, 0, 0, mipmapWidth, mipmapHeight);
        }
예제 #2
0
        /// <summary>Sets pixel data (with format conversion)</summary>
        /// <param name="level">Mipmap level (0 to LevelCount-1)</param>
        /// <param name="cubeFace">Cube surface</param>
        /// <param name="pixels">Pixel data</param>
        /// <param name="format">Pixel format</param>
        /// <remarks>Sets the pixel data to the cube surface of the specified mipmap level. Rgba or the same format as the texture can be specified to the pixel format.
        /// <para>Conversion of DXT pixel format is not supported.</para>
        /// </remarks>
        public void SetPixels(int level, TextureCubeFace cubeFace, Array pixels, PixelFormat format)
        {
            int mipmapWidth  = base.GetMipmapWidth(level);
            int mipmapHeight = base.GetMipmapHeight(level);

            this.SetPixels(level, cubeFace, pixels, format, 0, 0, 0, 0, mipmapWidth, mipmapHeight);
        }
예제 #3
0
 /// <summary>Sets pixel data (with range)</summary>
 /// <param name="level">Mipmap level (0 to LevelCount-1)</param>
 /// <param name="cubeFace">Cube surface</param>
 /// <param name="pixels">Pixel data</param>
 /// <param name="dx">X coordinate of the transfer destination</param>
 /// <param name="dy">Y coordinate of the transfer destination</param>
 /// <param name="dw">Width of the transfer destination</param>
 /// <param name="dh">Height of the transfer destination</param>
 /// <remarks>Sets the pixel data to the cube surface of the specified mipmap level.
 /// <para>When the pixel format is DXT, the dx, dy, dw, and dh must be a multiple of 4.</para>
 /// </remarks>
 public void SetPixels(int level, TextureCubeFace cubeFace, Array pixels, int dx, int dy, int dw, int dh)
 {
     if (dw < 0 || dh < 0)
     {
         dh = (dw = int.MaxValue);
     }
     this.SetPixels(level, cubeFace, pixels, PixelFormat.None, 0, 0, dx, dy, dw, dh);
 }
예제 #4
0
        public void SetPixels(int level, TextureCubeFace cubeFace, Array pixels)
        {
            int num = PsmTexture.SetPixels(this.handle, level, cubeFace, pixels, PixelFormat.None, 0, 0, 0, 0, -1, -1);

            if (num != 0)
            {
                Error.ThrowNativeException(num);
            }
        }
예제 #5
0
        public void ReadPixels(TextureCube texture, int level, TextureCubeFace cubeFace, int dx, int dy, int sx, int sy, int sw, int sh)
        {
            this.CheckUpdate();
            int errorCode = PsmGraphicsContext.ReadPixels2(this.handle, texture.handle, level, cubeFace, dx, dy, sx, sy, sw, sh);

            if (errorCode != 0)
            {
                Error.ThrowNativeException(errorCode);
            }
        }
예제 #6
0
        /// <summary>
        /// Begins a FrameBuffer Pass. Binds a CubeTexture as the RenderTargets.
        /// </summary>
        /// <param name="buffer"></param>
        /// <param name="depthBuffer"></param>
        public void Begin(TextureCube colorTextureCube, TextureCubeFace face, ViewPort viewPort)
        {
            Gl.glBindFramebufferEXT(Gl.GL_FRAMEBUFFER_EXT, this.handle);

            Gl.glFramebufferTexture2DEXT(Gl.GL_FRAMEBUFFER_EXT, Gl.GL_COLOR_ATTACHMENT0_EXT, (int)face, colorTextureCube.Handle, 0);

            this.CheckStatus(Gl.glCheckFramebufferStatusEXT(Gl.GL_FRAMEBUFFER_EXT));

            Gl.glPushAttrib(Gl.GL_VIEWPORT_BIT);

            this.device.ViewPort = viewPort;
        }
예제 #7
0
        public void SetPixels(int level, TextureCubeFace cubeFace, Array pixels, PixelFormat format, int offset, int pitch, int dx, int dy, int dw, int dh)
        {
            if (dw < 0 || dh < 0)
            {
                dh = (dw = int.MaxValue);
            }
            int num = PsmTexture.SetPixels(this.handle, level, cubeFace, pixels, format, offset, pitch, dx, dy, dw, dh);

            if (num != 0)
            {
                Error.ThrowNativeException(num);
            }
        }
예제 #8
0
 public static extern int SetDepthTarget(int handle, int depthBuffer, int level, TextureCubeFace cubeFace, out int result);
예제 #9
0
 public static extern int SetColorTarget(int handle, int colorBuffer, int level, TextureCubeFace cubeFace, out int result);
예제 #10
0
 /// <summary>Sets a value to the structure representing the rendering result storage destination</summary>
 /// <param name="texture">Cube texture (release when NULL)</param>
 /// <param name="level">Texture mipmap level (from 0 to LevelCount-1)</param>
 /// <param name="cubeFace">Cube texture cube surface</param>
 public void Set(TextureCube texture, int level, TextureCubeFace cubeFace)
 {
     this.Buffer   = texture;
     this.Level    = level;
     this.CubeFace = cubeFace;
 }
예제 #11
0
 /// <summary>Sets a value to the structure representing the rendering result storage destination</summary>
 /// <param name="texture">2D texture (release when NULL)</param>
 /// <param name="level">Texture mipmap level (from 0 to LevelCount-1)</param>
 public void Set(Texture2D texture, int level)
 {
     this.Buffer   = texture;
     this.Level    = level;
     this.CubeFace = TextureCubeFace.PositiveX;
 }
예제 #12
0
 /// <summary>Sets a value to the structure representing the rendering result storage destination</summary>
 /// <param name="buffer">Depth buffer (release when NULL)</param>
 public void Set(DepthBuffer buffer)
 {
     this.Buffer   = buffer;
     this.Level    = 0;
     this.CubeFace = TextureCubeFace.PositiveX;
 }
예제 #13
0
 /// <summary>
 /// Loads a texture from a Bitmap
 /// </summary>
 /// <param name="face">Reference face</param>
 /// <param name="bitmap">Bitmap handle</param>
 /// <returns></returns>
 public bool FromBitmap(TextureCubeFace face, Bitmap bitmap)
 {
     return(base.FromBitmap((TextureTarget)face, bitmap));
 }
예제 #14
0
 /// <summary>
 /// Sets the size of the texture
 /// </summary>
 /// <param name="face">Reference face</param>
 /// <param name="size">Desired size</param>
 public void SetSize(TextureCubeFace face, Size size)
 {
     base.SetSize((TextureTarget)face, size);
 }
예제 #15
0
        /// <summary>
        /// Begins a Texture Cube Rendering Pass.
        /// </summary>
        /// <param name="texture"></param>
        /// <param name="face"></param>
        public void Begin     (TextureCube colorTextureCube, DepthBuffer depthBuffer, TextureCubeFace face, ViewPort viewPort)
        {
            Gl.glBindFramebufferEXT        (Gl.GL_FRAMEBUFFER_EXT , this.handle);
 
            Gl.glFramebufferTexture2DEXT   (Gl.GL_FRAMEBUFFER_EXT , Gl.GL_COLOR_ATTACHMENT0_EXT, (int)face, colorTextureCube.Handle, 0);

            Gl.glFramebufferRenderbufferEXT(Gl.GL_FRAMEBUFFER_EXT, Gl.GL_DEPTH_ATTACHMENT_EXT, Gl.GL_RENDERBUFFER_EXT, depthBuffer.Handle);

            this.CheckStatus(Gl.glCheckFramebufferStatusEXT(Gl.GL_FRAMEBUFFER_EXT));
            
            Gl.glPushAttrib(Gl.GL_VIEWPORT_BIT);

            this.device.ViewPort = viewPort;
        }
예제 #16
0
 public static extern int ReadPixels2(int handle, int texture, int level, TextureCubeFace cubeFace, int dx, int dy, int sx, int sy, int sw, int sh);
예제 #17
0
 /// <summary>
 /// Begins a FrameBuffer Pass. Binds a CubeTexture and a DepthBuffer as the RenderTargets. Will automatically set the
 /// devices Viewport to match the dimensions of the Texture.
 /// </summary>
 /// <param name="buffer"></param>
 /// <param name="depthBuffer"></param>
 public void Begin(TextureCube colorTextureCube, DepthBuffer depthBuffer, TextureCubeFace face)
 {
     this.Begin(colorTextureCube, depthBuffer, face, new ViewPort(0, 0, colorTextureCube.Width, colorTextureCube.Width));
 }
예제 #18
0
 /// <summary>Sets the color storage destination (for the cube textures)</summary>
 /// <param name="texture">Cube texture (release when NULL)</param>
 /// <param name="level">Mipmap level (0 to LevelCount-1)</param>
 /// <param name="cubeFace">Cube surface</param>
 /// <remarks>Sets the cube textures to the color storage destination. The texture must be created by specifying the Renderable option.</remarks>
 public void SetColorTarget(TextureCube texture, int level, TextureCubeFace cubeFace)
 {
     this.SetColorTarget(new RenderTarget(texture, level, cubeFace));
 }
예제 #19
0
파일: PsmTexture.cs 프로젝트: OpenPSS/PssIL
 public static extern int SetPixels(int handle, int level, TextureCubeFace cubeFace, Array pixels, PixelFormat format, int offset, int pitch, int dx, int dy, int dw, int dh);
예제 #20
0
 /// <summary>
 /// Blits a Bitmap on the texture
 /// </summary>
 /// <param name="face">Reference face</param>
 /// <param name="bitmap">Bitmap handle</param>
 /// <param name="location">Location on the texture</param>
 public void SetData(TextureCubeFace face, Bitmap bitmap, Point location)
 {
     base.SetData((TextureTarget)face, bitmap, location);
 }
예제 #21
0
 /// <summary>
 /// Load an image from bank and convert it to a texture
 /// </summary>
 /// <param name="face">Reference face</param>
 /// <param name="filename">File name to load</param>
 /// <returns>True if success or false if something went wrong</returns>
 public bool LoadImage(TextureCubeFace face, string filename)
 {
     return(base.LoadImage((TextureTarget)face, filename));
 }
예제 #22
0
 /// <summary>Creates a structure representing the rendering result storage destination</summary>
 /// <param name="texture">Cube texture (release when NULL)</param>
 /// <param name="level">Texture mipmap level (from 0 to LevelCount-1)</param>
 /// <param name="cubeFace">Cube texture cube surface</param>
 public RenderTarget(TextureCube texture, int level, TextureCubeFace cubeFace)
 {
     this.Buffer   = texture;
     this.Level    = level;
     this.CubeFace = cubeFace;
 }
예제 #23
0
 /// <summary>
 /// Begins a FrameBuffer Pass. Binds a CubeTexture and a DepthBuffer as the RenderTargets. Will automatically set the
 /// devices Viewport to match the dimensions of the Texture.
 /// </summary>
 /// <param name="buffer"></param>
 /// <param name="depthBuffer"></param>
 public void Begin     (TextureCube colorTextureCube, DepthBuffer depthBuffer, TextureCubeFace face)
 {
     this.Begin(colorTextureCube, depthBuffer, face, new ViewPort(0, 0, colorTextureCube.Width, colorTextureCube.Width));
 }
예제 #24
0
 /// <summary>
 /// Load a texture from a stream (ie resource files)
 /// </summary>
 /// <param name="face">Reference face</param>
 /// <param name="stream">Stream handle</param>
 /// <returns></returns>
 public bool FromStream(TextureCubeFace face, Stream stream)
 {
     return(base.FromStream((TextureTarget)face, stream));
 }
예제 #25
0
 /// <summary>Creates a structure representing the rendering result storage destination</summary>
 /// <param name="buffer">Depth buffer (release when NULL)</param>
 public RenderTarget(DepthBuffer buffer)
 {
     this.Buffer   = buffer;
     this.Level    = 0;
     this.CubeFace = TextureCubeFace.PositiveX;
 }
예제 #26
0
 /// <summary>
 /// Loads a Png picture from a byte[]
 /// </summary>
 /// <param name="face">Reference face</param>
 /// <param name="data">Binary of a png file</param>
 /// <returns>True if successful, or false</returns>
 public bool LoadImage(TextureCubeFace face, byte[] data)
 {
     return(base.LoadImage((TextureTarget)face, data));
 }