RenderStack 11.06.1
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties
RenderStack.Math.Viewport Class Reference
Inheritance diagram for RenderStack.Math.Viewport:
RenderStack.Graphics.Framebuffer RenderStack.Graphics.RenderBuffer RenderStack.Graphics.Texture

List of all members.

Public Member Functions

override int GetHashCode ()
override bool Equals (object o)
 Viewport (int width, int height)
 Viewport (int x, int y, int width, int height)
virtual void Resize (int width, int height)

Static Public Member Functions

static bool operator== (Viewport a, Viewport b)
static bool operator!= (Viewport a, Viewport b)

Public Attributes

int Border
int X
int Y

Static Public Attributes

static Viewport Default = new Viewport(1, 1)

Properties

int Width [get, set]
int Height [get, set]
float AspectRatio [get, set]

Detailed Description

Definition at line 29 of file Viewport.cs.


Constructor & Destructor Documentation

RenderStack.Math.Viewport.Viewport ( int  width,
int  height 
)

Definition at line 85 of file Viewport.cs.

        {
            this.width = width;
            this.height = height;
            ComputeAspectRatio();
            //  Do not call virtual method here, it might do wrong things, we only
            //  want the above stuff in constructor
            //Resize(width, height);
        }
RenderStack.Math.Viewport.Viewport ( int  x,
int  y,
int  width,
int  height 
)

Definition at line 95 of file Viewport.cs.

        {
            X = x;
            Y = y;
            this.width = width;
            this.height = height;
            ComputeAspectRatio();
            //  Do not call virtual method here, it might do wrong things, we only
            //  want the above stuff in constructor
            //Resize(width, height);
        }

Member Function Documentation

static bool RenderStack.Math.Viewport.operator== ( Viewport  a,
Viewport  b 
) [static]

Definition at line 43 of file Viewport.cs.

References RenderStack.Math.Viewport.Border, RenderStack.Math.Viewport.Height, RenderStack.Math.Viewport.Width, RenderStack.Math.Viewport.X, and RenderStack.Math.Viewport.Y.

        {
            if(
                ((object)a == null) && ((object)b == null)
            )
            {
                return true;
            }
            return ((object)a != null) && ((object)b != null) && (a.X == b.X) && (a.Y == b.Y) && (a.Width == b.Width) && (a.Height == b.Height) && (a.Border == b.Border);
        }
static bool RenderStack.Math.Viewport.operator!= ( Viewport  a,
Viewport  b 
) [static]

Definition at line 54 of file Viewport.cs.

References RenderStack.Math.Viewport.Border, RenderStack.Math.Viewport.Height, RenderStack.Math.Viewport.Width, RenderStack.Math.Viewport.X, and RenderStack.Math.Viewport.Y.

        {
            if(
                ((object)a == null) && ((object)b == null)
            )
            {
                return false;
            }
            return ((object)a == null) || ((object)b == null) || (a.X != b.X) || (a.Y != b.Y) || (a.Width != b.Width) || (a.Height != b.Height) || (a.Border != b.Border);
        }
override int RenderStack.Math.Viewport.GetHashCode ( )

Definition at line 65 of file Viewport.cs.

        {
            return X.GetHashCode() ^ Y.GetHashCode() ^ Width.GetHashCode() ^ Height.GetHashCode() ^ Border.GetHashCode();
        }
override bool RenderStack.Math.Viewport.Equals ( object  o)

Definition at line 75 of file Viewport.cs.

        {
            if(o is Viewport)
            {
                Viewport c = (Viewport)o;
                return this == c;
            }
            return false;
        }
virtual void RenderStack.Math.Viewport.Resize ( int  width,
int  height 
) [virtual]

Reimplemented in RenderStack.Graphics.Framebuffer, RenderStack.Graphics.RenderBuffer, and RenderStack.Graphics.Texture.

Definition at line 107 of file Viewport.cs.

        {
            this.width = width;
            this.height = height;
            ComputeAspectRatio();
        }

Member Data Documentation

Definition at line 41 of file Viewport.cs.


Property Documentation

int RenderStack.Math.Viewport.Width [get, set]
int RenderStack.Math.Viewport.Height [get, set]
float RenderStack.Math.Viewport.AspectRatio [get, set]

Definition at line 39 of file Viewport.cs.

Referenced by RenderStack.Scene.Camera.UpdateViewport().


The documentation for this class was generated from the following file: