Kaydet (Commit) 4e938c46 authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Markus Mohrhard

first round int to bool

Change-Id: I01126ea293c6880bbf53cbc912d54fe8a9842e31
üst ba150bcd
...@@ -906,6 +906,7 @@ OpenGLRender::OpenGLRender(uno::Reference< drawing::XShape > xTarget): ...@@ -906,6 +906,7 @@ OpenGLRender::OpenGLRender(uno::Reference< drawing::XShape > xTarget):
m_iFboIdx(0), m_iFboIdx(0),
m_fLineAlpha(1.0), m_fLineAlpha(1.0),
mxRenderTarget(xTarget), mxRenderTarget(xTarget),
m_iArbMultisampleSupported(false),
m_TextVertexID(0), m_TextVertexID(0),
m_TextTexCoordID(1), m_TextTexCoordID(1),
m_ClearColor(glm::vec4(1.0f, 1.0f, 1.0f, 1.0f)) m_ClearColor(glm::vec4(1.0f, 1.0f, 1.0f, 1.0f))
...@@ -925,7 +926,6 @@ OpenGLRender::OpenGLRender(uno::Reference< drawing::XShape > xTarget): ...@@ -925,7 +926,6 @@ OpenGLRender::OpenGLRender(uno::Reference< drawing::XShape > xTarget):
m_TextureObj[1] = 0; m_TextureObj[1] = 0;
m_RboID[0] = 0; m_RboID[0] = 0;
m_RboID[1] = 0; m_RboID[1] = 0;
m_iArbMultisampleSupported = 0;
m_iArbMultisampleFormat = 0; m_iArbMultisampleFormat = 0;
//TODO: moggi: use STL //TODO: moggi: use STL
...@@ -1031,7 +1031,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l ...@@ -1031,7 +1031,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
} }
} }
int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd) bool OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd)
{ {
HWND hWnd = NULL; HWND hWnd = NULL;
//create a temp windwo to check whether support multi-sample, if support, get the format //create a temp windwo to check whether support multi-sample, if support, get the format
...@@ -1044,7 +1044,7 @@ int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd) ...@@ -1044,7 +1044,7 @@ int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd)
// See If The String Exists In WGL! // See If The String Exists In WGL!
if (!WGLisExtensionSupported("WGL_ARB_multisample")) if (!WGLisExtensionSupported("WGL_ARB_multisample"))
{ {
m_iArbMultisampleSupported = 0; m_iArbMultisampleSupported = false;
SAL_WARN("chart2.opengl", "Device doesn't support multi sample\n"); SAL_WARN("chart2.opengl", "Device doesn't support multi sample\n");
return false; return false;
} }
...@@ -1052,7 +1052,7 @@ int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd) ...@@ -1052,7 +1052,7 @@ int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd)
PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)wglGetProcAddress("wglChoosePixelFormatARB"); PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)wglGetProcAddress("wglChoosePixelFormatARB");
if (!wglChoosePixelFormatARB) if (!wglChoosePixelFormatARB)
{ {
m_iArbMultisampleSupported = 0; m_iArbMultisampleSupported = false;
return false; return false;
} }
// Get Our Current Device Context // Get Our Current Device Context
...@@ -1086,7 +1086,7 @@ int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd) ...@@ -1086,7 +1086,7 @@ int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd)
// 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)
{ {
m_iArbMultisampleSupported = 1; m_iArbMultisampleSupported = true;
m_iArbMultisampleFormat = pixelFormat; m_iArbMultisampleFormat = pixelFormat;
wglMakeCurrent(NULL, NULL); wglMakeCurrent(NULL, NULL);
wglDeleteContext(glWin.hRC); wglDeleteContext(glWin.hRC);
...@@ -1099,7 +1099,7 @@ int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd) ...@@ -1099,7 +1099,7 @@ int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd)
valid = wglChoosePixelFormatARB(hDC,iAttributes,fAttributes,1,&pixelFormat,&numFormats); valid = wglChoosePixelFormatARB(hDC,iAttributes,fAttributes,1,&pixelFormat,&numFormats);
if (valid && numFormats >= 1) if (valid && numFormats >= 1)
{ {
m_iArbMultisampleSupported = 1; m_iArbMultisampleSupported = true;
m_iArbMultisampleFormat = pixelFormat; m_iArbMultisampleFormat = pixelFormat;
wglMakeCurrent(NULL, NULL); wglMakeCurrent(NULL, NULL);
wglDeleteContext(glWin.hRC); wglDeleteContext(glWin.hRC);
...@@ -1116,7 +1116,7 @@ int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd) ...@@ -1116,7 +1116,7 @@ int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd)
} }
#endif #endif
int OpenGLRender::GetMSAASupport() bool OpenGLRender::GetMSAASupport()
{ {
return m_iArbMultisampleSupported; return m_iArbMultisampleSupported;
} }
...@@ -1169,7 +1169,7 @@ int OpenGLRender::InitTempWindow(HWND *hwnd, int width, int height, PIXELFORMATD ...@@ -1169,7 +1169,7 @@ int OpenGLRender::InitTempWindow(HWND *hwnd, int width, int height, PIXELFORMATD
return 0; return 0;
} }
int OpenGLRender::WGLisExtensionSupported(const char *extension) bool OpenGLRender::WGLisExtensionSupported(const char *extension)
{ {
const size_t extlen = strlen(extension); const size_t extlen = strlen(extension);
const char *supported = NULL; const char *supported = NULL;
......
...@@ -159,9 +159,9 @@ public: ...@@ -159,9 +159,9 @@ public:
void SetLine2DWidth(int width); void SetLine2DWidth(int width);
BitmapEx GetAsBitmap(); BitmapEx GetAsBitmap();
#if defined( _WIN32 ) #if defined( _WIN32 )
int InitMultisample(PIXELFORMATDESCRIPTOR pfd); bool InitMultisample(PIXELFORMATDESCRIPTOR pfd);
#endif #endif
int GetMSAASupport(); bool GetMSAASupport();
int GetMSAAFormat(); int GetMSAAFormat();
void SetColor(sal_uInt32 color); void SetColor(sal_uInt32 color);
int Bubble2DShapePoint(float x, float y, float directionX, float directionY); int Bubble2DShapePoint(float x, float y, float directionX, float directionY);
...@@ -192,8 +192,8 @@ private: ...@@ -192,8 +192,8 @@ private:
int RenderTexture2FBO(GLuint TexID); int RenderTexture2FBO(GLuint TexID);
#if defined( _WIN32 ) #if defined( _WIN32 )
int InitTempWindow(HWND *hwnd, int width, int height, PIXELFORMATDESCRIPTOR inPfd); int InitTempWindow(HWND *hwnd, int width, int height, PIXELFORMATDESCRIPTOR inPfd);
bool WGLisExtensionSupported(const char *extension);
#endif #endif
int WGLisExtensionSupported(const char *extension);
int CreateMultiSampleFrameBufObj(); int CreateMultiSampleFrameBufObj();
int Create2DCircle(int detail); int Create2DCircle(int detail);
void SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2); void SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2);
...@@ -277,10 +277,10 @@ private: ...@@ -277,10 +277,10 @@ private:
std::list <Line2DPointList> m_Line2DShapePointList; std::list <Line2DPointList> m_Line2DShapePointList;
com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxRenderTarget; com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxRenderTarget;
int m_iArbMultisampleSupported; bool m_iArbMultisampleSupported;
int m_iArbMultisampleFormat; int m_iArbMultisampleFormat;
GLint m_iSampleBufs; GLint m_iSampleBufs;
GLint m_iSamples; GLint m_iSamples;
glm::vec4 m_2DColor; glm::vec4 m_2DColor;
GLuint m_frameBufferMS; GLuint m_frameBufferMS;
......
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