Kaydet (Commit) e03244c9 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Fix Funky Capitalisation Of Comments

Change-Id: I2846824d402d029cde8d214f8112047243c79c54
üst b183507e
...@@ -232,33 +232,33 @@ bool WGLisExtensionSupported(const char *extension) ...@@ -232,33 +232,33 @@ bool WGLisExtensionSupported(const char *extension)
const size_t extlen = strlen(extension); const size_t extlen = strlen(extension);
const char *supported = NULL; const char *supported = NULL;
// Try To Use wglGetExtensionStringARB On Current DC, If Possible // Try to use wglGetExtensionStringARB on current DC, if possible
PROC wglGetExtString = wglGetProcAddress("wglGetExtensionsStringARB"); PROC wglGetExtString = wglGetProcAddress("wglGetExtensionsStringARB");
if (wglGetExtString) if (wglGetExtString)
supported = ((char*(__stdcall*)(HDC))wglGetExtString)(wglGetCurrentDC()); supported = ((char*(__stdcall*)(HDC))wglGetExtString)(wglGetCurrentDC());
// If That Failed, Try Standard Opengl Extensions String // If that failed, try standard OpenGL extensions string
if (supported == NULL) if (supported == NULL)
supported = (char*)glGetString(GL_EXTENSIONS); supported = (char*)glGetString(GL_EXTENSIONS);
// If That Failed Too, Must Be No Extensions Supported // If that failed too, must be no extensions supported
if (supported == NULL) if (supported == NULL)
return false; return false;
// Begin Examination At Start Of String, Increment By 1 On False Match // Begin examination at start of string, increment by 1 on false match
for (const char* p = supported; ; p++) for (const char* p = supported; ; p++)
{ {
// Advance p Up To The Next Possible Match // Advance p up to the next possible match
p = strstr(p, extension); p = strstr(p, extension);
if (p == NULL) if (p == NULL)
return 0; // No Match return 0; // No Match
// Make Sure That Match Is At The Start Of The String Or That // Make sure that match is at the start of the string or that
// The Previous Char Is A Space, Or Else We Could Accidentally // the previous char is a space, or else we could accidentally
// Match "wglFunkywglExtension" With "wglExtension" // match "wglFunkywglExtension" with "wglExtension"
// Also, Make Sure That The Following Character Is Space Or NULL // Also, make sure that the following character is space or null
// Or Else "wglExtensionTwo" Might Match "wglExtension" // or else "wglExtensionTwo" might match "wglExtension"
if ((p==supported || p[-1]==' ') && (p[extlen]=='\0' || p[extlen]==' ')) if ((p==supported || p[-1]==' ') && (p[extlen]=='\0' || p[extlen]==' '))
return 1; // Match return 1; // Match
} }
...@@ -269,37 +269,37 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat, ...@@ -269,37 +269,37 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
{ {
HWND hWnd = NULL; HWND hWnd = NULL;
GLWindow glWin; GLWindow glWin;
//create a temp window to check whether support multi-sample, if support, get the format // Create a temp window to check whether support multi-sample, if support, get the format
if (InitTempWindow(&hWnd, 1, 1, pfd, glWin) < 0) if (InitTempWindow(&hWnd, 1, 1, pfd, glWin) < 0)
{ {
SAL_WARN("vcl.opengl", "Can't create temp window to test"); SAL_WARN("vcl.opengl", "Can't create temp window to test");
return false; return false;
} }
// See If The String Exists In WGL! // See if the string exists in WGL
if (!WGLisExtensionSupported("WGL_ARB_multisample")) if (!WGLisExtensionSupported("WGL_ARB_multisample"))
{ {
SAL_WARN("vcl.opengl", "Device doesn't support multi sample"); SAL_WARN("vcl.opengl", "Device doesn't support multisample");
return false; return false;
} }
// Get Our Pixel Format // Get our pixel format
PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)wglGetProcAddress("wglChoosePixelFormatARB"); PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)wglGetProcAddress("wglChoosePixelFormatARB");
if (!wglChoosePixelFormatARB) if (!wglChoosePixelFormatARB)
{ {
return false; return false;
} }
// Get Our Current Device Context // Get our current device context
HDC hDC = GetDC(hWnd); HDC hDC = GetDC(hWnd);
int pixelFormat; int pixelFormat;
int valid; int valid;
UINT numFormats; UINT numFormats;
float fAttributes[] = {0,0}; float fAttributes[] = {0,0};
// These Attributes Are The Bits We Want To Test For In Our Sample // These attributes are the bits we want to test for in our sample.
// Everything Is Pretty Standard, The Only One We Want To // Everything is pretty standard, the only one we want to
// Really Focus On Is The SAMPLE BUFFERS ARB And WGL SAMPLES // really focus on is the WGL_SAMPLE_BUFFERS_ARB and WGL_SAMPLES_ARB.
// These Two Are Going To Do The Main Testing For Whether Or Not // These two are going to do the main testing for whether or not
// We Support Multisampling On This Hardware. // we support multisampling on this hardware.
int iAttributes[] = int iAttributes[] =
{ {
WGL_DOUBLE_BUFFER_ARB,GL_TRUE, WGL_DOUBLE_BUFFER_ARB,GL_TRUE,
...@@ -325,9 +325,9 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat, ...@@ -325,9 +325,9 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
bool bArbMultisampleSupported = true; bool bArbMultisampleSupported = true;
// First We Check To See If We Can Get A Pixel Format For 4 Samples // First we check to see if we can get a pixel format for 4 samples
valid = wglChoosePixelFormatARB(hDC, iAttributes, fAttributes, 1, &pixelFormat, &numFormats); valid = wglChoosePixelFormatARB(hDC, iAttributes, fAttributes, 1, &pixelFormat, &numFormats);
// If We Returned True, And Our Format Count Is Greater Than 1 // If we returned true, and our format count is greater than 1
if (valid && numFormats >= 1) if (valid && numFormats >= 1)
{ {
bArbMultisampleSupported = true; bArbMultisampleSupported = true;
...@@ -338,7 +338,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat, ...@@ -338,7 +338,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
DestroyWindow(hWnd); DestroyWindow(hWnd);
return bArbMultisampleSupported; return bArbMultisampleSupported;
} }
// Our Pixel Format With 4 Samples Failed, Test For 2 Samples // Our pixel format with 4 samples failed, test for 2 samples
iAttributes[19] = 2; iAttributes[19] = 2;
valid = wglChoosePixelFormatARB(hDC, iAttributes, fAttributes, 1, &pixelFormat, &numFormats); valid = wglChoosePixelFormatARB(hDC, iAttributes, fAttributes, 1, &pixelFormat, &numFormats);
if (valid && numFormats >= 1) if (valid && numFormats >= 1)
...@@ -351,7 +351,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat, ...@@ -351,7 +351,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
DestroyWindow(hWnd); DestroyWindow(hWnd);
return bArbMultisampleSupported; return bArbMultisampleSupported;
} }
// Return The Valid Format // Return the valid format
wglMakeCurrent(NULL, NULL); wglMakeCurrent(NULL, NULL);
wglDeleteContext(glWin.hRC); wglDeleteContext(glWin.hRC);
ReleaseDC(hWnd, glWin.hDC); ReleaseDC(hWnd, glWin.hDC);
...@@ -1187,7 +1187,7 @@ void OpenGLContext::initGLWindow(Visual* pVisual) ...@@ -1187,7 +1187,7 @@ void OpenGLContext::initGLWindow(Visual* pVisual)
m_aGLWin.vi = pInfos; m_aGLWin.vi = pInfos;
} }
// Check multi sample support // Check multisample support
/* TODO: moggi: This is not necessarily correct in the DBG_UTIL path, as it picks /* TODO: moggi: This is not necessarily correct in the DBG_UTIL path, as it picks
* an FBConfig instead ... */ * an FBConfig instead ... */
int nSamples = 0; int nSamples = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment