*** empty log message ***

This commit is contained in:
Elias Naur 2003-09-08 14:40:46 +00:00
parent 2b1a59e722
commit d2f44f4a3e
6 changed files with 99 additions and 17 deletions

View file

@ -1,4 +1,4 @@
aclocal
autoheader
automake --foreign --include-deps --add-missing --copy
automake --foreign --include-deps --add-missing
autoconf

View file

@ -31,7 +31,6 @@
*/
#include <stdio.h>
#include <jni.h>
#include "extal.h"
#ifdef _X11

View file

@ -40,10 +40,17 @@
#ifdef _X11
#include <AL/altypes.h>
#include <AL/alctypes.h>
#else
#endif
#ifdef _WIN32
#include <altypes.h>
#include <alctypes.h>
#endif
#ifdef _AGL
#include <OpenAL/alctypes.h>
#include <OpenAL/altypes.h>
#endif
#include <jni.h>
#ifdef __cplusplus
extern "C" {

View file

@ -26,19 +26,16 @@ else
DEBUG_FLAGS=
fi
CC="$CXX"
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
AC_CANONICAL_HOST
case "$host_os" in
darwin*) _BUILD_FLAGS="-D_AGL -fpascal-strings -I/Library/Frameworks/OpenAL.framework/Headers"
AC_CHECK_HEADER([/Library/Frameworks/OpenAL.framework/Headers/altypes.h],, AC_MSG_ERROR([OpenAL headers required]))
AC_CHECK_HEADER([/Library/Frameworks/OpenAL.framework/Headers/alctypes.h],, AC_MSG_ERROR([OpenAL headers required]))
darwin*) _BUILD_FLAGS="-D_AGL -fpascal-strings"
NATIVE_BUILD_DIR=macosx
CXXFLAGS="$CXXFLAGS $DEBUG_FLAGS -Wall $_BUILD_FLAGS"
CFLAGS="$CFLAGS $DEBUG_FLAGS -Wall $_BUILD_FLAGS"
;;
bsdi* | linux* | solaris*) AC_PATH_XTRA
AC_LIBTOOL_DLOPEN
_BUILD_FLAGS="-pthread -D_X11 $X_CFLAGS"
AC_CHECK_HEADERS([AL/altypes.h AL/alctypes.h],, AC_MSG_ERROR([OpenAL headers required]))
NATIVE_BUILD_DIR=linux
@ -49,17 +46,12 @@ case "$host_os" in
AC_CHECK_LIB(Xext, main,, AC_MSG_ERROR(Xext is required))
AC_CHECK_LIB(Xxf86vm, main,, AC_MSG_ERROR(Xxf86vm is required))
AC_CHECK_LIB(pthread, pthread_create,, AC_MSG_ERROR(pthread is required))
;;
*) AC_MSG_ERROR([Unsupported system $host_os]);;
esac
AC_SUBST(native_build_dir, [$NATIVE_BUILD_DIR])
# Checks for libraries.
# Checks for header files.
AC_HEADER_STDC
CC="$CXX"
AC_PROG_LIBTOOL
AC_JNI_INCLUDE_DIR
@ -68,6 +60,13 @@ do
CXXFLAGS="$CXXFLAGS -I$JNI_INCLUDE_DIR"
done
AC_SUBST(native_build_dir, [$NATIVE_BUILD_DIR])
# Checks for libraries.
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADER([stddef.h stdlib.h string.h sys/time.h])
# Checks for typedefs, structures, and compiler characteristics.

View file

@ -10,7 +10,7 @@ NATIVE = \
# org_lwjgl_input_Keyboard.cpp \
# org_lwjgl_input_Mouse.cpp \
# org_lwjgl_input_Cursor.cpp \
# org_lwjgl_opengl_Window.cpp \
org_lwjgl_opengl_Window.cpp
# org_lwjgl_opengl_GLCaps.cpp \
# org_lwjgl_opengl_Pbuffer.cpp

View file

@ -0,0 +1,77 @@
/*
* Copyright (c) 2002 Light Weight Java Game Library Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'Light Weight Java Game Library' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* $Id$
*
* Base OSX functionality for GL.
*
* @author Elias Naur <elias_naur@sourceforge.net>
* @version $Revision$
*/
#include <JavaVM/jni.h>
#include <Carbon/Carbon.h>
static WindowRef win_ref;
/*
* Utility function to throw an Exception
*/
static void throwException(JNIEnv * env, const char * err)
{
jclass cls = env->FindClass("java/lang/Exception");
env->ThrowNew(cls, err);
env->DeleteLocalRef(cls);
}
/*
* Class: org_lwjgl_opengl_Window
* Method: nCreate
* Signature: (Ljava/lang/String;IIIIZIIII)V
*/
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nCreate(JNIEnv *env, jclass clazz, jstring title, jint x, jint y, jint width, jint height, jboolean fullscreen, jint bpp, jint alpha, jint depth, jint stencil) {
const Rect rect = {y, x, y + height, x + width};
/* rect.top = y;
rect.left = x;
rect.bottom = y + height;
rect.right = x + width;*/
OSStatus status;
status = CreateNewWindow(kPlainWindowClass, kWindowNoAttributes, &rect, &win_ref);
if (noErr != status) {
throwException(env, "Could not create window");
return;
}
printf("yir\n");
}