PageRenderTime 27ms CodeModel.GetById 2ms app.highlight 21ms RepoModel.GetById 3ms 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
  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
 27#ifndef LL_LLWINDOWMESAHEADLESS_H
 28#define LL_LLWINDOWMESAHEADLESS_H
 29
 30#if LL_MESA_HEADLESS
 31
 32#include "llwindow.h"
 33#include "GL/glu.h"
 34#include "GL/osmesa.h"
 35
 36class LLWindowMesaHeadless : public LLWindow
 37{
 38public:
 39	/*virtual*/ void show() {};
 40	/*virtual*/ void hide() {};
 41	/*virtual*/ void close() {};
 42	/*virtual*/ BOOL getVisible() {return FALSE;};
 43	/*virtual*/ BOOL getMinimized() {return FALSE;};
 44	/*virtual*/ BOOL getMaximized() {return FALSE;};
 45	/*virtual*/ BOOL maximize() {return FALSE;};
 46	/*virtual*/ void minimize() {};
 47	/*virtual*/ void restore() {};
 48	/*virtual*/ BOOL getFullscreen() {return FALSE;};
 49	/*virtual*/ BOOL getPosition(LLCoordScreen *position) {return FALSE;};
 50	/*virtual*/ BOOL getSize(LLCoordScreen *size) {return FALSE;};
 51	/*virtual*/ BOOL getSize(LLCoordWindow *size) {return FALSE;};
 52	/*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;};
 53	/*virtual*/ BOOL setSizeImpl(LLCoordScreen size) {return FALSE;};
 54	/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) {return FALSE;};
 55	/*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;};
 56	/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;};
 57	/*virtual*/ void showCursor() {};
 58	/*virtual*/ void hideCursor() {};
 59	/*virtual*/ void showCursorFromMouseMove() {};
 60	/*virtual*/ void hideCursorUntilMouseMove() {};
 61	/*virtual*/ BOOL isCursorHidden() {return FALSE;};
 62	/*virtual*/ void updateCursor() {};
 63	//virtual ECursorType getCursor() { return mCurrentCursor; };
 64	/*virtual*/ void captureMouse() {};
 65	/*virtual*/ void releaseMouse() {};
 66	/*virtual*/ void setMouseClipping( BOOL b ) {};
 67	/*virtual*/ BOOL isClipboardTextAvailable() {return FALSE; };
 68	/*virtual*/ BOOL pasteTextFromClipboard(LLWString &dst) {return FALSE; };
 69	/*virtual*/ BOOL copyTextToClipboard(const LLWString &src) {return FALSE; };
 70	/*virtual*/ void flashIcon(F32 seconds) {};
 71	/*virtual*/ F32 getGamma() {return 1.0f; };
 72	/*virtual*/ BOOL setGamma(const F32 gamma) {return FALSE; }; // Set the gamma
 73	/*virtual*/ BOOL restoreGamma() {return FALSE; };	// Restore original gamma table (before updating gamma)
 74	/*virtual*/ void setFSAASamples(const U32 fsaa_samples) { /* FSAA not supported yet on Mesa headless.*/ }
 75	/*virtual*/ U32	 getFSAASamples() { return 0; }
 76	//virtual ESwapMethod getSwapMethod() { return mSwapMethod; }
 77	/*virtual*/ void gatherInput() {};
 78	/*virtual*/ void delayInputProcessing() {};
 79	/*virtual*/ void swapBuffers();
 80
 81	// handy coordinate space conversion routines
 82	/*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) { return FALSE; };
 83	/*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to) { return FALSE; };
 84	/*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordGL *to) { return FALSE; };
 85	/*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordWindow *to) { return FALSE; };
 86	/*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordGL *to) { return FALSE; };
 87	/*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordScreen *to) { return FALSE; };
 88
 89	/*virtual*/ LLWindowResolution* getSupportedResolutions(S32 &num_resolutions) { return NULL; };
 90	/*virtual*/ F32	getNativeAspectRatio() { return 1.0f; };
 91	/*virtual*/ F32 getPixelAspectRatio() { return 1.0f; };
 92	/*virtual*/ void setNativeAspectRatio(F32 ratio) {}
 93
 94	/*virtual*/ void *getPlatformWindow() { return 0; };
 95	/*virtual*/ void bringToFront() {};
 96	
 97	LLWindowMesaHeadless(LLWindowCallbacks* callbacks,
 98                         const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height,
 99				  U32 flags,  BOOL fullscreen, BOOL clearBg,
100				  BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth);
101	~LLWindowMesaHeadless();
102
103private:
104	OSMesaContext	mMesaContext;
105	unsigned char *	mMesaBuffer;
106};
107
108class LLSplashScreenMesaHeadless : public LLSplashScreen
109{
110public:
111	LLSplashScreenMesaHeadless() {};
112	virtual ~LLSplashScreenMesaHeadless() {};
113
114	/*virtual*/ void showImpl() {};
115	/*virtual*/ void updateImpl(const std::string& mesg) {};
116	/*virtual*/ void hideImpl() {};
117
118};
119
120#endif
121
122#endif //LL_LLWINDOWMESAHEADLESS_H