388 |
return ret; |
return ret; |
389 |
} |
} |
390 |
|
|
391 |
|
JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_impl_1Texture_1loadNull2D |
392 |
|
(JNIEnv *env, jclass, jint id, jint level, jstring internalFormat_s, |
393 |
|
jint w, jint h, jint border, jstring format_s, jstring type_s) { |
394 |
|
int internalFormat = tokenFromJstring(env, internalFormat_s); |
395 |
|
int format = tokenFromJstring(env, format_s); |
396 |
|
int type = tokenFromJstring(env, type_s); |
397 |
|
|
398 |
|
glBindTexture(GL_TEXTURE_2D, id); |
399 |
|
// Null = just set size and texture format. |
400 |
|
glTexImage2D(GL_TEXTURE_2D, |
401 |
|
level, internalFormat, w, h, border, format, type, NULL); |
402 |
|
glBindTexture(GL_TEXTURE_2D, 0); |
403 |
|
GLERR |
404 |
|
} |
405 |
|
|
406 |
|
JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_impl_1Texture_1loadSubImage |
407 |
|
(JNIEnv *env, jclass, jint id, jint level, jint imageId, jint xoffs, jint yoffs) { |
408 |
|
|
409 |
|
glBindTexture(GL_TEXTURE_2D, id); |
410 |
|
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE); |
411 |
|
|
412 |
|
Image *img = images.get(imageId); |
413 |
|
img->loadIntoTexture(level, xoffs, yoffs); |
414 |
|
glBindTexture(GL_TEXTURE_2D, 0); |
415 |
|
GLERR |
416 |
|
} |
417 |
|
|
418 |
JNIEXPORT jint JNICALL Java_gzz_gfx_gl_GZZGL_impl_1Texture_1shade |
JNIEXPORT jint JNICALL Java_gzz_gfx_gl_GZZGL_impl_1Texture_1shade |
419 |
(JNIEnv *env, jclass, jint id, jint w, jint h, jint d, jint comp, |
(JNIEnv *env, jclass, jint id, jint w, jint h, jint d, jint comp, |
420 |
jstring internalFormat, |
jstring internalFormat, |