IDisplayDevice.h
Engine/source/platform/output/IDisplayDevice.h
Classes:
class
Defines the basic display pose common to most display devices.
class
Detailed Description
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#ifndef _IDISPLAYDEVICE_H_ 25#define _IDISPLAYDEVICE_H_ 26 27#include "console/consoleTypes.h" 28 29class GameConnection; 30class GuiCanvas; 31 32// Defines a custom display device that requires particular rendering settings 33// in order for a scene to display correctly. 34 35/// Defines the basic display pose common to most display devices 36typedef struct DisplayPose 37{ 38 QuatF orientation; /// Direction device is facing 39 Point3F position; /// Relative position of device in view space 40 41 Point3F velocity; 42 Point3F angularVelocity; 43 44#ifdef DEBUG_DISPLAY_POSE 45 MatrixF actualMatrix; 46 MatrixF originalMatrix; 47#endif 48 49 U32 state; /// Generic state 50 51 bool valid; /// Pose set 52 bool connected; /// Device connected 53} IDevicePose; 54 55class IDisplayDevice 56{ 57public: 58 virtual bool providesFrameEyePose() const = 0; 59 60 /// Get a display pose for the specified eye, or the HMD if eyeId is -1. 61 virtual void getFrameEyePose(IDevicePose *pose, S32 eyeId) const = 0; 62 63 virtual bool providesEyeOffsets() const = 0; 64 /// Returns eye offset not taking into account any position tracking info 65 virtual void getEyeOffsets(Point3F *dest) const = 0; 66 67 virtual bool providesFovPorts() const = 0; 68 virtual void getFovPorts(FovPort *out) const = 0; 69 70 virtual void getStereoViewports(RectI *out) const = 0; 71 virtual void getStereoTargets(GFXTextureTarget **out) const = 0; 72 73 virtual void setDrawCanvas(GuiCanvas *canvas) = 0; 74 virtual void setDrawMode(GFXDevice::GFXDeviceRenderStyles style) = 0; 75 76 virtual void setCurrentConnection(GameConnection *connection) = 0; 77 virtual GameConnection* getCurrentConnection() = 0; 78 79 virtual void onStartFrame() = 0; 80 81 /// Returns a texture handle representing a preview of the composited VR view 82 virtual GFXTexHandle getPreviewTexture() = 0; 83}; 84 85#endif // _IDISPLAYDEVICE_H_ 86