From d61172410c71852218a10173c0939f8e84bd573e Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 22 Oct 2003 12:38:24 +0000 Subject: [PATCH] *** empty log message *** --- .../macosx/org_lwjgl_opengl_Pbuffer.cpp | 43 ++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/src/native/macosx/org_lwjgl_opengl_Pbuffer.cpp b/src/native/macosx/org_lwjgl_opengl_Pbuffer.cpp index abb212c7..98d2510b 100644 --- a/src/native/macosx/org_lwjgl_opengl_Pbuffer.cpp +++ b/src/native/macosx/org_lwjgl_opengl_Pbuffer.cpp @@ -41,17 +41,58 @@ #include "org_lwjgl_opengl_Pbuffer.h" #include "extgl.h" +#include JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_Pbuffer_nIsBufferLost(JNIEnv *env, jclass clazz, jint handle) { return JNI_FALSE; } JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Pbuffer_getPbufferCaps(JNIEnv *env, jclass clazz) { - //return org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED : 0; +/* CGLRendererInfoObj renderers; + long num_renderers; + CGLError err = CGLQueryRendererInfo(~0L, &renderers, &num_renderers); + if (err) + return 0; + int result = 0; + for (long i = 0; i < num_renderers; i++) { + long pbuffer_supported; + err = CGLDescribeRenderer(renderers, i, kCGLRPOffScreen, &pbuffer_supported); + if (!err && pbuffer_supported == true) + result = org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED; + } + CGLDestroyRendererInfo(renderers); + return result;*/ return 0; } JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Pbuffer_nCreate(JNIEnv *env, jclass clazz, jint width, jint height, jint bpp, jint alpha, jint depth, jint stencil) { +/* CGLPixelFormatObj pixel_format; + CGLContextObj context; + int dummy; + CGLPixelFormatAttribute attribs[] = {kCGLPFAOffScreen, + kCGLPFAMinimumPolicy, + kCGLPFAColorSize, + (CGLPixelFormatAttribute)bpp, + kCGLPFAAlphaSize, + (CGLPixelFormatAttribute)alpha, + kCGLPFADepthSize, + (CGLPixelFormatAttribute)depth, + kCGLPFAStencilSize, + (CGLPixelFormatAttribute)stencil, + (CGLPixelFormatAttribute)NULL}; + CGLChoosePixelFormat(attribs, &pixel_format, &dummy); + if (pixel_format == NULL) { + throwException(env, "Could not find matching pixel format"); + return -1; + } + CGLCreateContext(pixel_format, NULL, &context); + CGLDestroyPixelFormat(pixel_format); + if (context == NULL) { + throwException(env, "Could not create offscreen context"); + return -1; + } + CGLSetOffscreen(*/ + return -1; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nReleaseContext(JNIEnv *env, jclass clazz) {