495 |
GLERR |
GLERR |
496 |
} |
} |
497 |
|
|
498 |
|
JNIEXPORT void JNICALL Java_gzz_gfx_gl_GL_impl_1Texture_1texImage2D |
499 |
|
(JNIEnv *env, jclass, jint id, jint level, jstring internalFormat_s, |
500 |
|
jint w, jint h, jint border, jstring format_s, jstring type_s, |
501 |
|
jbyteArray jdata) { |
502 |
|
int internalFormat = tokenFromJstring(env, internalFormat_s); |
503 |
|
int format = tokenFromJstring(env, format_s); |
504 |
|
int type = tokenFromJstring(env, type_s); |
505 |
|
jbyte *data = env->GetByteArrayElements(jdata, 0); |
506 |
|
|
507 |
|
glBindTexture(GL_TEXTURE_2D, id); |
508 |
|
glTexImage2D(GL_TEXTURE_2D, |
509 |
|
level, internalFormat, w, h, border, format, type, data); |
510 |
|
env->ReleaseByteArrayElements(jdata, data, 0); |
511 |
|
glBindTexture(GL_TEXTURE_2D, 0); |
512 |
|
GLERR |
513 |
|
} |
514 |
|
|
515 |
|
|
516 |
JNIEXPORT void JNICALL Java_gzz_gfx_gl_GL_impl_1Texture_1loadSubImage |
JNIEXPORT void JNICALL Java_gzz_gfx_gl_GL_impl_1Texture_1loadSubImage |
517 |
(JNIEnv *env, jclass, jint id, jint level, jint imageId, jint x, jint y, |
(JNIEnv *env, jclass, jint id, jint level, jint imageId, jint x, jint y, |
518 |
jint xoffs, jint yoffs, jint w, jint h) { |
jint xoffs, jint yoffs, jint w, jint h) { |