Add a grey gradient background to the 3D chartm and tweak text color.

Conflicts:
	chart2/source/view/main/GL3DRenderer.cxx

Change-Id: I8b74a1e7f32c30b6a908c0870bbeacc00cdea444
This commit is contained in:
Michael Meeks
2014-05-27 21:58:31 +01:00
committed by Markus Mohrhard
parent 538c13f3d1
commit 2e2d7d8b6f
3 changed files with 40 additions and 8 deletions

View File

@@ -190,6 +190,7 @@ public:
private:
void MoveModelf(PosVecf3& trans,PosVecf3& angle,PosVecf3& scale);
void ClearBuffer();
void RenderPolygon3DObject();
void RenderLine3D(Polygon3DInfo &polygon);
void RenderPolygon3D(Polygon3DInfo &polygon);

View File

@@ -77,7 +77,11 @@ const TextCacheItem& TextCache::getText(OUString const & rText)
VirtualDevice aDevice(*Application::GetDefaultDevice(), 0, 0);
Font aFont = aDevice.GetFont();
aFont.SetSize(Size(0, 96));
aFont.SetColor(COL_BLACK);
static bool bOldRender = getenv("OLDRENDER");
if (bOldRender)
aFont.SetColor(COL_BLACK);
else
aFont.SetColor(COL_GREEN); // RGB_COLORDATA(0xf0, 0xf0, 0xf0));
aDevice.SetFont(aFont);
aDevice.Erase();

View File

@@ -253,10 +253,7 @@ void OpenGL3DRenderer::init()
glEnable(GL_MULTISAMPLE);
glClearColor (1.0, 1.0, 1.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
glClearDepth(1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
ClearBuffer();
glGenBuffers(1, &m_CubeVertexBuf);
glGenBuffers(1, &m_CubeNormalBuf);
@@ -1693,12 +1690,42 @@ void OpenGL3DRenderer::CreateSceneBoxView()
m_CameraInfo.cameraUp);
}
void OpenGL3DRenderer::ClearBuffer()
{
static bool bOldRender = getenv("OLDRENDER");
if (!bOldRender) // gradient background
{
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);
glClearDepth(1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glBegin (GL_QUADS);
glColor3f(0.3,0.3,0.3);
glVertex3f (-1.0f, -1.0f, -1.0f);
glVertex3f (1.0f, -1.0f, -1.0f);
glColor3f(0.0,0.0,0.0);
glVertex3f (1.0f, 1.0f, -1.0f);
glVertex3f (-1.0f, 1.0f, -1.0f);
glEnd ();
glEnable(GL_LIGHTING);
glEnable(GL_DEPTH_TEST);
}
else
{
glClearDepth(1.0f);
glClearColor (1.0, 0.5, 0.5, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
}
void OpenGL3DRenderer::ProcessUnrenderedShape(bool bNewScene)
{
glViewport(0, 0, m_iWidth, m_iHeight);
glClearDepth(1.0f);
glClearColor(1.0, 1.0, 1.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
ClearBuffer();
CreateSceneBoxView();
//Polygon
RenderPolygon3DObject();