IDisplayDevice.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2012 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. #ifndef _IDISPLAYDEVICE_H_
  23. #define _IDISPLAYDEVICE_H_
  24. #include "console/consoleTypes.h"
  25. class GameConnection;
  26. class GuiCanvas;
  27. // Defines a custom display device that requires particular rendering settings
  28. // in order for a scene to display correctly.
  29. /// Defines the basic display pose common to most display devices
  30. typedef struct DisplayPose
  31. {
  32. EulerF orientation; /// Direction device is facing
  33. Point3F position; /// Relative position of device in view space
  34. } IDevicePose;
  35. class IDisplayDevice
  36. {
  37. public:
  38. virtual bool providesFrameEyePose() const = 0;
  39. virtual void getFrameEyePose(IDevicePose *pose, U32 eye) const = 0;
  40. virtual bool providesEyeOffsets() const = 0;
  41. /// Returns eye offset not taking into account any position tracking info
  42. virtual void getEyeOffsets(Point3F *dest) const = 0;
  43. virtual bool providesFovPorts() const = 0;
  44. virtual void getFovPorts(FovPort *out) const = 0;
  45. virtual bool providesProjectionOffset() const = 0;
  46. virtual const Point2F& getProjectionOffset() const = 0;
  47. virtual void getStereoViewports(RectI *out) const = 0;
  48. virtual void getStereoTargets(GFXTextureTarget **out) const = 0;
  49. virtual void setDrawCanvas(GuiCanvas *canvas) = 0;
  50. virtual void setCurrentConnection(GameConnection *connection) = 0;
  51. virtual GameConnection* getCurrentConnection() = 0;
  52. virtual void onStartFrame() = 0;
  53. };
  54. #endif // _IDISPLAYDEVICE_H_