Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (550)
Games in Android Showcase (139)
games submitted by our members
Games in WIP (593)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / JOGL Development / Re: nurbs support in jogl on: 2005-03-22 11:25:13
Ken, thanks for the answer
but why do you have to port C glu library to the Java?
why not to use native glu library via JNI?

can you explain pro/contra?

2  Java Game APIs & Engines / JOGL Development / nurbs support in jogl on: 2005-03-22 01:31:13
what is the status of the nurbs support in the jogl?
I found GLUnurbs object in API
but I didn't find any other API that uses it
is there separate jar file(s)?


3  Java Game APIs & Engines / JOGL Development / possible glGetDoublev implementation problem on: 2003-10-25 22:34:20
after some discussion in java-dev Apple's list
I took a look at glGetDoublev implementation:

Java_net_java_games_jogl_impl_macosx_MacOSXGLImpl_glGetDoublev(JNIEnv *env, jobject _unused, jint pname, jdoubleArray params) {
  GLdouble * _ptr1 = NULL;
  if (params != NULL) {
    _ptr1 = (GLdouble *) (*env)->GetPrimitiveArrayCritical(env, params, NULL);
  glGetDoublev((GLenum) pname, (GLdouble *) _ptr1);
  if (params != NULL) {
    (*env)->ReleasePrimitiveArrayCritical(env, params, _ptr1, JNI_ABORT);

I can see at least 2 possible problem there:
1. GetPrimitiveArrayCritical could return NULL, so using that _ptr1 isn't recommended
2. GetPrimitiveArrayCritical could use copy, so JNI_ABORT isn't appropriate in ReleasePrimitiveArrayCritical

and just comment (GLdouble *) casting in glGetDoublev
isn't necessary, because _ptr1 was declared as GLdouble*

so I'd recommend the following code instead

Java_net_java_games_jogl_impl_macosx_MacOSXGLImpl_glGetDoublev(JNIEnv *env, jobject _unused, jint pname, jdoubleArray params) {
        GLdouble * _ptr1 = NULL;
      jboolean isCopiedArray = JNI_FALSE;
        if (params == NULL)  return;
          _ptr1 = (GLdouble *) (*env)->GetPrimitiveArrayCritical(env, params,& isCopiedArray);
      if(_ptr1 == NULL) return;
        glGetDoublev((GLenum) pname,  _ptr1);
          (*env)->ReleasePrimitiveArrayCritical(env, params, _ptr1,(isCopiedArray == JNI_TRUE)?0:JNI_ABORT);

4  Java Game APIs & Engines / JOGL Development / mac os x jogl implementation workaround on: 2003-10-10 04:01:08

jogl mac os x implementation has a serious problem:

it's impossible to share jogl gl canvas with other awt components
JAWT MAC OS X implementation has a bug that is responsible for that problem
Gerard Ziemski informed us (java-dev list) earlier that he fixed that bug and new JAWT version will be available sometime after Panther release

meanwhile I implemented workaround to jogl mac os x  sources

I put 2 modified files here:

here is what you have to do:

1. backup your jogl.jar and libjogl.jnilib files

2. backup your from
replace old with new one from

3. backup your MacOSXWindowSystemInterface.m file from
replace old MacOSXWindowSystemInterface.m with new one from

4. remove old jogl.jar from the classpath

5. remove old libjogl.jnilib from the library path

6. remove build folder (<path_to_jogl>/build)

7. go to make folder and call ant macosx

8. wait for the few minutes

9. install jogl.jar and libjogl.jnilib into the appropriate place:
for example:  /Library/Java/Extensions or ~/Library/Java/Extensions

10. that's it

it works for me

if you will have any problem don't hesitate and send me email:

additionally you can download binaries from:

Dmitry Markman
5  Java Game APIs & Engines / JOGL Development / Re: JOGL OSX-1.1 Beta Available on: 2003-09-07 12:49:54
Here is a possible way to match java canvas and cocoa nsview
I use that technique in gl4java's MAC OS X
(JDK 1.4.1) implementation.

1. we need to find location of the canvas relative to the top frame
maybe there is a shorter way I'd be very graceful if somebody can show me that shorter way.

Component component = c;//canvas
Point globalLocation = component.getLocation();
while(!(component instanceof Frame) && component != null){
 component = component.getParent();
 if(component != null && !(component instanceof Frame)){
if(component instanceof Frame){
 Frame frame = (Frame)component;
 Insets insets = frame.getInsets();
 if(insets != null){
   globalLocation.y -= ( + insets.bottom);
   globalLocation.x -= (insets.left + insets.right);

so after that manipulation we have relative coordinate of our canvas to the top frame.

2. now we have to find NSView with the same location and size in the contentView view hierarchy
(contentView could be obtained from JAWT via cocoaViewRef)

NSView *findAppropriateView(NSView       *contentView,NSRect needRect)
     NSView *finalView = NULL;
     NSRect contentViewBound = [contentView bounds];
     int titleHeight = contentViewBound.origin.y;
     NSRect viewRect = NSOffsetRect (needRect , 0 , titleHeight);
     finalView = findSubView(contentView,contentView,viewRect);
     return finalView;

NSView *findSubView(NSView *contentView,NSView *view,NSRect viewRect){
 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 NSView *retView = nil;
  NSArray *subviews = [view subviews];
  int i=0;
  if(subviews != NULL){
    int count = [subviews count];
      for(i  = 0; i < count; i++){
       id object = [subviews objectAtIndex:i];
       if ( [object isKindOfClass:[NSView class]] ){
          NSView *subView = (NSView *)object;
          if([[subView subviews] count] == 0){
             NSRect subViewRect = [contentView convertRect : [subView frame] fromView : [subView superview]];
                retView = subView;
            if(retView != nil) break;
  [pool release];
  return retView;

NSRect GetViewRect(JNIEnv *env,jobject component,int xoffset,int yoffset)
     NSRect viewRect;
     Rect      compBound;
     GetComponentBounds(env, component,&compBound);
     OffsetRect(&compBound, xoffset - compBound.left, yoffset -;
     viewRect = NSMakeRect(compBound.left,,compBound.right - compBound.left,compBound.bottom -;
     return viewRect;

void GetComponentBounds(JNIEnv *env, jobject component,Rect *rect){
if(env == NULL || component == NULL) return;
rect->left = rect->top = rect->right = rect->bottom = 0;
jclass clazz = (*env)->GetObjectClass(env,component);
if(clazz == NULL) return;
jmethodID mID = (*env)->GetMethodID(env,clazz,"getBounds",JRISigMethod(JRISigNoArgs) JRISigClass("java/awt/Rectangle"));
if(mID == 0) return;
jobject rectangle = (*env)->CallObjectMethod(env,component,mID);
if(rectangle != NULL){
     int width = 0,height = 0;
     jclass rclazz = (*env)->GetObjectClass(env,rectangle);
     if(rclazz == NULL) return;
     jfieldID fieldID = (*env)->GetFieldID(env,rclazz,"x",JRISigInt);
     if(fieldID != NULL){
           rect->left = (short)(*env)->GetIntField(env,rectangle,fieldID);
     fieldID = (*env)->GetFieldID(env,rclazz,"y",JRISigInt);
     if(fieldID != NULL){
           rect->top = (short)(*env)->GetIntField(env,rectangle,fieldID);
     fieldID = (*env)->GetFieldID(env,rclazz,"width",JRISigInt);
     if(fieldID != NULL){
           width = (short)(*env)->GetIntField(env,rectangle,fieldID);
     fieldID = (*env)->GetFieldID(env,rclazz,"height",JRISigInt);
     if(fieldID != NULL){
           height = (short)(*env)->GetIntField(env,rectangle,fieldID);
     rect->right = rect->left + width;
     rect->bottom = rect->top + height;
6  Java Game APIs & Engines / JOGL Development / Re: JOGL OSX-1.1 Beta Available on: 2003-09-07 04:28:43
Hi, Gregory
1. what is relation between your OSX-1.1 beta
and binaries I downloaded from

is it the same?

2. is it possible to share jogl GLCanvas with others
AWT components on the same frame?
I have a bad feelings that currently it's impossible
(I looked at the sources and jogl uses NSView * from
JAWT structure, but as far as I know (at least in recent 10.3 build) that NSView is all content view, not view related to java canvas


Dmitry Markman
Pages: [1]

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Archive (25 views)
2015-01-29 04:26:08

theagentd (22 views)
2015-01-28 15:33:52

GamerIDGoesHere (32 views)
2015-01-27 01:23:23

GamerIDGoesHere (33 views)
2015-01-27 01:22:15

CopyableCougar4 (40 views)
2015-01-27 00:34:41

CopyableCougar4 (28 views)
2015-01-26 04:47:56

Olo (19 views)
2015-01-25 21:26:00

Olo (26 views)
2015-01-25 18:44:22

Robo11 (43 views)
2015-01-25 06:14:26

basil_ (34 views)
2015-01-17 22:29:32
2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!