aboutsummaryrefslogtreecommitdiffstats
path: root/src/native/ogl/NativeScreenInfo.c
diff options
context:
space:
mode:
authorKevin Rushforth <[email protected]>2004-06-09 04:25:41 +0000
committerKevin Rushforth <[email protected]>2004-06-09 04:25:41 +0000
commit343b658c32a6473c545187c1e276ee5d06c2686a (patch)
treead2606538b7db1c3553c53a79ccccb2ed5b5e4e2 /src/native/ogl/NativeScreenInfo.c
parent06cebb1e576da6f7222f999ab059dcfa3d8edd39 (diff)
Initial creation of j3d-core-utils sources in CVS repository
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@7 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/native/ogl/NativeScreenInfo.c')
-rw-r--r--src/native/ogl/NativeScreenInfo.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/native/ogl/NativeScreenInfo.c b/src/native/ogl/NativeScreenInfo.c
new file mode 100644
index 0000000..c92900c
--- /dev/null
+++ b/src/native/ogl/NativeScreenInfo.c
@@ -0,0 +1,65 @@
+/*
+ * $RCSfile$
+ *
+ * Copyright (c) 2004 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Use is subject to license terms.
+ *
+ * $Revision$
+ * $Date$
+ * $State$
+ */
+
+/*
+ * Portions of this code were derived from work done by the Blackdown
+ * group (www.blackdown.org), who did the initial Linux implementation
+ * of the Java 3D API.
+ */
+
+#include <jni.h>
+#include <math.h>
+
+#include "gldefs.h"
+
+#if defined(SOLARIS) || defined(__linux__)
+#include <X11/X.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#endif
+
+#ifdef WIN32
+#include <windows.h>
+#endif
+
+#if defined(SOLARIS) || defined(__linux__)
+/*
+ * Class: javax_media_j3d_NativeScreenInfo
+ * Method: openDisplay
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL
+Java_javax_media_j3d_NativeScreenInfo_openDisplay(
+ JNIEnv *env,
+ jobject obj)
+{
+ Display* dpy;
+ dpy = XOpenDisplay(NULL);
+ return (jlong)dpy;
+}
+
+
+/*
+ * Class: javax_media_j3d_NativeScreenInfo
+ * Method: getDefaultScreen
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL
+Java_javax_media_j3d_NativeScreenInfo_getDefaultScreen(
+ JNIEnv *env,
+ jobject obj,
+ jlong display)
+{
+ Display* dpy = (Display*)display;
+ return (jint)DefaultScreen(dpy);
+}
+#endif