27 |
#include <callgl.hxx> |
#include <callgl.hxx> |
28 |
|
|
29 |
#include <vob/jni/Types.hxx> |
#include <vob/jni/Types.hxx> |
30 |
|
#include <vob/jni/Strings.hxx> |
31 |
#include <vob/glerr.hxx> |
#include <vob/glerr.hxx> |
32 |
|
|
33 |
#include <vob/Texture.hxx> |
#include <vob/Texture.hxx> |
46 |
|
|
47 |
Os::WindowSystem *ws; |
Os::WindowSystem *ws; |
48 |
|
|
|
typedef std::vector<GLubyte> ByteVector; |
|
49 |
ObjectStorer<ByteVector> bytevectors("bytevectors"); |
ObjectStorer<ByteVector> bytevectors("bytevectors"); |
50 |
|
|
51 |
ObjectStorer<Os::RenderingSurface> windows("windows"); |
ObjectStorer<Os::RenderingSurface> windows("windows"); |
98 |
} |
} |
99 |
} |
} |
100 |
|
|
|
/** Converts std::string to jstring through UTF-8 transformation */ |
|
|
jstring stdstr2jstr(JNIEnv *env, std::string stdstr) { |
|
|
return env->NewStringUTF(stdstr.c_str()); |
|
|
} |
|
|
|
|
|
/** Converts jstring to std::string through UTF-8 transformation */ |
|
|
std::string jstr2stdstr(JNIEnv *env, jstring jstr) { |
|
|
const char *strptr = env->GetStringUTFChars(jstr, 0); |
|
|
std::string stdstr(strptr, env->GetStringUTFLength(jstr)); |
|
|
env->ReleaseStringUTFChars(jstr, strptr); |
|
|
return stdstr; |
|
|
} |
|
|
|
|
101 |
struct GZZJNIEventHandler : public Os::Eventhandler { |
struct GZZJNIEventHandler : public Os::Eventhandler { |
102 |
|
|
103 |
jobject globalRef; |
jobject globalRef; |
386 |
releaseWindow(); |
releaseWindow(); |
387 |
} |
} |
388 |
|
|
|
GLenum tokenFromJstring(JNIEnv *env, jstring token) { |
|
|
std::string str = jstr2stdstr(env, token); |
|
|
GLenum ret = CallGL::getTokenValue(str.c_str()); |
|
|
return ret; |
|
|
} |
|
|
|
|
389 |
bool hasGenMipmaps() { |
bool hasGenMipmaps() { |
390 |
static int initialized; |
static int initialized; |
391 |
static bool hasExtension; |
static bool hasExtension; |