LLWindow merge fixes for Mac

master
prep 2013-03-11 17:29:05 -04:00
parent 8e3b190e91
commit 9ea6a96be9
6 changed files with 30 additions and 26 deletions

View File

@ -210,7 +210,7 @@ LLWindowMacOSX::LLWindowMacOSX(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 disable_vsync, BOOL use_gl,
BOOL ignore_pixel_depth,
U32 fsaa_samples)
: LLWindow(NULL, fullscreen, flags)
@ -228,6 +228,7 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks,
gKeyboard = new LLKeyboardMacOSX();
gKeyboard->setCallbacks(callbacks);
// Ignore use_gl for now, only used for drones on PC
mWindow = NULL;
mContext = NULL;
mPixelFormat = NULL;

View File

@ -122,7 +122,7 @@ public:
protected:
LLWindowMacOSX(LLWindowCallbacks* callbacks,
const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags,
BOOL fullscreen, BOOL clearBg, BOOL disable_vsync,
BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl,
BOOL ignore_pixel_depth,
U32 fsaa_samples);
~LLWindowMacOSX();

View File

@ -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 );
/* Allocate the image buffer */
mMesaBuffer = new unsigned char [width * height * 4 * MESA_CHANNEL_SIZE];
llassert(mMesaBuffer);
gMesaBuffer = (U16*)mMesaBuffer;
/* Bind the buffer to the context and make it current */
if (!OSMesaMakeCurrent( mMesaContext, mMesaBuffer, MESA_CHANNEL_TYPE, width, height ))
if (use_gl)
{
llerrs << "MESA: OSMesaMakeCurrent failed!" << llendl;
}
llinfos << "MESA Init" << llendl;
mMesaContext = OSMesaCreateContextExt( GL_RGBA, 32, 0, 0, NULL );
llverify(gGLManager.initGL());
/* Allocate the image buffer */
mMesaBuffer = new unsigned char [width * height * 4 * MESA_CHANNEL_SIZE];
llassert(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;
}
llverify(gGLManager.initGL());
}
}

View File

@ -51,7 +51,6 @@ public:
/*virtual*/ BOOL getSize(LLCoordWindow *size) {return FALSE;};
/*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;};
/*virtual*/ BOOL setSizeImpl(LLCoordScreen size) {return FALSE;};
/*virtual*/ BOOL setSizeImpl(LLCoordWindow size) {return FALSE;};
/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) {return FALSE;};
/*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;};
/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;};
@ -98,7 +97,7 @@ public:
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);
~LLWindowMesaHeadless();
private:

View File

@ -186,7 +186,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
const std::string& title, S32 x, S32 y, S32 width,
S32 height, U32 flags,
BOOL fullscreen, BOOL clearBg,
BOOL disable_vsync,
BOOL disable_vsync, BOOL use_gl,
BOOL ignore_pixel_depth, U32 fsaa_samples)
: LLWindow(callbacks, fullscreen, flags),
Lock_Display(NULL),
@ -197,6 +197,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
gKeyboard->setCallbacks(callbacks);
// Note that we can't set up key-repeat until after SDL has init'd video
// Ignore use_gl for now, only used for drones on PC
mWindow = NULL;
mNeedsResize = FALSE;
mOverrideAspectRatio = 0.f;
@ -1643,24 +1644,24 @@ void check_vm_bloat()
const long long significant_vm_difference = 250 * 1024*1024;
const long long significant_rss_difference = 50 * 1024*1024;
ssize_t res;
size_t dummy;
char *ptr;
size_t delim_result = 0;
for (int i=0; i<22 && delim_result > -1; ++i) // parse past the values we don't want
for (int i=0; i<22; ++i) // parse past the values we don't want
{
ptr = NULL;
delim_result = getdelim(&ptr, &dummy, ' ', fp);
res = getdelim(&ptr, &dummy, ' ', fp);
free(ptr);
}
// 23rd space-delimited entry is vsize
ptr = NULL;
delim_result = getdelim(&ptr, &dummy, ' ', fp);
res = getdelim(&ptr, &dummy, ' ', fp);
llassert(ptr);
long long this_vm_size = atoll(ptr);
free(ptr);
// 24th space-delimited entry is RSS
ptr = NULL;
delim_result = getdelim(&ptr, &dummy, ' ', fp);
res = getdelim(&ptr, &dummy, ' ', fp);
llassert(ptr);
long long this_rss_size = getpagesize() * atoll(ptr);
free(ptr);

View File

@ -147,7 +147,7 @@ public:
protected:
LLWindowSDL(LLWindowCallbacks* callbacks,
const std::string& title, int x, int y, int width, int height, U32 flags,
BOOL fullscreen, BOOL clearBg, BOOL disable_vsync,
BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl,
BOOL ignore_pixel_depth, U32 fsaa_samples);
~LLWindowSDL();