Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  JOGL OSX-1.1 Beta Available  (Read 1138 times)
0 Members and 1 Guest are viewing this topic.
Offline gregorypierce

JGO Strike Force
***

Posts: 905


I come upon thee like the blue screen of death....


« on: 2003-09-03 20:23:11 »

Note that this is NOT an official release, but seeing as the Sun folks are still trying to get OSX into the official build engine I am providing a link to the current OSX beta version until it ends up on the site.

Disclaimer: This is not from Sun, it comes from me. I have not had any trouble with it but it may format your drive, fry your mother board, enslave the human race, or do other funky unwelcome things. Use at your own risk. I can only confirm that this release works on 10.3 using the latest seeds available from Apple. If you find a bug or it crashes a lot - NOTIFY APPLE using bug reporter.

http://www.gregorypierce.com/jogl/jogl_osx_1.1_beta.zip


http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline gregorypierce

JGO Strike Force
***

Posts: 905


I come upon thee like the blue screen of death....


« Reply #1 on: 2003-09-03 20:37:28 »

Note to the Sun folks that this built without modification to the build.xml file so please update the cruise control profile to generate the OSX nightly build.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline shawnkendall

JGO Ninja
***

Posts: 691
Medals: 2


Apathy Error: Don't bother striking any key.


« Reply #2 on: 2003-09-04 19:30:49 »

Awesome!
We just got a G5 on order and will be doing plenty of JOGL/JOAL testing soon.
Great job gregorypierce!

Shawn Kendall
Full Sail Real World Education
Immediate Mode Interactive, LLC
<A HREF="http://cosmic-game-engine.blogspot.com/">Cosmic Game Engine Dev Journal</a>
Games published by our own members! Go get 'em!
Offline albanc

JGO n00b
*

Posts: 40



« Reply #3 on: 2003-09-05 08:39:47 »

Greg,

You forgot to put a link to the MacOSX 10.3 developer previex CD ISO that should come with JoGL  Grin
Offline gregorypierce

JGO Strike Force
***

Posts: 905


I come upon thee like the blue screen of death....


« Reply #4 on: 2003-09-05 09:34:08 »

Ah you're right - you can get to it here  Wink

https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/201/wo/k1Ld980mjYFi34vLd0A2Lq6XqXN/0.0

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline albanc

JGO n00b
*

Posts: 40



« Reply #5 on: 2003-09-06 02:33:57 »

Is it any serious ?
Your link reports your session is expired and ADC requires an apple Developer ID to login, so it won't be useful to people on the forums.
While I've been registered for monthes to the ADC, I never saw any link to a MacOSX 10.3 developer preview CD.
So, if you're any serious, where in the ADC website does your link point ? Darwin codebase ?
Offline gregorypierce

JGO Strike Force
***

Posts: 905


I come upon thee like the blue screen of death....


« Reply #6 on: 2003-09-06 22:40:09 »

No it was a joke. To get the seed you must be a registered ADC member and be ponying up cash for the select membership.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline dimamarkman

JGO n00b
*

Posts: 6


Java games rock!


« Reply #7 on: 2003-09-07 00:28:43 »

Hi, Gregory
1. what is relation between your OSX-1.1 beta
and binaries I downloaded from https://jogl.dev.java.net/files/documents/27/948/jogl-macosx.tar.gz

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

thanks

Dmitry Markman
Offline dimamarkman

JGO n00b
*

Posts: 6


Java games rock!


« Reply #8 on: 2003-09-07 08: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)){
   globalLocation.x+=component.getLocation().x;
   globalLocation.y+=component.getLocation().y;
 }
}
if(component instanceof Frame){
 Frame frame = (Frame)component;
 Insets insets = frame.getInsets();
 if(insets != null){
   globalLocation.y -= (insets.top + 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]];
             if(NSEqualRects(subViewRect,viewRect)){
                retView = subView;
             }
            }else{
              retView=findSubView(contentView,subView,viewRect);
            }
            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 - compBound.top);
     viewRect = NSMakeRect(compBound.left,compBound.top,compBound.right - compBound.left,compBound.bottom - compBound.top);
     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;
}
}
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.112 seconds with 21 queries.