Huge renderer update (WIP). Still plenty to do, especially pertaining to UI.

-Nametag bubble visbility is oddly inconsistent. May vanish with future planned UI merges...
-VBOs are PAINFULLY slow on ATI hardware. This repos self-compiled davep/shining-fixes branch, so I'll leave the ball in LL's court for now regarding that.
This commit is contained in:
Shyotl
2011-12-09 14:02:29 -06:00
parent 8e7733b2ce
commit ffb285c6ff
499 changed files with 22321 additions and 12356 deletions

View File

@@ -47,6 +47,7 @@
#include "llgl.h"
#include "llstring.h"
#include "lldir.h"
#include "llglslshader.h"
// System includes
#include <commdlg.h>
@@ -1030,6 +1031,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
mhInstance,
NULL);
LL_INFOS("Window") << "window is created." << llendl ;
//-----------------------------------------------------------------------
// Create GL drawing context
//-----------------------------------------------------------------------
@@ -1126,6 +1129,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
return FALSE;
}
LL_INFOS("Window") << "Drawing context is created." << llendl ;
gGLManager.initWGL();
if (wglChoosePixelFormatARB)
@@ -1262,7 +1267,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
LL_INFOS("Window") << "Choosing pixel formats: " << num_formats << " pixel formats returned" << LL_ENDL;
}
LL_INFOS("Window") << "pixel formats done." << llendl ;
S32 swap_method = 0;
S32 cur_format = num_formats-1;
@@ -1312,6 +1317,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
mhInstance,
NULL);
LL_INFOS("Window") << "recreate window done." << llendl ;
if (!(mhDC = GetDC(mWindowHandle)))
{
close();
@@ -1398,7 +1405,53 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
return FALSE;
}
if (!(mhRC = wglCreateContext(mhDC)))
mhRC = 0;
if (wglCreateContextAttribsARB)
{ //attempt to create a specific versioned context
S32 attribs[] =
{ //start at 4.2
WGL_CONTEXT_MAJOR_VERSION_ARB, 4,
WGL_CONTEXT_MINOR_VERSION_ARB, 2,
WGL_CONTEXT_PROFILE_MASK_ARB, LLRender::sGLCoreProfile ? WGL_CONTEXT_CORE_PROFILE_BIT_ARB : WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
WGL_CONTEXT_FLAGS_ARB, gDebugGL ? WGL_CONTEXT_DEBUG_BIT_ARB : 0,
0
};
bool done = false;
while (!done)
{
mhRC = wglCreateContextAttribsARB(mhDC, mhRC, attribs);
if (!mhRC)
{
if (attribs[3] > 0)
{ //decrement minor version
attribs[3]--;
}
else if (attribs[1] > 3)
{ //decrement major version and start minor version over at 3
attribs[1]--;
attribs[3] = 3;
}
else
{ //we reached 3.0 and still failed, bail out
done = true;
}
}
else
{
llinfos << "Created OpenGL " << llformat("%d.%d", attribs[1], attribs[3]) << " context." << llendl;
done = true;
if (LLRender::sGLCoreProfile)
{
LLGLSLShader::sNoFixedFunction = true;
}
}
}
}
if (!mhRC && !(mhRC = wglCreateContext(mhDC)))
{
close();
OSMessageBox("Can't create GL rendering context", "Error", OSMB_OK);
@@ -2377,6 +2430,14 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
return 0;
}
case WM_GETMINMAXINFO:
{
LPMINMAXINFO min_max = (LPMINMAXINFO)l_param;
min_max->ptMinTrackSize.x = 1024;
min_max->ptMinTrackSize.y = 768;
return 0;
}
case WM_SIZE:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_SIZE");