mirror of
https://github.com/android/ndk-samples
synced 2025-11-10 02:21:11 +08:00
Compare commits
2 Commits
master
...
android-mk
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
485f2b9d19 | ||
|
|
0e88bb1c3e |
@@ -129,7 +129,7 @@ void RendererES2::draw(unsigned int numInstances) {
|
|||||||
glUseProgram(mProgram);
|
glUseProgram(mProgram);
|
||||||
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, mVB);
|
glBindBuffer(GL_ARRAY_BUFFER, mVB);
|
||||||
glVertexAttribPointer(mPosAttrib, 4, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid*)offsetof(Vertex, pos));
|
glVertexAttribPointer(mPosAttrib, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid*)offsetof(Vertex, pos));
|
||||||
glVertexAttribPointer(mColorAttrib, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Vertex), (const GLvoid*)offsetof(Vertex, rgba));
|
glVertexAttribPointer(mColorAttrib, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Vertex), (const GLvoid*)offsetof(Vertex, rgba));
|
||||||
glEnableVertexAttribArray(mPosAttrib);
|
glEnableVertexAttribArray(mPosAttrib);
|
||||||
glEnableVertexAttribArray(mColorAttrib);
|
glEnableVertexAttribArray(mColorAttrib);
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ bool RendererES3::init() {
|
|||||||
glBindVertexArray(mVBState);
|
glBindVertexArray(mVBState);
|
||||||
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, mVB[VB_INSTANCE]);
|
glBindBuffer(GL_ARRAY_BUFFER, mVB[VB_INSTANCE]);
|
||||||
glVertexAttribPointer(POS_ATTRIB, 4, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid*)offsetof(Vertex, pos));
|
glVertexAttribPointer(POS_ATTRIB, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid*)offsetof(Vertex, pos));
|
||||||
glVertexAttribPointer(COLOR_ATTRIB, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Vertex), (const GLvoid*)offsetof(Vertex, rgba));
|
glVertexAttribPointer(COLOR_ATTRIB, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Vertex), (const GLvoid*)offsetof(Vertex, rgba));
|
||||||
glEnableVertexAttribArray(POS_ATTRIB);
|
glEnableVertexAttribArray(POS_ATTRIB);
|
||||||
glEnableVertexAttribArray(COLOR_ATTRIB);
|
glEnableVertexAttribArray(COLOR_ATTRIB);
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "gles3jni.h"
|
#include "gles3jni.h"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user