Browse Source

aha, need 4-byte aligned strides

opengl-renderer-broken
Martin Dørum 4 years ago
parent
commit
afbca0d590
1 changed files with 8 additions and 3 deletions
  1. 8
    3
      libcygnet/samples/hello-texture/hello-texture.cc

+ 8
- 3
libcygnet/samples/hello-texture/hello-texture.cc View File

@@ -30,9 +30,9 @@ int main() {
};

uint8_t image[] = {
0xff, 0xff, 0xff, 0xaa, 0xaa, 0xaa, 0xff, 0x00, 0xba,
0xaa, 0xaa, 0xaa, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff,
0xa0, 0x55, 0x77, 0x00, 0xf0, 0x0f, 0xff, 0x00, 0xff,
0xff, 0xff, 0xff, 0xaa, 0xaa, 0xaa, 0xff, 0x00, 0xba, 0, 0, 0,
0xaa, 0xaa, 0xaa, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0, 0, 0,
0xa0, 0x55, 0x77, 0x00, 0xf0, 0x0f, 0xff, 0x00, 0xff, 0, 0, 0,
};

GLuint texId;
@@ -77,6 +77,11 @@ int main() {
glUniform1i(texLoc, 0);
Cygnet::glCheck();

glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texId);
glUniform1i(texLoc, 0);
Cygnet::glCheck();

glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indexes);
Cygnet::glCheck();


Loading…
Cancel
Save