PageRenderTime 113ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llwindow/llwindowmesaheadless.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 122 lines | 80 code | 14 blank | 28 comment | 0 complexity | bbf4bbfba4f7e75bff607e6a3312d0eb MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llwindowmesaheadless.h
  3. * @brief Windows implementation of LLWindow class
  4. *
  5. * $LicenseInfo:firstyear=2001&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLWINDOWMESAHEADLESS_H
  27. #define LL_LLWINDOWMESAHEADLESS_H
  28. #if LL_MESA_HEADLESS
  29. #include "llwindow.h"
  30. #include "GL/glu.h"
  31. #include "GL/osmesa.h"
  32. class LLWindowMesaHeadless : public LLWindow
  33. {
  34. public:
  35. /*virtual*/ void show() {};
  36. /*virtual*/ void hide() {};
  37. /*virtual*/ void close() {};
  38. /*virtual*/ BOOL getVisible() {return FALSE;};
  39. /*virtual*/ BOOL getMinimized() {return FALSE;};
  40. /*virtual*/ BOOL getMaximized() {return FALSE;};
  41. /*virtual*/ BOOL maximize() {return FALSE;};
  42. /*virtual*/ void minimize() {};
  43. /*virtual*/ void restore() {};
  44. /*virtual*/ BOOL getFullscreen() {return FALSE;};
  45. /*virtual*/ BOOL getPosition(LLCoordScreen *position) {return FALSE;};
  46. /*virtual*/ BOOL getSize(LLCoordScreen *size) {return FALSE;};
  47. /*virtual*/ BOOL getSize(LLCoordWindow *size) {return FALSE;};
  48. /*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;};
  49. /*virtual*/ BOOL setSizeImpl(LLCoordScreen size) {return FALSE;};
  50. /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) {return FALSE;};
  51. /*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;};
  52. /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;};
  53. /*virtual*/ void showCursor() {};
  54. /*virtual*/ void hideCursor() {};
  55. /*virtual*/ void showCursorFromMouseMove() {};
  56. /*virtual*/ void hideCursorUntilMouseMove() {};
  57. /*virtual*/ BOOL isCursorHidden() {return FALSE;};
  58. /*virtual*/ void updateCursor() {};
  59. //virtual ECursorType getCursor() { return mCurrentCursor; };
  60. /*virtual*/ void captureMouse() {};
  61. /*virtual*/ void releaseMouse() {};
  62. /*virtual*/ void setMouseClipping( BOOL b ) {};
  63. /*virtual*/ BOOL isClipboardTextAvailable() {return FALSE; };
  64. /*virtual*/ BOOL pasteTextFromClipboard(LLWString &dst) {return FALSE; };
  65. /*virtual*/ BOOL copyTextToClipboard(const LLWString &src) {return FALSE; };
  66. /*virtual*/ void flashIcon(F32 seconds) {};
  67. /*virtual*/ F32 getGamma() {return 1.0f; };
  68. /*virtual*/ BOOL setGamma(const F32 gamma) {return FALSE; }; // Set the gamma
  69. /*virtual*/ BOOL restoreGamma() {return FALSE; }; // Restore original gamma table (before updating gamma)
  70. /*virtual*/ void setFSAASamples(const U32 fsaa_samples) { /* FSAA not supported yet on Mesa headless.*/ }
  71. /*virtual*/ U32 getFSAASamples() { return 0; }
  72. //virtual ESwapMethod getSwapMethod() { return mSwapMethod; }
  73. /*virtual*/ void gatherInput() {};
  74. /*virtual*/ void delayInputProcessing() {};
  75. /*virtual*/ void swapBuffers();
  76. // handy coordinate space conversion routines
  77. /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) { return FALSE; };
  78. /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to) { return FALSE; };
  79. /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordGL *to) { return FALSE; };
  80. /*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordWindow *to) { return FALSE; };
  81. /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordGL *to) { return FALSE; };
  82. /*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordScreen *to) { return FALSE; };
  83. /*virtual*/ LLWindowResolution* getSupportedResolutions(S32 &num_resolutions) { return NULL; };
  84. /*virtual*/ F32 getNativeAspectRatio() { return 1.0f; };
  85. /*virtual*/ F32 getPixelAspectRatio() { return 1.0f; };
  86. /*virtual*/ void setNativeAspectRatio(F32 ratio) {}
  87. /*virtual*/ void *getPlatformWindow() { return 0; };
  88. /*virtual*/ void bringToFront() {};
  89. LLWindowMesaHeadless(LLWindowCallbacks* callbacks,
  90. const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height,
  91. U32 flags, BOOL fullscreen, BOOL clearBg,
  92. BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth);
  93. ~LLWindowMesaHeadless();
  94. private:
  95. OSMesaContext mMesaContext;
  96. unsigned char * mMesaBuffer;
  97. };
  98. class LLSplashScreenMesaHeadless : public LLSplashScreen
  99. {
  100. public:
  101. LLSplashScreenMesaHeadless() {};
  102. virtual ~LLSplashScreenMesaHeadless() {};
  103. /*virtual*/ void showImpl() {};
  104. /*virtual*/ void updateImpl(const std::string& mesg) {};
  105. /*virtual*/ void hideImpl() {};
  106. };
  107. #endif
  108. #endif //LL_LLWINDOWMESAHEADLESS_H