summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-06-14 16:18:42 +0300
committerAndrei Karas <akaras@inbox.ru>2014-06-14 16:18:42 +0300
commit75402569f455321e5fd078a57c35b2032a3bdbaf (patch)
treea3fb934b954c9c70ca8ca6155170596ba4458e9f /src
parent939e65b82212236cb9a9910786d5804589fac4dd (diff)
downloadmv-75402569f455321e5fd078a57c35b2032a3bdbaf.tar.gz
mv-75402569f455321e5fd078a57c35b2032a3bdbaf.tar.bz2
mv-75402569f455321e5fd078a57c35b2032a3bdbaf.tar.xz
mv-75402569f455321e5fd078a57c35b2032a3bdbaf.zip
Add OpenGL function glVertexAttribIPointer.
Diffstat (limited to 'src')
-rw-r--r--src/graphicsmanager.cpp1
-rw-r--r--src/render/mgl.cpp1
-rw-r--r--src/render/mgl.h1
-rw-r--r--src/render/mgltypes.h2
-rw-r--r--src/render/modernopenglgraphics.cpp4
5 files changed, 9 insertions, 0 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index 5455da65b..257d4233e 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -961,6 +961,7 @@ void GraphicsManager::initOpenGLFunctions()
assignFunction(glEnableVertexAttribArray, "glEnableVertexAttribArray");
assignFunction(glDisableVertexAttribArray,
"glDisableVertexAttribArray");
+ assignFunction(glVertexAttribIPointer, "glVertexAttribIPointer");
}
else
{
diff --git a/src/render/mgl.cpp b/src/render/mgl.cpp
index 58b60019c..63730fbad 100644
--- a/src/render/mgl.cpp
+++ b/src/render/mgl.cpp
@@ -94,6 +94,7 @@ defName(glVertexAttribFormat);
defName(glBindVertexBuffers);
defName(glIsBuffer);
defName(glVertexAttribIFormat);
+defName(glVertexAttribIPointer);
#ifdef WIN32
defName(wglGetExtensionsString);
diff --git a/src/render/mgl.h b/src/render/mgl.h
index 85545c19d..53c6b714b 100644
--- a/src/render/mgl.h
+++ b/src/render/mgl.h
@@ -97,6 +97,7 @@ defNameE(glVertexAttribFormat);
defNameE(glBindVertexBuffers);
defNameE(glIsBuffer);
defNameE(glVertexAttribIFormat);
+defNameE(glVertexAttribIPointer);
#ifdef WIN32
defNameE(wglGetExtensionsString);
diff --git a/src/render/mgltypes.h b/src/render/mgltypes.h
index df9c16eee..9deefd41f 100644
--- a/src/render/mgltypes.h
+++ b/src/render/mgltypes.h
@@ -142,6 +142,8 @@ typedef void (APIENTRY *glBindVertexBuffers_t) (GLuint first, GLsizei count,
typedef GLboolean (APIENTRY *glIsBuffer_t) (GLuint buffer);
typedef void (APIENTRY *glVertexAttribIFormat_t) (GLuint attribindex,
GLint size, GLenum type, GLuint relativeoffset);
+typedef void (APIENTRY *glVertexAttribIPointer_t) (GLuint index, GLint size,
+ GLenum type, GLsizei stride, const GLvoid * pointer);
// callback
typedef void (APIENTRY *GLDEBUGPROC_t) (GLenum source, GLenum type, GLuint id,
diff --git a/src/render/modernopenglgraphics.cpp b/src/render/modernopenglgraphics.cpp
index c0809012d..df14a026e 100644
--- a/src/render/modernopenglgraphics.cpp
+++ b/src/render/modernopenglgraphics.cpp
@@ -172,6 +172,7 @@ void ModernOpenGLGraphics::postInit()
mglBindVertexBuffer(0, mVbo, 0, 4 * sizeof(GLint));
mglVertexAttribBinding(mPosAttrib, 0);
+// mglVertexAttribIPointer(mPosAttrib, 4, GL_INT, 4 * sizeof(GLint), 0);
mAttributesCached = mVbo;
screenResized();
@@ -1203,6 +1204,7 @@ void ModernOpenGLGraphics::bindArrayBufferAndAttributes(const GLuint vbo)
mAttributesCached = mVboCached;
// logger->log("bind vertex buffer: %u", mVboCached);
mglBindVertexBuffer(0, mVboCached, 0, 4 * sizeof(GLint));
+// mglVertexAttribIPointer(mPosAttrib, 4, GL_INT, 4 * sizeof(GLint), 0);
// mglVertexAttribBinding(mPosAttrib, 0);
}
else if (mAttributesCached != mVboCached)
@@ -1210,6 +1212,7 @@ void ModernOpenGLGraphics::bindArrayBufferAndAttributes(const GLuint vbo)
mAttributesCached = mVboCached;
// logger->log("bind vertex buffer: %u", mVboCached);
mglBindVertexBuffer(0, mVboCached, 0, 4 * sizeof(GLint));
+// mglVertexAttribIPointer(mPosAttrib, 4, GL_INT, 4 * sizeof(GLint), 0);
// mglVertexAttribBinding(mPosAttrib, 0);
}
}
@@ -1220,6 +1223,7 @@ void ModernOpenGLGraphics::bindAttributes()
{
mAttributesCached = mVboCached;
mglBindVertexBuffer(0, mVboCached, 0, 4 * sizeof(GLint));
+// mglVertexAttribIPointer(mPosAttrib, 4, GL_INT, 4 * sizeof(GLint), 0);
// mglVertexAttribBinding(mPosAttrib, 0);
}
}