/// <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); }
/// <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); }
/// <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); }
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); } }
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); } }
/// <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; }
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); } }
public static extern int SetDepthTarget(int handle, int depthBuffer, int level, TextureCubeFace cubeFace, out int result);
public static extern int SetColorTarget(int handle, int colorBuffer, int level, TextureCubeFace cubeFace, out int result);
/// <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; }
/// <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; }
/// <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; }
/// <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)); }
/// <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); }
/// <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; }
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);
/// <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)); }
/// <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)); }
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);
/// <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); }
/// <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)); }
/// <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; }
/// <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)); }
/// <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)); }
/// <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; }
/// <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)); }