summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowmesaheadless.cpp
diff options
context:
space:
mode:
authorprep <prep@lindenlab.com>2013-03-11 17:29:05 -0400
committerprep <prep@lindenlab.com>2013-03-11 17:29:05 -0400
commit9ea6a96be9a5fda489d5e5ce28fc2df7c6f4c309 (patch)
tree9db5e64a1784aba260173666eb0b01af31c5485e /indra/llwindow/llwindowmesaheadless.cpp
parent8e3b190e919fde84a2189d974208f9d199d4bea6 (diff)
LLWindow merge fixes for Mac
Diffstat (limited to 'indra/llwindow/llwindowmesaheadless.cpp')
-rw-r--r--indra/llwindow/llwindowmesaheadless.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/indra/llwindow/llwindowmesaheadless.cpp b/indra/llwindow/llwindowmesaheadless.cpp
index 2b668d3fc4..11c22ac94e 100644
--- a/indra/llwindow/llwindowmesaheadless.cpp
+++ b/indra/llwindow/llwindowmesaheadless.cpp
@@ -41,25 +41,28 @@ U16 *gMesaBuffer = NULL;
LLWindowMesaHeadless::LLWindowMesaHeadless(LLWindowCallbacks* callbacks,
const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height,
U32 flags, BOOL fullscreen, BOOL clearBg,
- BOOL disable_vsync, BOOL ignore_pixel_depth)
+ BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth)
: LLWindow(callbacks, fullscreen, flags)
{
- llinfos << "MESA Init" << llendl;
- mMesaContext = OSMesaCreateContextExt( GL_RGBA, 32, 0, 0, NULL );
+ if (use_gl)
+ {
+ llinfos << "MESA Init" << llendl;
+ mMesaContext = OSMesaCreateContextExt( GL_RGBA, 32, 0, 0, NULL );
- /* Allocate the image buffer */
- mMesaBuffer = new unsigned char [width * height * 4 * MESA_CHANNEL_SIZE];
- llassert(mMesaBuffer);
+ /* Allocate the image buffer */
+ mMesaBuffer = new unsigned char [width * height * 4 * MESA_CHANNEL_SIZE];
+ llassert(mMesaBuffer);
- gMesaBuffer = (U16*)mMesaBuffer;
+ gMesaBuffer = (U16*)mMesaBuffer;
- /* Bind the buffer to the context and make it current */
- if (!OSMesaMakeCurrent( mMesaContext, mMesaBuffer, MESA_CHANNEL_TYPE, width, height ))
- {
- llerrs << "MESA: OSMesaMakeCurrent failed!" << llendl;
- }
+ /* Bind the buffer to the context and make it current */
+ if (!OSMesaMakeCurrent( mMesaContext, mMesaBuffer, MESA_CHANNEL_TYPE, width, height ))
+ {
+ llerrs << "MESA: OSMesaMakeCurrent failed!" << llendl;
+ }
- llverify(gGLManager.initGL());
+ llverify(gGLManager.initGL());
+ }
}