41 |
int getGlyphWidth(int c) { return rend->g.getGlyphWidth(c); } |
int getGlyphWidth(int c) { return rend->g.getGlyphWidth(c); } |
42 |
}; |
}; |
43 |
|
|
44 |
|
typedef std::vector<GLubyte> ByteVector; |
45 |
|
|
46 |
ObjectStorer<Os::Window> windows; |
ObjectStorer<Os::Window> windows; |
47 |
ObjectStorer<Image> images; |
ObjectStorer<Image> images; |
48 |
ObjectStorer<Mosaic::MosaicTile> imagetiles; |
ObjectStorer<Mosaic::MosaicTile> imagetiles; |
50 |
ObjectStorer<Renderable0> renderable0s; |
ObjectStorer<Renderable0> renderable0s; |
51 |
ObjectStorer<Renderable1> renderable1s; |
ObjectStorer<Renderable1> renderable1s; |
52 |
ObjectStorer<Renderable2> renderable2s; |
ObjectStorer<Renderable2> renderable2s; |
53 |
|
ObjectStorer<ByteVector> bytevectors; |
54 |
|
|
55 |
extern ObjectStorer<Paper::Paper> papers; |
extern ObjectStorer<Paper::Paper> papers; |
56 |
|
|
646 |
DBG(dbg) << "Deleted display list\n"; |
DBG(dbg) << "Deleted display list\n"; |
647 |
} |
} |
648 |
|
|
649 |
|
// ByteVector |
650 |
|
// |
651 |
|
JNIEXPORT jint JNICALL Java_gzz_gfx_gl_GZZGL_createByteVectorImpl |
652 |
|
(JNIEnv *, jclass, jint size) { |
653 |
|
ByteVector *vec = new ByteVector(size); |
654 |
|
return bytevectors.add(vec); |
655 |
|
} |
656 |
|
|
657 |
|
JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_deleteByteVector |
658 |
|
(JNIEnv *, jclass, jint id) { |
659 |
|
bytevectors.remove(id); |
660 |
|
} |
661 |
|
|
662 |
|
JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_impl_1ByteVector_1readFromBuffer_1ubytes |
663 |
|
(JNIEnv *env, jclass, jint id, jint winid, jstring buffer, jint x, jint y, jint w, jint h, jstring format) |
664 |
|
{ |
665 |
|
setWindow(winid); |
666 |
|
ByteVector *v = bytevectors[id]; |
667 |
|
GLenum buf = tokenFromJstring(env, buffer); |
668 |
|
GLenum form = tokenFromJstring(env, format); |
669 |
|
|
670 |
|
glPushAttrib(GL_PIXEL_MODE_BIT); |
671 |
|
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); |
672 |
|
glReadBuffer(buf); |
673 |
|
glPixelStorei(GL_PACK_ROW_LENGTH, 0); |
674 |
|
glPixelStorei(GL_PACK_ALIGNMENT, 1); |
675 |
|
glReadPixels(x, y, w, h, form, GL_UNSIGNED_BYTE, &((*v)[0])); |
676 |
|
GLERR |
677 |
|
glPopClientAttrib(); |
678 |
|
glPopAttrib(); |
679 |
|
releaseWindow(); |
680 |
|
} |
681 |
|
|
682 |
|
JNIEXPORT jint JNICALL Java_gzz_gfx_gl_GZZGL_impl_1ByteVector_1get |
683 |
|
(JNIEnv *env, jclass, jint id, jint ind) { |
684 |
|
return (*bytevectors[id])[ind]; |
685 |
|
} |
686 |
|
|
687 |
|
|
688 |
// Renderable |
// Renderable |
689 |
|
|