You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
1
(5) |
2
(5) |
3
(1) |
4
(1) |
5
(5) |
6
|
|
7
(22) |
8
(2) |
9
(10) |
10
(5) |
11
(5) |
12
(1) |
13
|
|
14
|
15
(2) |
16
|
17
|
18
(2) |
19
|
20
|
|
21
(13) |
22
(4) |
23
(3) |
24
(14) |
25
(6) |
26
(26) |
27
(26) |
|
28
(2) |
29
(13) |
30
(17) |
31
(2) |
|
|
|
|
From: <sp...@us...> - 2004-03-02 02:18:50
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4151 Modified Files: org_lwjgl_opengl_Pbuffer.cpp Log Message: render-to-texture support Index: org_lwjgl_opengl_Pbuffer.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Pbuffer.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- org_lwjgl_opengl_Pbuffer.cpp 15 Feb 2004 19:24:03 -0000 1.6 +++ org_lwjgl_opengl_Pbuffer.cpp 2 Mar 2004 01:59:32 -0000 1.7 @@ -1,35 +1,35 @@ -/* +/* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are + * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * * Neither the name of 'Light Weight Java Game Library' nor the names of - * its contributors may be used to endorse or promote products derived + * * Neither the name of 'Light Weight Java Game Library' nor the names of + * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + /** * $Id$ * @@ -47,8 +47,6 @@ #include "common_tools.h" - - typedef struct _PbufferInfo { HGLRC Pbuffer_context; @@ -59,8 +57,6 @@ } PbufferInfo; - - /* * Class: org_lwjgl_opengl_Pbuffer * Method: isPbufferSupported @@ -69,22 +65,37 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Pbuffer_getPbufferCaps (JNIEnv *env, jclass clazz) { - bool supported = extgl_Extensions.WGL_ARB_pixel_format && extgl_Extensions.WGL_ARB_pbuffer; - return supported ? org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED : 0; + int caps = 0; + + if ( extgl_Extensions.WGL_ARB_pixel_format && extgl_Extensions.WGL_ARB_pbuffer ) + caps |= org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED; + + if ( extgl_Extensions.WGL_ARB_render_texture ) + caps |= org_lwjgl_opengl_Pbuffer_RENDER_TEXTURE_SUPPORTED; + + if ( extgl_Extensions.WGL_NV_render_texture_rectangle ) + caps |= org_lwjgl_opengl_Pbuffer_RENDER_TEXTURE_RECTANGLE_SUPPORTED; + + if ( extgl_Extensions.WGL_NV_render_depth_texture ) + caps |= org_lwjgl_opengl_Pbuffer_RENDER_DEPTH_TEXTURE_SUPPORTED; + + return caps; } /* * Class: org_lwjgl_opengl_Pbuffer * Method: nCreate - * Signature: (IIII)I */ 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, jint samples) + (JNIEnv *env, jclass clazz, + jint width, jint height, + jint bpp, jint alpha, jint depth, jint stencil, + jint samples, + jobject pixelFormatCaps, jint pixelFormatCapsSize, jobject pBufferAttribs, jint pBufferAttribsSize) { - int iPixelFormat; unsigned int num_formats_returned; - int attrib_list[] = {WGL_DRAW_TO_PBUFFER_ARB, TRUE, + int pixelAttribList[] = {WGL_DRAW_TO_PBUFFER_ARB, TRUE, WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB, WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB, WGL_DOUBLE_BUFFER_ARB, FALSE, @@ -95,25 +106,59 @@ WGL_STENCIL_BITS_ARB, stencil, 0, 0, /* For ARB_multisample */ 0, 0, /* */ + 0, 0, /* For WGL_ARB_render_texture */ + 0, 0, /* */ 0}; if (samples > 0 && extgl_Extensions.WGL_ARB_multisample) { - attrib_list[18] = WGL_SAMPLE_BUFFERS_ARB; - attrib_list[19] = 1; - attrib_list[20] = WGL_SAMPLES_ARB; - attrib_list[21] = samples; + pixelAttribList[18] = WGL_SAMPLE_BUFFERS_ARB; + pixelAttribList[19] = 1; + pixelAttribList[20] = WGL_SAMPLES_ARB; + pixelAttribList[21] = samples; } - BOOL result = wglChoosePixelFormatARB(hdc, attrib_list, NULL, 1, &iPixelFormat, &num_formats_returned); + + if ( pixelFormatCaps != NULL ) { + if ( !extgl_Extensions.WGL_ARB_render_texture ) { + throwException(env, "The render-to-texture extension is not supported."); + return (jint)NULL; + } + + GLuint *pixelFormatCaps_ptr = (GLuint *)env->GetDirectBufferAddress(pixelFormatCaps); + + for ( int i = 0; i < pixelFormatCapsSize; ) + pixelAttribList[22 + i++] = pixelFormatCaps_ptr[i]; + } + + BOOL result = wglChoosePixelFormatARB(hdc, pixelAttribList, NULL, 1, &iPixelFormat, &num_formats_returned); if (result == FALSE || num_formats_returned < 1) { throwException(env, "Could not choose pixel formats."); return (jint)NULL; } - HPBUFFERARB Pbuffer = wglCreatePbufferARB(hdc, iPixelFormat, width, height, NULL); + + HPBUFFERARB Pbuffer; + + if ( pBufferAttribs != NULL ) { + GLuint *pBufferAttribs_ptr = (GLuint *)env->GetDirectBufferAddress(pBufferAttribs); + + int pBufferAttribList[9]; + + int i; + for ( i = 0; i < pBufferAttribsSize; ) + pBufferAttribList[i++] = pBufferAttribs_ptr[i]; + + pBufferAttribList[i] = 0; + + Pbuffer = wglCreatePbufferARB(hdc, iPixelFormat, width, height, pBufferAttribList); + } else { + Pbuffer = wglCreatePbufferARB(hdc, iPixelFormat, width, height, NULL); + } + if (Pbuffer == NULL) { throwException(env, "Could not create Pbuffer."); return (jint)NULL; } + HDC Pbuffer_dc = wglGetPbufferDCARB(Pbuffer); if (Pbuffer_dc == NULL) { wglDestroyPbufferARB(Pbuffer); @@ -129,6 +174,7 @@ throwException(env, "Failed to create Pbuffer rendering context"); return (jint)NULL; } + if (!wglShareLists(hglrc, Pbuffer_context)) { wglDeleteContext(Pbuffer_context); wglReleasePbufferDCARB(Pbuffer, Pbuffer_dc); @@ -137,10 +183,12 @@ return (jint)NULL; } + PbufferInfo *Pbuffer_info = (PbufferInfo *)malloc(sizeof(PbufferInfo)); Pbuffer_info->Pbuffer = Pbuffer; Pbuffer_info->Pbuffer_context = Pbuffer_context; Pbuffer_info->Pbuffer_dc = Pbuffer_dc; + return (jint)Pbuffer_info; } @@ -175,3 +223,31 @@ wglDestroyPbufferARB(Pbuffer_info->Pbuffer); free(Pbuffer_info); } + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nSetAttrib + (JNIEnv *env, jclass clazz, jint handle, jint attrib, jint value) +{ + PbufferInfo *Pbuffer_info = (PbufferInfo *)handle; + + int attribs[3]; + + attribs[0] = attrib; + attribs[1] = value; + attribs[2] = 0; + + wglSetPbufferAttribARB(Pbuffer_info->Pbuffer, attribs); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nBindTexImage + (JNIEnv *env, jclass clazz, jint handle, jint buffer) +{ + PbufferInfo *Pbuffer_info = (PbufferInfo *)handle; + wglBindTexImageARB(Pbuffer_info->Pbuffer, buffer); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nReleaseTexImage + (JNIEnv *env, jclass clazz, jint handle, jint buffer) +{ + PbufferInfo *Pbuffer_info = (PbufferInfo *)handle; + wglReleaseTexImageARB(Pbuffer_info->Pbuffer, buffer); +} |
|
From: <sp...@us...> - 2004-03-02 02:18:23
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4075 Modified Files: org_lwjgl_opengl_Pbuffer.cpp Log Message: render-to-texture support Index: org_lwjgl_opengl_Pbuffer.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Pbuffer.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_opengl_Pbuffer.cpp 15 Feb 2004 15:46:10 -0000 1.3 +++ org_lwjgl_opengl_Pbuffer.cpp 2 Mar 2004 01:59:06 -0000 1.4 @@ -1,35 +1,35 @@ -/* +/* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are + * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * * Neither the name of 'Light Weight Java Game Library' nor the names of - * its contributors may be used to endorse or promote products derived + * * Neither the name of 'Light Weight Java Game Library' nor the names of + * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + /** * $Id$ * @@ -65,7 +65,17 @@ 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, jint samples) { +/* + * Class: org_lwjgl_opengl_Pbuffer + * Method: nCreate + */ +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, + jint samples, + jobject pixelFormatCaps, jint pixelFormatCapsSize, jobject pBufferAttribs, jint pBufferAttribsSize) +{ /* CGLPixelFormatObj pixel_format; CGLContextObj context; int dummy; @@ -103,3 +113,21 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nDestroy(JNIEnv *env, jclass clazz, jint handle) { } + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nSetAttrib + (JNIEnv *env, jclass clazz, jint handle, jint attrib, jint value) +{ + throwException(env, "The render-to-texture extension is not supported."); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nBindTexImage + (JNIEnv *env, jclass clazz, jint handle, jint buffer) +{ + throwException(env, "The render-to-texture extension is not supported."); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nReleaseTexImage + (JNIEnv *env, jclass clazz, jint handle, jint buffer) +{ + throwException(env, "The render-to-texture extension is not supported."); +} \ No newline at end of file |
|
From: <sp...@us...> - 2004-03-02 02:17:47
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3948 Modified Files: org_lwjgl_opengl_Pbuffer.cpp Log Message: render-to-texture support Index: org_lwjgl_opengl_Pbuffer.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- org_lwjgl_opengl_Pbuffer.cpp 18 Feb 2004 17:48:26 -0000 1.9 +++ org_lwjgl_opengl_Pbuffer.cpp 2 Mar 2004 01:58:29 -0000 1.10 @@ -77,11 +77,15 @@ /* * Class: org_lwjgl_opengl_Pbuffer * Method: nCreate - * Signature: (IIII)I */ 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, jint samples) + (JNIEnv *env, jclass clazz, + jint width, jint height, + jint bpp, jint alpha, jint depth, jint stencil, + jint samples, + jobject pixelFormatCaps, jint pixelFormatCapsSize, jobject pBufferAttribs, jint pBufferAttribsSize) { + int bpe = convertToBPE(bpp); int attrib_list[] = {GLX_RENDER_TYPE, GLX_RGBA_BIT, GLX_DOUBLEBUFFER, False, @@ -177,3 +181,21 @@ glXDestroyContext(getCurrentDisplay(), context); free(buffer_info); } + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nSetAttrib + (JNIEnv *env, jclass clazz, jint handle, jint attrib, jint value) +{ + throwException(env, "The render-to-texture extension is not supported."); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nBindTexImage + (JNIEnv *env, jclass clazz, jint handle, jint buffer) +{ + throwException(env, "The render-to-texture extension is not supported."); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nReleaseTexImage + (JNIEnv *env, jclass clazz, jint handle, jint buffer) +{ + throwException(env, "The render-to-texture extension is not supported."); +} \ No newline at end of file |
|
From: <sp...@us...> - 2004-03-02 02:16:56
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3814 Modified Files: org_lwjgl_opengl_Pbuffer.h Log Message: render-to-texture support Index: org_lwjgl_opengl_Pbuffer.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_Pbuffer.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- org_lwjgl_opengl_Pbuffer.h 18 Feb 2004 17:48:26 -0000 1.4 +++ org_lwjgl_opengl_Pbuffer.h 2 Mar 2004 01:57:38 -0000 1.5 @@ -8,7 +8,17 @@ extern "C" { #endif #undef org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED -#define org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED 1L +#define org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED 1 << 0 + +#undef org_lwjgl_opengl_Pbuffer_RENDER_TEXTURE_SUPPORTED +#define org_lwjgl_opengl_Pbuffer_RENDER_TEXTURE_SUPPORTED 1 << 1 + +#undef org_lwjgl_opengl_Pbuffer_RENDER_TEXTURE_RECTANGLE_SUPPORTED +#define org_lwjgl_opengl_Pbuffer_RENDER_TEXTURE_RECTANGLE_SUPPORTED 1 << 2 + +#undef org_lwjgl_opengl_Pbuffer_RENDER_DEPTH_TEXTURE_SUPPORTED +#define org_lwjgl_opengl_Pbuffer_RENDER_DEPTH_TEXTURE_SUPPORTED 1 << 3 + /* Inaccessible static: currentBuffer */ /* * Class: org_lwjgl_opengl_Pbuffer @@ -37,10 +47,9 @@ /* * Class: org_lwjgl_opengl_Pbuffer * Method: nCreate - * Signature: (IIIIIII)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Pbuffer_nCreate - (JNIEnv *, jclass, jint, jint, jint, jint, jint, jint, jint); + (JNIEnv *, jclass, jint, jint, jint, jint, jint, jint, jint, jobject, jint, jobject, jint); /* * Class: org_lwjgl_opengl_Pbuffer @@ -50,6 +59,30 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nDestroy (JNIEnv *, jclass, jint); +/* + * Class: org_lwjgl_opengl_Pbuffer + * Method: nSetAttrib + * Signature: (III)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nSetAttrib + (JNIEnv *, jclass, jint, jint, jint); + +/* + * Class: org_lwjgl_opengl_Pbuffer + * Method: nBindTexImage + * Signature: (III)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nBindTexImage + (JNIEnv *, jclass, jint, jint); + +/* + * Class: org_lwjgl_opengl_Pbuffer + * Method: nReleaseTexImage + * Signature: (III)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nReleaseTexImage + (JNIEnv *, jclass, jint, jint); + #ifdef __cplusplus } #endif |
|
From: <sp...@us...> - 2004-03-02 02:16:20
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3686 Modified Files: Pbuffer.java Added Files: RenderTexture.java Log Message: render-to-texture support --- NEW FILE: RenderTexture.java --- /* * Copyright (c) 2002 Lightweight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * Created by LWJGL. * User: spasi * Date: 2004-03-01 * Time: 23:24:38 */ package org.lwjgl.opengl; import org.lwjgl.BufferUtils; import java.nio.IntBuffer; /** * This class represents the state necessary for render-to-texture. */ public final class RenderTexture { // ---------------------------------------------------------------------------------- // ----------------------------- WGL_ARB_render_texture ----------------------------- // ---------------------------------------------------------------------------------- /* Accepted by the <piAttributes> parameter of wglGetPixelFormatAttribivARB, wglGetPixelFormatAttribfvARB, and the <piAttribIList> and <pfAttribIList> parameters of wglChoosePixelFormatARB: */ private static final int WGL_BIND_TO_TEXTURE_RGB_ARB = 0x2070; private static final int WGL_BIND_TO_TEXTURE_RGBA_ARB = 0x2071; /* Accepted by the <piAttribList> parameter of wglCreatePbufferARB and by the <iAttribute> parameter of wglQueryPbufferARB: */ private static final int WGL_TEXTURE_FORMAT_ARB = 0x2072; private static final int WGL_TEXTURE_TARGET_ARB = 0x2073; private static final int WGL_MIPMAP_TEXTURE_ARB = 0x2074; /* Accepted as a value in the <piAttribList> parameter of wglCreatePbufferARB and returned in the value parameter of wglQueryPbufferARB when <iAttribute> is WGL_TEXTURE_FORMAT_ARB: */ private static final int WGL_TEXTURE_RGB_ARB = 0x2075; private static final int WGL_TEXTURE_RGBA_ARB = 0x2076; /* Accepted as a value in the <piAttribList> parameter of wglCreatePbufferARB and returned in the value parameter of wglQueryPbufferARB when <iAttribute> is WGL_TEXTURE_TARGET_ARB: */ private static final int WGL_TEXTURE_CUBE_MAP_ARB = 0x2078; private static final int WGL_TEXTURE_1D_ARB = 0x2079; private static final int WGL_TEXTURE_2D_ARB = 0x207A; private static final int WGL_NO_TEXTURE_ARB = 0x2077; /* Accepted by the <piAttribList> parameter of wglSetPbufferAttribARB and by the <iAttribute> parameter of wglQueryPbufferARB: */ static final int WGL_MIPMAP_LEVEL_ARB = 0x207B; static final int WGL_CUBE_MAP_FACE_ARB = 0x207C; /* Accepted as a value in the <piAttribList> parameter of wglSetPbufferAttribARB and returned in the value parameter of wglQueryPbufferARB when <iAttribute> is WGL_CUBE_MAP_FACE_ARB: */ static final int WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x207D; static final int WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x207E; static final int WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x207F; static final int WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x2080; static final int WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x2081; static final int WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x2082; /* Accepted by the <iBuffer> parameter of wglBindTexImageARB and wglReleaseTexImageARB: */ static final int WGL_FRONT_LEFT_ARB = 0x2083; static final int WGL_FRONT_RIGHT_ARB = 0x2084; static final int WGL_BACK_LEFT_ARB = 0x2085; static final int WGL_BACK_RIGHT_ARB = 0x2086; /* private static final int WGL_AUX0_ARB = 0x2087; private static final int WGL_AUX1_ARB = 0x2088; private static final int WGL_AUX2_ARB = 0x2089; private static final int WGL_AUX3_ARB = 0x208A; private static final int WGL_AUX4_ARB = 0x208B; private static final int WGL_AUX5_ARB = 0x208C; private static final int WGL_AUX6_ARB = 0x208D; private static final int WGL_AUX7_ARB = 0x208E; private static final int WGL_AUX8_ARB = 0x208F; private static final int WGL_AUX9_ARB = 0x2090; */ // ------------------------------------------------------------------------------------------- // ----------------------------- WGL_NV_render_texture_rectangle ----------------------------- // ------------------------------------------------------------------------------------------- /* Accepted by the <piAttributes> parameter of wglGetPixelFormatAttribivARB, wglGetPixelFormatAttribfvARB, and the <piAttribIList> and <pfAttribIList> parameters of wglChoosePixelFormatARB: */ private static final int WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV = 0x20A0; private static final int WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV = 0x20A1; /* Accepted as a value in the <piAttribList> parameter of wglCreatePbufferARB and returned in the value parameter of wglQueryPbufferARB when <iAttribute> is WGL_TEXTURE_TARGET_ARB: */ private static final int WGL_TEXTURE_RECTANGLE_NV = 0x20A2; // --------------------------------------------------------------------------------------- // ----------------------------- WGL_NV_render_depth_texture ----------------------------- // --------------------------------------------------------------------------------------- /* Accepted by the <piAttributes> parameter of wglGetPixelFormatAttribivARB, wglGetPixelFormatAttribfvARB, and the <piAttribIList> and <pfAttribIList> parameters of wglChoosePixelFormatARB: */ private static final int WGL_BIND_TO_TEXTURE_DEPTH_NV = 0x20A3; private static final int WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV = 0x20A4; /* Accepted by the <piAttribList> parameter of wglCreatePbufferARB and by the <iAttribute> parameter of wglQueryPbufferARB: */ private static final int WGL_DEPTH_TEXTURE_FORMAT_NV = 0x20A5; /* Accepted as a value in the <piAttribList> parameter of wglCreatePbufferARB and returned in the value parameter of wglQueryPbufferARB when <iAttribute> is WGL_DEPTH_TEXTURE_FORMAT_NV: */ private static final int WGL_TEXTURE_DEPTH_COMPONENT_NV = 0x20A6; /* Accepted by the <iBuffer> parameter of wglBindTexImageARB: */ static final int WGL_DEPTH_COMPONENT_NV = 0x20A7; /** * The TEXTURE_1D target. */ public static final int RENDER_TEXTURE_1D = WGL_TEXTURE_1D_ARB; /** * The TEXTURE_2D target. */ public static final int RENDER_TEXTURE_2D = WGL_TEXTURE_2D_ARB; /** * The TEXTURE_RECTANGLE target. */ public static final int RENDER_TEXTURE_RECTANGLE = WGL_TEXTURE_RECTANGLE_NV; /** * The TEXTURE_CUBE_MAP target. */ public static final int RENDER_TEXTURE_CUBE_MAP = WGL_TEXTURE_CUBE_MAP_ARB; IntBuffer pixelFormatCaps; IntBuffer pBufferAttribs; /** * Creates a RenderTexture object for enabling render-to-texture on a P-buffer. * <p/> * NOTE: Only one of useRGB and useRGBA can be true at the same time. * <p/> * NOTE: useRGB(A) and useDepth can be true at the same time, thus allowing two different render textures. * <p/> * NOTE: The target parameter can be one of the following: * <p/> * RENDER_TEXTURE_1D * RENDER_TEXTURE_2D * RENDER_TEXTURE_RECTANGLE * RENDER_TEXTURE_CUBE_MAP * * @param useRGB - When true the P-buffer can be used as an RGB render texture. * @param useRGBA - When true the P-buffer can be used as an RGBA render texture. * @param useDepth - When true the P-buffer can be used as a depth render texture. * @param isRectangle - When true rectangle textures will be allowed on the P-buffer. * @param target - The texture target of the render texture. * @param mipmaps - How many mipmap levels to allocate on the P-buffer. */ public RenderTexture(boolean useRGB, boolean useRGBA, boolean useDepth, boolean isRectangle, int target, int mipmaps) { if ( useRGB && useRGBA ) throw new IllegalArgumentException("A RenderTexture can't be both RGB and RGBA."); if ( mipmaps < 0 ) throw new IllegalArgumentException("The mipmap levels can't be negative."); if ( isRectangle && target != RENDER_TEXTURE_RECTANGLE ) throw new IllegalArgumentException("When the RenderTexture is rectangle the target must be RENDER_TEXTURE_RECTANGLE."); pixelFormatCaps = BufferUtils.createIntBuffer(4); pBufferAttribs = BufferUtils.createIntBuffer(8); if ( useRGB ) { pixelFormatCaps.put(isRectangle ? WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV : WGL_BIND_TO_TEXTURE_RGB_ARB); pixelFormatCaps.put(GL11.GL_TRUE); pBufferAttribs.put(WGL_TEXTURE_FORMAT_ARB); pBufferAttribs.put(WGL_TEXTURE_RGB_ARB); } else if ( useRGBA ) { pixelFormatCaps.put(isRectangle ? WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV : WGL_BIND_TO_TEXTURE_RGBA_ARB); pixelFormatCaps.put(GL11.GL_TRUE); pBufferAttribs.put(WGL_TEXTURE_FORMAT_ARB); pBufferAttribs.put(WGL_TEXTURE_RGBA_ARB); } if ( useDepth ) { pixelFormatCaps.put(isRectangle ? WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV : WGL_BIND_TO_TEXTURE_DEPTH_NV); pixelFormatCaps.put(GL11.GL_TRUE); pBufferAttribs.put(WGL_DEPTH_TEXTURE_FORMAT_NV); pBufferAttribs.put(WGL_TEXTURE_DEPTH_COMPONENT_NV); } pBufferAttribs.put(WGL_TEXTURE_TARGET_ARB); pBufferAttribs.put(target); if ( mipmaps != 0 ) { pBufferAttribs.put(WGL_MIPMAP_TEXTURE_ARB); pBufferAttribs.put(mipmaps); } pixelFormatCaps.flip(); pBufferAttribs.flip(); } } Index: Pbuffer.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Pbuffer.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Pbuffer.java 23 Feb 2004 16:30:47 -0000 1.10 +++ Pbuffer.java 2 Mar 2004 01:57:03 -0000 1.11 @@ -34,33 +34,124 @@ import org.lwjgl.Sys; +import java.nio.IntBuffer; + /** * $Id$ - * + * <p/> * Pbuffer encapsulates an OpenGL pbuffer. - * - * Each instance of GL is only valid in the thread that creates it. - * In addition, only one instance of an OpenGL window or Pbuffer may be - * the current GL context in any one thread. To make a GL instance the - * current context, use makeCurrent(). + * <p/> + * Each instance of GL is only valid in the thread that creates it. In addition, only one instance of an OpenGL window or + * Pbuffer may be the current GL context in any one thread. To make a GL instance the current context, use makeCurrent(). * * @author elias_naur <eli...@us...> * @version $Revision$ */ public final class Pbuffer { - - public static final int PBUFFER_SUPPORTED = 1; - /** Current Pbuffer */ - private static Pbuffer currentBuffer = null; + /** + * Indicates that Pbuffers can be created. + */ + public static final int PBUFFER_SUPPORTED = 1 << 0; - /** Handle to the native GL rendering context */ + /** + * Indicates that Pbuffers can be used as render-textures. + */ + public static final int RENDER_TEXTURE_SUPPORTED = 1 << 1; + + /** + * Indicates that Pbuffers can be used as non-power-of-two render-textures. + */ + public static final int RENDER_TEXTURE_RECTANGLE_SUPPORTED = 1 << 2; + + /** + * Indicates that Pbuffers can be used as depth render-textures. + */ + public static final int RENDER_DEPTH_TEXTURE_SUPPORTED = 1 << 3; + + /** + * The render-to-texture mipmap level attribute. + */ + public static final int MIPMAP_LEVEL = RenderTexture.WGL_MIPMAP_LEVEL_ARB; + + /** + * The render-to-texture cube map face attribute. + */ + public static final int CUBE_MAP_FACE = RenderTexture.WGL_CUBE_MAP_FACE_ARB; + + /** + * The render-to-texture cube map positive X face value. + */ + public static final int TEXTURE_CUBE_MAP_POSITIVE_X = RenderTexture.WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB; + + /** + * The render-to-texture cube map negative X face value. + */ + public static final int TEXTURE_CUBE_MAP_NEGATIVE_X = RenderTexture.WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB; + + /** + * The render-to-texture cube map positive Y face value. + */ + public static final int TEXTURE_CUBE_MAP_POSITIVE_Y = RenderTexture.WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB; + + /** + * The render-to-texture cube map negative Y face value. + */ + public static final int TEXTURE_CUBE_MAP_NEGATIVE_Y = RenderTexture.WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB; + + /** + * The render-to-texture cube map positive Z face value. + */ + public static final int TEXTURE_CUBE_MAP_POSITIVE_Z = RenderTexture.WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB; + + /** + * The render-to-texture cube map negative Z face value. + */ + public static final int TEXTURE_CUBE_MAP_NEGATIVE_Z = RenderTexture.WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB; + + /** + * The Pbuffer front left buffer. + */ + public static final int FRONT_LEFT_BUFFER = RenderTexture.WGL_FRONT_LEFT_ARB; + + /** + * The Pbuffer front right buffer. + */ + public static final int FRONT_RIGHT_BUFFER = RenderTexture.WGL_FRONT_RIGHT_ARB; + + /** + * The Pbuffer back left buffer. + */ + public static final int BACK_LEFT_BUFFER = RenderTexture.WGL_BACK_LEFT_ARB; + + /** + * The Pbuffer back right buffer. + */ + public static final int BACK_RIGHT_BUFFER = RenderTexture.WGL_BACK_RIGHT_ARB; + + /** + * The Pbuffer depth buffer. + */ + public static final int DEPTH_BUFFER = RenderTexture.WGL_DEPTH_COMPONENT_NV; + + /** + * Current Pbuffer + */ + private static Pbuffer currentBuffer; + + /** + * Handle to the native GL rendering context + */ private final int handle; - /** Width */ + /** + * Width + */ private final int width; - /** Height */ + /** + * Height + */ private final int height; static { @@ -68,37 +159,47 @@ } /** - * Construct an instance of a Pbuffer. If this fails then an Exception will be thrown. - * The buffer is single-buffered. - * - * NOTE: An OpenGL window must be created before a Pbuffer can be created. The Pbuffer will - * have its own context that shares display lists and textures with the OpenGL window context, - * but it will have its own OpenGL state. Therefore, state changes to a pbuffer will not be seen - * in the window context and vice versa. - * - * NOTE: Some OpenGL implementations requires the shared contexts to use the same pixel format. - * So if possible, use the same bpp, alpha, depth and stencil values used to create the main window. + * Construct an instance of a Pbuffer. If this fails then an Exception will be thrown. The buffer is single-buffered. + * <p/> + * NOTE: An OpenGL window must be created before a Pbuffer can be created. The Pbuffer will have its own context that shares + * display lists and textures with the OpenGL window context, but it will have its own OpenGL state. Therefore, state changes + * to a pbuffer will not be seen in the window context and vice versa. + * <p/> + * NOTE: Some OpenGL implementations requires the shared contexts to use the same pixel format. So if possible, use the same + * bpp, alpha, depth and stencil values used to create the main window. + * <p/> + * The renderTexture parameter defines the necessary state for enabling render-to-texture. When this parameter is null, + * render-to-texture is not available. Before using render-to-texture, the Pbuffer capabilities must be queried to ensure that + * it is supported. * - * @param width Pbuffer width - * @param height Pbuffer height - * @param bpp Minimum bits per pixel - * @param alpha Minimum bits per pixel in alpha buffer - * @param depth Minimum bits per pixel in depth buffer - * @param stencil Minimum bits per pixel in stencil buffer - * @param samples Minimum samples in multisample buffer (corresponds to GL_SAMPLES_ARB in GL_ARB_multisample spec). - Pass 0 to disable multisampling. This parameter is ignored if GL_ARB_multisample is not supported. + * @param width Pbuffer width + * @param height Pbuffer height + * @param bpp Minimum bits per pixel + * @param alpha Minimum bits per pixel in alpha buffer + * @param depth Minimum bits per pixel in depth buffer + * @param stencil Minimum bits per pixel in stencil buffer + * @param samples Minimum samples in multisample buffer (corresponds to GL_SAMPLES_ARB in GL_ARB_multisample spec). Pass + * 0 to disable multisampling. This parameter is ignored if GL_ARB_multisample is not supported. + * @param renderTexture */ - public Pbuffer(int width, int height, int bpp, int alpha, int depth, int stencil, int samples) throws Exception { + public Pbuffer(int width, int height, int bpp, int alpha, int depth, int stencil, int samples, RenderTexture renderTexture) throws Exception { this.width = width; this.height = height; - handle = nCreate(width, height, bpp, alpha, depth, stencil, samples); + + if ( renderTexture == null ) + handle = nCreate(width, height, bpp, alpha, depth, stencil, samples, null, 0, null, 0); + else + handle = nCreate(width, height, + bpp, alpha, depth, stencil, + samples, + renderTexture.pixelFormatCaps, renderTexture.pixelFormatCaps.limit(), + renderTexture.pBufferAttribs, renderTexture.pBufferAttribs.limit()); } /** - * Method to test for validity of the buffer. If this function returns true, - * the buffer contents is lost. The buffer can still be used, but the results are undefined. - * The application is expected to release the buffer if needed, destroy it and recreate a new - * buffer. + * Method to test for validity of the buffer. If this function returns true, the buffer contents is lost. The buffer can still + * be used, but the results are undefined. The application is expected to release the buffer if needed, destroy it and recreate + * a new buffer. * * @return true if the buffer is lost and destroyed, false if the buffer is valid. */ @@ -109,11 +210,10 @@ /** * Native method to test for buffer integrity */ - private native static boolean nIsBufferLost(int handle); + private static native boolean nIsBufferLost(int handle); /** - * Method to make the Pbuffer context current. All subsequent OpenGL - * calls will go to this buffer. + * Method to make the Pbuffer context current. All subsequent OpenGL calls will go to this buffer. */ public synchronized void makeCurrent() { currentBuffer = this; @@ -124,11 +224,10 @@ /** * Native method to make a pbuffer current. */ - private native static void nMakeCurrent(int handle); + private static native void nMakeCurrent(int handle); /** - * Gets the Pbuffer capabilities. Only the flag PBUFFER_SUPPORTED is - * available, and indicates that Pbuffers can be created. + * Gets the Pbuffer capabilities. * * @return a bitmask of Pbuffer capabilities. */ @@ -137,18 +236,15 @@ /** * Native method to create a Pbuffer */ - private native static int nCreate( - int width, - int height, - int bpp, - int alpha, - int depth, - int stencil, - int samples) throws Exception; + private static native int nCreate(int width, int height, + int bpp, int alpha, int depth, int stencil, + int samples, + IntBuffer pixelFormatCaps, int pixelFormatCapsSize, + IntBuffer pBufferAttribs, int pBufferAttribsSize) throws Exception; /** - * Destroys the Pbuffer. After this call, there will be no valid GL rendering context - - * regardless of whether this Pbuffer was the current rendering context or not. + * Destroys the Pbuffer. After this call, there will be no valid GL rendering context - regardless of whether this Pbuffer was + * the current rendering context or not. */ public synchronized void destroy() { makeCurrent(); @@ -159,21 +255,67 @@ /** * Natively destroy any GL-related stuff */ - private native static void nDestroy(int handle); - + private static native void nDestroy(int handle); + + // ----------------------------------------------------------------------------------------- + // ------------------------------- Render-to-Texture Methods ------------------------------- + // ----------------------------------------------------------------------------------------- + + /** + * Sets a render-to-texture attribute. + * <p/> + * The attrib parameter can be one of MIPMAP_LEVEL and CUBE_MAP_FACE. When the attrib parameter is CUBE_MAP_FACE then the value + * parameter can be on of the following: + * <p/> + * TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y + * TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z + * + * @param attrib + * @param value + */ + public synchronized void setAttrib(int attrib, int value) { + nSetAttrib(handle, attrib, value); + } + + private static native void nSetAttrib(int handle, int attrib, int value); + + /** + * Binds the currently bound texture to the buffer specified. The buffer can be one of the following: + * <p/> + * FRONT_LEFT_BUFFER FRONT_RIGHT_BUFFER BACK_LEFT_BUFFER BACK_RIGHT_BUFFER DEPTH_BUFFER + * + * @param buffer + */ + public synchronized void bindTexImage(int buffer) { + nBindTexImage(handle, buffer); + } + + private static native void nBindTexImage(int handle, int buffer); + + /** + * Releases the currently bound texture from the buffer specified. + * + * @param buffer + */ + public synchronized void releaseTexImage(int buffer) { + nReleaseTexImage(handle, buffer); + } + + private static native void nReleaseTexImage(int handle, int buffer); + /** * @return Returns the height. */ public int getHeight() { return height; } - + /** * @return Returns the width. */ public int getWidth() { return width; } - - + + } |