[Libreoffice-commits] core.git: 7 commits - chart2/opengl chart2/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Mon Feb 3 09:28:37 PST 2014
chart2/opengl/symbolFragmentShader.glsl | 61 ++++++++++
chart2/opengl/symbolVertexShader.glsl | 3
chart2/source/view/main/OpenGLRender.cxx | 172 ++++++++-----------------------
chart2/source/view/main/OpenGLRender.hxx | 24 +---
4 files changed, 116 insertions(+), 144 deletions(-)
New commits:
commit cf728ae8f2d4978b83460aff5b4e595e748233b2
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Feb 3 18:10:12 2014 +0100
the msaa checks are only needed on windows
Change-Id: Ib5a4012b7365259e08e8d2fd0c1f3b239b46517c
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index d4349a6..8ca8a58 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -761,16 +761,17 @@ OpenGLRender::OpenGLRender(uno::Reference< drawing::XShape > xTarget):
m_iHeight(0),
mxRenderTarget(xTarget),
mbArbMultisampleSupported(false),
+#if defined( _WIN32 )
+ m_iArbMultisampleFormat(0),
+#endif
m_2DColor(glm::vec4(1.0, 0.0, 0.0, 1.0)),
m_frameBufferMS(0),
m_TextVertexID(0),
- m_TextTexCoordID(1),
+ m_TextTexCoordID(1)
{
//TODO: moggi: use STL
memset(&m_Bubble2DCircle, 0, sizeof(m_Bubble2DCircle));
- m_iArbMultisampleFormat = 0;
-
//TODO: moggi: use STL
for (size_t i = 0; i < sizeof(m_BackgroundColor) / sizeof(float); i++)
{
@@ -950,7 +951,6 @@ bool OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd)
DestroyWindow(hWnd);
return mbArbMultisampleSupported;
}
-#endif
bool OpenGLRender::GetMSAASupport()
{
@@ -962,7 +962,6 @@ int OpenGLRender::GetMSAAFormat()
return m_iArbMultisampleFormat;
}
-#if defined( _WIN32 )
//TODO: moggi: why the hell do we need another implementation here?
int OpenGLRender::InitTempWindow(HWND *hwnd, int width, int height, PIXELFORMATDESCRIPTOR inPfd)
{
diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx
index 03364e2..3dc1077 100755
--- a/chart2/source/view/main/OpenGLRender.hxx
+++ b/chart2/source/view/main/OpenGLRender.hxx
@@ -151,9 +151,9 @@ public:
BitmapEx GetAsBitmap();
#if defined( _WIN32 )
bool InitMultisample(PIXELFORMATDESCRIPTOR pfd);
-#endif
bool GetMSAASupport();
int GetMSAAFormat();
+#endif
void SetColor(sal_uInt32 color);
int Bubble2DShapePoint(float x, float y, float directionX, float directionY);
int RenderBubble2FBO(int wholeFlag);
@@ -204,7 +204,7 @@ private:
glm::mat4 m_Projection;
// Camera matrix
glm::mat4 m_View;
- // Model matrix : an identity matrix (model will be at the origin#elif defined( UNX )
+ // Model matrix : an identity matrix (model will be at the origin
glm::mat4 m_Model;
// Our ModelViewProjection : multiplication of our 3 matrices
glm::mat4 m_MVP;
@@ -247,8 +247,11 @@ private:
std::list <Line2DPointList> m_Line2DShapePointList;
com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxRenderTarget;
+
bool mbArbMultisampleSupported;
+#if defined( _WIN32 )
int m_iArbMultisampleFormat;
+#endif
glm::vec4 m_2DColor;
GLuint m_frameBufferMS;
commit 27c1d4f2c4f55b67499d73fa7452a9a14a2aa948
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Feb 3 18:06:20 2014 +0100
working symbol rendering based on point sprites
This approach ahs several advantages compared to the old approach. There
is no UNO involved anymore and we have a perfect shape defined by a
mathematical formula. No need for anti-aliasing or complex calculations
on the CPU.
Change-Id: I5018eae516de3368037c4c293d937de66f38568d
diff --git a/chart2/opengl/symbolFragmentShader.glsl b/chart2/opengl/symbolFragmentShader.glsl
index a84d83c..2837f95 100644
--- a/chart2/opengl/symbolFragmentShader.glsl
+++ b/chart2/opengl/symbolFragmentShader.glsl
@@ -6,17 +6,70 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#
+
#version 120
varying vec4 fragmentColor;
+uniform int shape;
void main()
{
vec2 p = gl_PointCoord * 2.0 - vec2(1.0); // (0,0) in the center
- if (abs(p.x) < abs(p.y))
- discard;
-
+ if(shape == 0)
+ {
+ }
+ else if(shape == 1) //diamon
+ {
+ if (abs(p.x) + abs(p.y) > 1)
+ discard;
+ }
+ else if(shape == 2) // arrow
+ {
+ if(p.y < 0 && (abs(p.x) + abs(p.y)) > 1)
+ discard;
+ else if(p.y > 0 && abs(p.x) > 0.5)
+ discard;
+ }
+ else if(shape == 3) //arrow up
+ {
+ if(p.y > 0 && (abs(p.x) + abs(p.y)) > 1)
+ discard;
+ else if(p.y < 0 && abs(p.x) > 0.5)
+ discard;
+ }
+ else if(shape == 4)
+ {
+ if(p.x > 0 && (abs(p.x) + abs(p.y)) > 1)
+ discard;
+ else if(p.x < 0 && abs(p.y) > 0.5)
+ discard;
+ }
+ else if(shape == 5)
+ {
+ if(p.x < 0 && (abs(p.x) + abs(p.y)) > 1)
+ discard;
+ else if(p.x > 0 && abs(p.y) > 0.5)
+ discard;
+ }
+ else if(shape == 6)
+ {
+ if(abs(p.x) < abs(p.y))
+ discard;
+ }
+ else if(shape == 7)
+ {
+ if(abs(p.y) < abs(p.x))
+ discard;
+ }
+ else if(shape == 8)
+ {
+ if(dot(p.x, p.y) > 1)
+ discard;
+ }
+ else if(shape == 9)
+ {
+ }
+
gl_FragColor = fragmentColor;
}
diff --git a/chart2/opengl/symbolVertexShader.glsl b/chart2/opengl/symbolVertexShader.glsl
index e1bbec9..3cf9f41 100644
--- a/chart2/opengl/symbolVertexShader.glsl
+++ b/chart2/opengl/symbolVertexShader.glsl
@@ -16,9 +16,8 @@ varying vec4 fragmentColor;
void main()
{
- gl_Position = MVP * vec4(vPosition, 1);
+ gl_Position = MVP * vec4(vPosition, 1);
fragmentColor = vColor;
- gl_PointSize = 10.0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 29c5d35..d4349a6 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -297,8 +297,9 @@ int OpenGLRender::InitOpenGL(GLWindow aWindow)
m_SymbolProID = LoadShaders("symbolVertexShader", "symbolFragmentShader");
m_SymbolVertexID = glGetAttribLocation(m_SymbolProID, "vPosition");
- m_SymbolMatrixID = glGetAttribLocation(m_SymbolProID, "MVP");
- m_SymbolColorID = glGetAttribLocation(m_SymbolProID, "vColor");
+ m_SymbolMatrixID = glGetUniformLocation(m_SymbolProID, "MVP");
+ m_SymbolColorID = glGetUniformLocation(m_SymbolProID, "vColor");
+ m_SymbolShapeID = glGetUniformLocation(m_SymbolProID, "shape");
CHECK_GL_ERROR();
@@ -1204,11 +1205,13 @@ int OpenGLRender::RenderRectangleShape(bool bBorder, bool bFill)
{
//move the circle to the pos, and scale using the xScale and Y scale
RectanglePointList &pointList = m_RectangleShapePointList.front();
- PosVecf3 trans = {0, 0, 0};
- PosVecf3 angle = {0.0f, 0.0f, 0.0f};
- PosVecf3 scale = {1, 1, 1.0f};
- MoveModelf(trans, angle, scale);
- m_MVP = m_Projection * m_View * m_Model;
+ {
+ PosVecf3 trans = {0, 0, 0};
+ PosVecf3 angle = {0.0f, 0.0f, 0.0f};
+ PosVecf3 scale = {1, 1, 1.0f};
+ MoveModelf(trans, angle, scale);
+ m_MVP = m_Projection * m_View * m_Model;
+ }
//render to fbo
//fill vertex buffer
@@ -1251,6 +1254,17 @@ int OpenGLRender::RenderRectangleShape(bool bBorder, bool bFill)
}
if(bBorder)
{
+ if(bFill)
+ {
+ PosVecf3 trans = {0.0, 0.0, Z_STEP };
+ PosVecf3 angle = {0.0f, 0.0f, 0.0f};
+ PosVecf3 scale = {1, 1, 1.0f};
+ MoveModelf(trans, angle, scale);
+ m_MVP = m_Projection * m_View * m_Model;
+
+ m_fZStep += Z_STEP;
+ glUniformMatrix4fv(m_BackgroundMatrixID, 1, GL_FALSE, &m_MVP[0][0]);
+ }
SetBackGroundColor(COL_BLACK, COL_BLACK);
glBindBuffer(GL_ARRAY_BUFFER, m_ColorBuffer);
@@ -1649,31 +1663,36 @@ int OpenGLRender::RenderPieSegment2DShape(float fSize, float fPosX, float fPosY)
return 0;
}
-int OpenGLRender::RenderSymbol2DShape(float x, float y, float width, float height, sal_Int32)
+int OpenGLRender::RenderSymbol2DShape(float x, float y, float , float , sal_Int32 nSymbol)
{
CHECK_GL_ERROR();
- glDisable(GL_POINT_SMOOTH);
- glDisable(GL_MULTISAMPLE);
- glPointSize(10.f);
+ glPointSize(20.f);
CHECK_GL_ERROR();
- PosVecf3 trans = {x/OPENGL_SCALE_VALUE, y/OPENGL_SCALE_VALUE, m_fZStep};
+ PosVecf3 trans = {0.0, 0.0, 0.0};
PosVecf3 angle = {0.0f, 0.0f, 0.0f};
- PosVecf3 scale = {width/OPENGL_SCALE_VALUE, height/OPENGL_SCALE_VALUE, 1.0f};
+ PosVecf3 scale = {1.0, 1.0, 1.0f};
MoveModelf(trans, angle, scale);
m_MVP = m_Projection * m_View * m_Model;
- float aPos[3] = { 0.f, 0.f, 0.f };
+ float aPos[3] = { x/OPENGL_SCALE_VALUE, y/OPENGL_SCALE_VALUE, m_fZStep };
//fill vertex buffer
glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
+ CHECK_GL_ERROR();
glBufferData(GL_ARRAY_BUFFER, 3 * sizeof(float), aPos, GL_STATIC_DRAW);
CHECK_GL_ERROR();
// Use our shader
glUseProgram(m_SymbolProID);
+ CHECK_GL_ERROR();
+
glUniform4fv(m_SymbolColorID, 1, &m_2DColor[0]);
+ glUniform1i(m_SymbolShapeID, nSymbol);
+ CHECK_GL_ERROR();
+
glUniformMatrix4fv(m_SymbolMatrixID, 1, GL_FALSE, &m_MVP[0][0]);
+ CHECK_GL_ERROR();
// 1rst attribute buffer : vertices
glEnableVertexAttribArray(m_SymbolVertexID);
glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
@@ -1685,12 +1704,11 @@ int OpenGLRender::RenderSymbol2DShape(float x, float y, float width, float heigh
0, // stride
(void*)0 // array buffer offset
);
- glDrawArrays(GL_POINTS, 0, 1); // 12*3 indices starting at 0 -> 12 triangles
+ glDrawArrays(GL_POINTS, 0, 1);
glDisableVertexAttribArray(m_SymbolVertexID);
+ CHECK_GL_ERROR();
glUseProgram(0);
- glEnable(GL_MULTISAMPLE);
- glEnable(GL_POINT_SMOOTH);
m_fZStep += Z_STEP;
CHECK_GL_ERROR();
diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx
index e741595..03364e2 100755
--- a/chart2/source/view/main/OpenGLRender.hxx
+++ b/chart2/source/view/main/OpenGLRender.hxx
@@ -294,6 +294,7 @@ private:
GLuint m_SymbolVertexID;
GLuint m_SymbolMatrixID;
GLuint m_SymbolColorID;
+ GLuint m_SymbolShapeID;
#if DEBUG_POSITIONING
GLuint m_DebugProID;
commit b13185adbab4c18dbd691cf78083545b2874f2e8
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Feb 3 11:16:31 2014 +0100
remove unnecessary variable
Change-Id: Iabd5dc6ee7511244cfefbba6d4529531f3886439
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index fe7ec78..29c5d35 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -252,7 +252,7 @@ int OpenGLRender::InitOpenGL(GLWindow aWindow)
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glClearColor (m_ClearColor.r, m_ClearColor.g, m_ClearColor.b, m_ClearColor.a);
+ 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);
@@ -764,7 +764,6 @@ OpenGLRender::OpenGLRender(uno::Reference< drawing::XShape > xTarget):
m_frameBufferMS(0),
m_TextVertexID(0),
m_TextTexCoordID(1),
- m_ClearColor(glm::vec4(1.0f, 1.0f, 1.0f, 1.0f))
{
//TODO: moggi: use STL
memset(&m_Bubble2DCircle, 0, sizeof(m_Bubble2DCircle));
diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx
index fd06fde..e741595 100755
--- a/chart2/source/view/main/OpenGLRender.hxx
+++ b/chart2/source/view/main/OpenGLRender.hxx
@@ -285,7 +285,6 @@ private:
GLint m_BackgroundColorID;
float m_BackgroundColor[16];
- glm::vec4 m_ClearColor;
std::list <PieSegment2DPointList> m_PieSegment2DShapePointList;
PointList m_Symbol2DPointList;
commit 1e41e0f11543ff49273f4601d9d79f67f2c03ae4
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Feb 3 11:13:04 2014 +0100
slideshow.opengl -> chart2.opengl in SAL_WARN
Change-Id: I95aa9d709110208bb3463c162ceb1fd03df20bdc
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 9d1f1dd..fe7ec78 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -1312,7 +1312,7 @@ int OpenGLRender::CreateTextTexture(const BitmapEx& rBitmapEx, awt::Point aPos,
aWriter.Write( sOutput );
sOutput.Close();
} catch (...) {
- SAL_WARN("slideshow.opengl", "Error writing png to " << aName);
+ SAL_WARN("chart2.opengl", "Error writing png to " << aName);
}
#endif
commit d7bd0d011616ecb370768c401cc85ae8b4faca66
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Feb 3 11:11:40 2014 +0100
fix a few OpenGL resource leaks
Change-Id: I4957595d9e71c557257b7287367ee4ba689025ba
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index fb6b37d..9d1f1dd 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -727,9 +727,13 @@ void OpenGLRender::Release()
glDeleteProgram(m_CommonProID);
glDeleteProgram(m_TextProID);
glDeleteProgram(m_BackgroundProID);
+ glDeleteProgram(m_SymbolProID);
glDeleteFramebuffers(1, &m_FboID);
+ glDeleteFramebuffers(1, &m_frameBufferMS);
glDeleteTextures(1, &m_TextureObj);
glDeleteRenderbuffers(1, &m_RboID);
+ glDeleteRenderbuffers(1, &m_renderBufferColorMS);
+ glDeleteRenderbuffers(1, &m_renderBufferDepthMS);
#if defined( WNT )
wglMakeCurrent(NULL, NULL);
#elif defined( MACOSX )
@@ -757,6 +761,7 @@ OpenGLRender::OpenGLRender(uno::Reference< drawing::XShape > xTarget):
mxRenderTarget(xTarget),
mbArbMultisampleSupported(false),
m_2DColor(glm::vec4(1.0, 0.0, 0.0, 1.0)),
+ m_frameBufferMS(0),
m_TextVertexID(0),
m_TextTexCoordID(1),
m_ClearColor(glm::vec4(1.0f, 1.0f, 1.0f, 1.0f))
@@ -780,6 +785,7 @@ OpenGLRender::~OpenGLRender()
Release();
}
+// TODO: moggi: that screws up FBO if called after buffers have been created!!!!
void OpenGLRender::SetWidth(int width)
{
m_iWidth = width;
commit b07d8579594bc5e792118091c6da16cd25c5901d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Feb 3 10:40:28 2014 +0100
small clean up in the direction of Mac support
Change-Id: I0f494db288ef0cd5d79cac82dab9088ffedff767
diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx
index 4b717d8..fd06fde 100755
--- a/chart2/source/view/main/OpenGLRender.hxx
+++ b/chart2/source/view/main/OpenGLRender.hxx
@@ -7,17 +7,13 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include <com/sun/star/drawing/XDrawPage.hpp>
-#include <vcl/font.hxx>
-
#if defined( MACOSX )
#elif defined( UNX )
+#if defined( UNX )
#include <prex.h>
#include "GL/glxew.h"
#include <postx.h>
-#endif
-
-#if defined( _WIN32 )
+#elif defined( _WIN32 )
#include "prewin.h"
#include "windows.h"
#include "postwin.h"
@@ -36,17 +32,16 @@
#include <vcl/sysdata.hxx>
#include <vcl/bitmapex.hxx>
#include <com/sun/star/drawing/HomogenMatrix3.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <vcl/font.hxx>
+
#if defined( _WIN32 )
-#include <GL/glu.h>
#include <GL/glext.h>
#include <GL/wglext.h>
#elif defined( MACOSX )
#elif defined( UNX )
-
-#include <GL/glu.h>
#include <GL/glext.h>
-
#define GLX_GLXEXT_PROTOTYPES 1
#include <GL/glx.h>
#include <GL/glxext.h>
commit 142c98c0dc861e647ff828f2acebab33dd57b026
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Feb 3 10:38:35 2014 +0100
remove unnecessary variables and OpenGL calls
Change-Id: Id8fb61635982681e5b16d4b4b438bb9b64c64727
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 1c3795a..fb6b37d 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -64,103 +64,6 @@ using namespace std;
#define Z_STEP 0.001
-// end shaders
-
-static GLfloat squareVertices[] = {
- -1.0f, -1.0f, -1.0,
- 1.0f, -1.0f, -1.0,
- 1.0f, 1.0f, -1.0,
- -1.0f, 1.0f, -1.0
-};
-
-static GLfloat coordVertices[] = {
- 0.0f, 0.0f,
- 1.0f, 0.0f,
- 1.0f, 1.0f,
- 0.0f, 1.0f,
-};
-
-#if 0
-static const GLfloat g_vertex_buffer_data[] = {
- -1.0f,-1.0f,-1.0f,
- -1.0f,-1.0f, 1.0f,
- -1.0f, 1.0f, 1.0f,
- 1.0f, 1.0f,-1.0f,
- -1.0f,-1.0f,-1.0f,
- -1.0f, 1.0f,-1.0f,
- 1.0f,-1.0f, 1.0f,
- -1.0f,-1.0f,-1.0f,
- 1.0f,-1.0f,-1.0f,
- 1.0f, 1.0f,-1.0f,
- 1.0f,-1.0f,-1.0f,
- -1.0f,-1.0f,-1.0f,
- -1.0f,-1.0f,-1.0f,
- -1.0f, 1.0f, 1.0f,
- -1.0f, 1.0f,-1.0f,
- 1.0f,-1.0f, 1.0f,
- -1.0f,-1.0f, 1.0f,
- -1.0f,-1.0f,-1.0f,
- -1.0f, 1.0f, 1.0f,
- -1.0f,-1.0f, 1.0f,
- 1.0f,-1.0f, 1.0f,
- 1.0f, 1.0f, 1.0f,
- 1.0f,-1.0f,-1.0f,
- 1.0f, 1.0f,-1.0f,
- 1.0f,-1.0f,-1.0f,
- 1.0f, 1.0f, 1.0f,
- 1.0f,-1.0f, 1.0f,
- 1.0f, 1.0f, 1.0f,
- 1.0f, 1.0f,-1.0f,
- -1.0f, 1.0f,-1.0f,
- 1.0f, 1.0f, 1.0f,
- -1.0f, 1.0f,-1.0f,
- -1.0f, 1.0f, 1.0f,
- 1.0f, 1.0f, 1.0f,
- -1.0f, 1.0f, 1.0f,
- 1.0f,-1.0f, 1.0f
-};
-
-// One color for each vertex. They were generated randomly.
-static const GLfloat g_color_buffer_data[] = {
- 0.583f, 0.771f, 0.014f,
- 0.609f, 0.115f, 0.436f,
- 0.327f, 0.483f, 0.844f,
- 0.822f, 0.569f, 0.201f,
- 0.435f, 0.602f, 0.223f,
- 0.310f, 0.747f, 0.185f,
- 0.597f, 0.770f, 0.761f,
- 0.559f, 0.436f, 0.730f,
- 0.359f, 0.583f, 0.152f,
- 0.483f, 0.596f, 0.789f,
- 0.559f, 0.861f, 0.639f,
- 0.195f, 0.548f, 0.859f,
- 0.014f, 0.184f, 0.576f,
- 0.771f, 0.328f, 0.970f,
- 0.406f, 0.615f, 0.116f,
- 0.676f, 0.977f, 0.133f,
- 0.971f, 0.572f, 0.833f,
- 0.140f, 0.616f, 0.489f,
- 0.997f, 0.513f, 0.064f,
- 0.945f, 0.719f, 0.592f,
- 0.543f, 0.021f, 0.978f,
- 0.279f, 0.317f, 0.505f,
- 0.167f, 0.620f, 0.077f,
- 0.347f, 0.857f, 0.137f,
- 0.055f, 0.953f, 0.042f,
- 0.714f, 0.505f, 0.345f,
- 0.783f, 0.290f, 0.734f,
- 0.722f, 0.645f, 0.174f,
- 0.302f, 0.455f, 0.848f,
- 0.225f, 0.587f, 0.040f,
- 0.517f, 0.713f, 0.338f,
- 0.053f, 0.959f, 0.120f,
- 0.393f, 0.621f, 0.362f,
- 0.673f, 0.211f, 0.457f,
- 0.820f, 0.883f, 0.371f,
- 0.982f, 0.099f, 0.879f
-};
-#endif
-
int static checkGLError(const char *file, int line)
{
GLenum glErr;
@@ -409,17 +312,14 @@ int OpenGLRender::InitOpenGL(GLWindow aWindow)
glGenBuffers(1, &m_RenderVertexBuf);
glBindBuffer(GL_ARRAY_BUFFER, m_RenderVertexBuf);
- glBufferData(GL_ARRAY_BUFFER, sizeof(squareVertices), squareVertices, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glGenBuffers(1, &m_RenderTexCoordBuf);
glBindBuffer(GL_ARRAY_BUFFER, m_RenderTexCoordBuf);
- glBufferData(GL_ARRAY_BUFFER, sizeof(coordVertices), coordVertices, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glGenBuffers(1, &m_TextTexCoordBuf);
glBindBuffer(GL_ARRAY_BUFFER, m_TextTexCoordBuf);
- glBufferData(GL_ARRAY_BUFFER, sizeof(coordVertices), coordVertices, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
#if defined( WNT )
More information about the Libreoffice-commits
mailing list