From 14b52db7ab4c4be2bd39ff944cec056c291f999a Mon Sep 17 00:00:00 2001 From: Chien Yang Date: Fri, 15 Oct 2004 23:33:45 +0000 Subject: Issue number: 4, 28, 71 and 76 Windows OpenGL only : This fix will use hardware Pbuffer for offScreenBuffer rendering if the graphics hardware support it, else BitMap is use as a fallback. 1) Fixed issue 4 - Speed of OffScreen Canvas3D 2) Fixed issue 28 - Combine Mode & Missing Texture in OffScreen snapshot on Win/XP 3) Fixed issue 71 - OGL: OffScreen canvas ignore GraphicsConfigTemplate under windows. 4) Fixed issue 76 - OffScreen rendering should use Pbuffer on Windows / OpenGL 5) Cleanup native ChoosePixelFormat code. git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@56 ba19aa83-45c5-6ac9-afd3-db810772062c --- src/native/ogl/gldefs.h | 67 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 22 deletions(-) (limited to 'src/native/ogl/gldefs.h') diff --git a/src/native/ogl/gldefs.h b/src/native/ogl/gldefs.h index 6658201..a79762a 100644 --- a/src/native/ogl/gldefs.h +++ b/src/native/ogl/gldefs.h @@ -72,6 +72,7 @@ #ifndef D3D #include +#include "wglext.h" #include "gl_1_2.h" #include "glext.h" #endif @@ -389,27 +390,6 @@ extern int glXgetVideoResizeSUN( Display *, GLXDrawable, float *); #define APIENTRY #endif -#ifdef WIN32 - -/* declare function prototype for WGL related functions*/ -typedef const char * (APIENTRY * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (HDC hdc); -typedef BOOL (APIENTRY * PFNWGLCHOOSEPIXELFORMATEXTPROC)(HDC hdc, - const int *piAttribIList, - const FLOAT *pfAttriFList, - UINT nMaxFormats, - int *piFormats, - UINT *nNumFormats); -typedef BOOL (APIENTRY * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC)(HDC hdc, - int iPixelFormat, - int iLayerPlane, - UINT nAttributes, - const int *piAttributes, - int *piValues); - - - -#endif /* WIN32 */ - /* define function prototypes */ typedef void (APIENTRY * MYPFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); @@ -641,5 +621,48 @@ typedef struct { MYPFNGLTEXFILTERFUNCSGI glTexFilterFuncSGIS; } GraphicsContextPropertiesInfo; -#endif /* J3D_BUILDVERTICES */ + +#ifdef WIN32 + +/* define the structure to hold the info. of a pixel format */ +typedef struct PixelFormatInfoRec PixelFormatInfo; + +struct PixelFormatInfoRec { + int onScreenPFormat; /* PixelFormat for onScreen */ + int offScreenPFormat; /* PixelFormat for offScreen */ + GLboolean supportARB; /* TRUE if ARB is supported */ + GLboolean supportPbuffer; /* TRUE if Pbuffer is supported */ + char* supportedExtensions; /* list of supported ARB extensions */ + /* handle to ARB functions */ + PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB; + PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB; + PFNWGLCREATEPBUFFERARBPROC wglCreatePbufferARB; + PFNWGLGETPBUFFERDCARBPROC wglGetPbufferDCARB; + PFNWGLRELEASEPBUFFERDCARBPROC wglReleasePbufferDCARB; + PFNWGLDESTROYPBUFFERARBPROC wglDestroyPbufferARB; + PFNWGLQUERYPBUFFERARBPROC wglQueryPbufferARB; + + /* TODO include multi-samples buffer */ + +}; + +#endif /* WIN32 */ + +/* define the structure to hold the info. of a offScreen buffer */ +typedef struct OffScreenBufferInfoRec OffScreenBufferInfo; + +struct OffScreenBufferInfoRec { + GLboolean isPbuffer; /* GL_TRUE if Pbuffer is used. */ + +#if defined(SOLARIS) || defined(__linux__) +#endif + +#ifdef WIN32 + HPBUFFERARB hpbuf; /* Handle to the Pbuffer */ +#endif /* WIN32 */ + +}; + + +#endif /* D3D */ #endif /* _Java3D_gldefs_h_ */ -- cgit v1.2.3