Content deleted Content added
m Bringing "External links", "See also" and "Reference" sections in line with the Manual of Style. |
|||
Line 1:
The [[Java Native Interface]] enabled Developers to add platform-dependant functionality to Java Applications. It enables developers to add things like time-critical operations like mathematical calculations and 3-D Rendering. 3-D Rendering is interesting, because the native side don't know where to draw the graphics! The AWT Native Interface is designed to give developers a sort of a "canvas" for their native programs to "draw" on. In fact, the Java 3D API (Extension to the standard J2SE JDK) relies heavily on the AWT Native Interface to render 3D objects in Java! The AWT Native Interface is very similar to the JNI, and, the steps are, in fact, the same as those of the JNI. So, it is highly recommended that you read the [[Java Native Interface]] article first before continuing.
Line 16 ⟶ 15:
System.loadLibrary("NativeSideCanvas");
}
public native void paint(Graphics g);
Line 100 ⟶ 99:
jboolean result;
jint lock;
// Get the AWT
awt.version = JAWT_VERSION_1_3;
result = JAWT_GetAWT(env, &awt);
assert(result != JNI_FALSE);
// Get the drawing surface
ds = awt.GetDrawingSurface(env, canvas);
assert(ds != NULL);
// Lock the drawing surface
lock = ds->Lock(ds);
assert((lock & JAWT_LOCK_ERROR) == 0);
// Get the drawing surface info
dsi = ds->GetDrawingSurfaceInfo(ds);
// Get the platform-specific drawing info
dsi_win = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo;
Line 162 ⟶ 161:
Java Native Interface (Wikipedia Article)
*http://en.wikipedia.org/wiki/Java_Native_Interface
[[Category:Java platform]]
|