2013-06-02 14:32:43 +02:00
|
|
|
/*****************************************************************************
|
2013-08-13 20:04:25 +02:00
|
|
|
* Viewport.h *
|
2013-06-02 14:32:43 +02:00
|
|
|
* *
|
2013-07-12 21:30:13 +02:00
|
|
|
* XFX::Graphics::Viewport structure definition file *
|
2013-06-02 14:32:43 +02:00
|
|
|
* Copyright (c) XFX Team. All Rights Reserved *
|
|
|
|
*****************************************************************************/
|
2013-05-05 18:18:41 +02:00
|
|
|
#ifndef _XFX_GRAPHICS_VIEWPORT_
|
|
|
|
#define _XFX_GRAPHICS_VIEWPORT_
|
|
|
|
|
|
|
|
#include <System/Object.h>
|
|
|
|
|
|
|
|
using namespace System;
|
|
|
|
|
|
|
|
namespace XFX
|
|
|
|
{
|
|
|
|
struct Matrix;
|
|
|
|
struct Rectangle;
|
|
|
|
struct Vector3;
|
2013-08-13 20:04:25 +02:00
|
|
|
|
2013-05-05 18:18:41 +02:00
|
|
|
namespace Graphics
|
|
|
|
{
|
2013-07-12 21:30:13 +02:00
|
|
|
/**
|
|
|
|
* Defines the window dimensions of a render-target surface onto which a 3D volume projects.
|
|
|
|
*/
|
2013-05-05 18:18:41 +02:00
|
|
|
struct Viewport : Object
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
static bool WithinEpsilon(float a, float b);
|
|
|
|
|
|
|
|
public:
|
|
|
|
float getAspectRatio() const;
|
|
|
|
Rectangle getBounds() const;
|
|
|
|
void setBounds(const Rectangle value);
|
|
|
|
int Height;
|
|
|
|
float MaxDepth;
|
|
|
|
float MinDepth;
|
|
|
|
Rectangle getTitleSafeArea() const;
|
|
|
|
int Width;
|
|
|
|
int X;
|
|
|
|
int Y;
|
|
|
|
|
|
|
|
Viewport();
|
|
|
|
Viewport(const int x, const int y, const int width, const int height);
|
|
|
|
Viewport(const Rectangle bounds);
|
2013-08-13 20:04:25 +02:00
|
|
|
|
2013-05-31 15:58:00 +02:00
|
|
|
bool Equals(Object const * const obj) const;
|
2013-05-05 18:18:41 +02:00
|
|
|
bool Equals(const Viewport obj) const;
|
|
|
|
int GetHashCode() const;
|
2013-07-12 21:30:13 +02:00
|
|
|
static const Type& GetType();
|
2013-05-05 18:18:41 +02:00
|
|
|
Vector3 Project(const Vector3 source, const Matrix projection, const Matrix view, const Matrix world) const;
|
2013-07-11 20:00:07 +02:00
|
|
|
const String ToString() const;
|
2013-05-05 18:18:41 +02:00
|
|
|
Vector3 Unproject(const Vector3 source, const Matrix projection, const Matrix view, const Matrix world) const;
|
|
|
|
|
|
|
|
bool operator !=(const Viewport& right) const;
|
|
|
|
bool operator ==(const Viewport& right) const;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //_XFX_GRAPHICS_VIEWPORT_
|