73 * Makes the given context current to its associated "scratch" surface. If
74 * the operation is successful, this method will return JNI_TRUE; otherwise,
75 * returns JNI_FALSE.
76 */
77 static jboolean
78 CGLSD_MakeCurrentToScratch(JNIEnv *env, OGLContext *oglc)
79 {
80 J2dTraceLn(J2D_TRACE_INFO, "CGLSD_MakeCurrentToScratch");
81
82 if (oglc == NULL) {
83 J2dRlsTraceLn(J2D_TRACE_ERROR,
84 "CGLSD_MakeCurrentToScratch: context is null");
85 return JNI_FALSE;
86 }
87
88 JNF_COCOA_ENTER(env);
89
90 CGLCtxInfo *ctxinfo = (CGLCtxInfo *)oglc->ctxInfo;
91 #if USE_NSVIEW_FOR_SCRATCH
92 [ctxinfo->context makeCurrentContext];
93 [ctxinfo->context setView: ctxinfo->scratchSurface];
94 #else
95 [ctxinfo->context clearDrawable];
96 [ctxinfo->context makeCurrentContext];
97 [ctxinfo->context setPixelBuffer: ctxinfo->scratchSurface
98 cubeMapFace: 0
99 mipMapLevel: 0
100 currentVirtualScreen: [ctxinfo->context currentVirtualScreen]];
101 #endif
102
103 JNF_COCOA_EXIT(env);
104
105 return JNI_TRUE;
106 }
107
108 /**
109 * This function disposes of any native windowing system resources associated
110 * with this surface.
111 */
112 void
113 OGLSD_DestroyOGLSurface(JNIEnv *env, OGLSDOps *oglsdo)
|
73 * Makes the given context current to its associated "scratch" surface. If
74 * the operation is successful, this method will return JNI_TRUE; otherwise,
75 * returns JNI_FALSE.
76 */
77 static jboolean
78 CGLSD_MakeCurrentToScratch(JNIEnv *env, OGLContext *oglc)
79 {
80 J2dTraceLn(J2D_TRACE_INFO, "CGLSD_MakeCurrentToScratch");
81
82 if (oglc == NULL) {
83 J2dRlsTraceLn(J2D_TRACE_ERROR,
84 "CGLSD_MakeCurrentToScratch: context is null");
85 return JNI_FALSE;
86 }
87
88 JNF_COCOA_ENTER(env);
89
90 CGLCtxInfo *ctxinfo = (CGLCtxInfo *)oglc->ctxInfo;
91 #if USE_NSVIEW_FOR_SCRATCH
92 [ctxinfo->context makeCurrentContext];
93 #else
94 [ctxinfo->context clearDrawable];
95 [ctxinfo->context makeCurrentContext];
96 [ctxinfo->context setPixelBuffer: ctxinfo->scratchSurface
97 cubeMapFace: 0
98 mipMapLevel: 0
99 currentVirtualScreen: [ctxinfo->context currentVirtualScreen]];
100 #endif
101
102 JNF_COCOA_EXIT(env);
103
104 return JNI_TRUE;
105 }
106
107 /**
108 * This function disposes of any native windowing system resources associated
109 * with this surface.
110 */
111 void
112 OGLSD_DestroyOGLSurface(JNIEnv *env, OGLSDOps *oglsdo)
|