12 |
|
|
13 |
#include "libos/Os.hxx" |
#include "libos/Os.hxx" |
14 |
|
|
15 |
|
#include "libimagecache/ImageCache.hxx" |
16 |
|
|
17 |
using namespace Vec23; |
using namespace Vec23; |
18 |
|
|
19 |
using Text::DenseGlyphs; |
using Text::DenseGlyphs; |
275 |
|
|
276 |
// ImageCache |
// ImageCache |
277 |
|
|
278 |
/* |
JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_writeToImageCache |
279 |
JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_getImage |
(JNIEnv *env, jclass cls, jstring juri, jcharArray jbuf, jint len) { |
280 |
(JNIEnv *env, jclass, jstring juri, jint lod) { |
|
281 |
string uri = new string((*env)->GetStringUTFChars(env, jstr, 0)); |
char uri[] = (char *)((*env)->GetStringUTFChars(env, juri, 0)); |
282 |
(*env)->ReleaseStringUTFChars(env, jstr, str); |
char buf[] = (char *)((*env)->GetCharArrayElements(env, jbuf, 0)); |
283 |
imageCache->getPixbuf(); |
// imageCache->write(new string(uri), buf, len); |
284 |
|
(*env)->ReleaseStringUTFChars(env, juri, uri); |
285 |
|
(*env)->ReleaseCharArrayElements(env, jbuf, buf, 0); |
286 |
} |
} |
287 |
*/ |
|
288 |
|
JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_getFromImageCache |
289 |
|
(JNIEnv *env, jclass cls, jstring juri, jint lod) { |
290 |
|
|
291 |
|
char uri[] = (char *)((env *)->GetStringUTFChars(env, juri, 0)); |
292 |
|
string suri = new string(uri); |
293 |
|
// GdkPixbuf *pb = imageCache->getPixbuf(suri, lod); |
294 |
|
if (pb == START_PIXBUF_BACKGROUND_LOADER) { |
295 |
|
methodID mid = (*env)->GetStaticMethodID(env, cls, |
296 |
|
"startBackgroundImageLoader", "(Ljava/lang/String;)V"); |
297 |
|
if (mid != 0) { |
298 |
|
(*env)->CallStaticVoidMethod(env, cls, mid, juri); |
299 |
|
} |
300 |
|
// pb = imageCache->getPixbuf(suri, lod); |
301 |
|
} |
302 |
|
(*env)->ReleaseStringUTFChars(env, juri, uri); |
303 |
|
|
304 |
// Image |
// Image |
305 |
|
|
408 |
|
|
409 |
glBindTexture(GL_TEXTURE_2D, id); |
glBindTexture(GL_TEXTURE_2D, id); |
410 |
// Null = just set size and texture format. |
// Null = just set size and texture format. |
411 |
glTexImage2D(GL_TEXTURE_2D, |
glTexImage2D(GL_TEXTURE_2D, |
412 |
level, internalFormat, w, h, border, format, type, NULL); |
level, internalFormat, w, h, border, format, type, NULL); |
413 |
glBindTexture(GL_TEXTURE_2D, 0); |
glBindTexture(GL_TEXTURE_2D, 0); |
414 |
GLERR |
GLERR |