From: Diederick C. N. <dc...@gm...> - 2009-11-19 07:39:29
|
Just took a look at the sourcecode, smooth_opengl3.c All those extension stuff should be in some #ifdef making sure the preprocessor gets rid of them if not on windows, make sure to also #ifdef-guard the call to initExtensionEntries(). Then we'll have the issue of all these functions (e.g. gl_GenBuffers) not being declared on other platforms. I actually do not understand what the underscore is doing there: if we're on windows those functions are not declared by gl.h anyway, thats why the typedef's are there. On other platforms, the glGenBuffers() function should be declared. I thus propose to, instead of declaring these underscore versions for other platforms, to for windows type non-underscored versions, and guard these typedefs with #ifdefs so non-windows platforms are not affected. I am no expert, so I might be missing something about why these underscored versions are used. If somebody call tell me it is okay to on windows simply directly define "glGenBuffers" instead of "gl_GenBuffers", then I'll make the changes, test them on windows (no access to other platform) and send a patch to the list. Others will then have to try it on other platforms to see if it works. So let me know. Best, Dee On Thu, Nov 19, 2009 at 3:17 PM, Clive McCarthy <Cli...@ms...> wrote: > I think Diederick is right. Windows XP has ONLY OpenGL 1.2 support , > however, Vista (& Windows 7, I think), inched up to OpenGL 1.4 as an > intrinsic part of the OS. > > For OpenGL 2.0 and 3.0 one is certainly dependant on the driver extension > interfaces -- GLew or GLee -- or otherwise. > > Considering a broad, cross-platform approach, one's code can generally count > on OpenGL 1.4 facilities (using the driver extensions) -- but not more. The > latest Intel integrated graphics hardware GMA X4500 supports OpenGL 2.0 via > its drivers -- but Windows does not. > > So, for most [numerically] computers, access to the extensions via the > drivers, is essential. Which means GLee & GLew are needed if the extensions > are to be readily used. I don't think it unreasonable to expect them to be > part of the system. Anyone writing code using freeglut needs them for good > reasons ! > > Clive. > > > > -------------------------------------------------- > From: "Diederick C. Niehorster" <dc...@gm...> > Sent: Wednesday, November 18, 2009 9:09 PM > To: "FreeGLUT developers list" <fre...@li...> > Subject: Re: [Freeglut-developer] "freeglut" and OSX > >> As far as I know, those typedefs are needed because the OpenGL coming >> with windows is version 1.2 or 1.3 or so, they never update it for the >> obvious reason of pushing DirectX. An alternative would be to have the >> demo depend on GLEW for windows, but I guess the typedefs are more >> preferrable. I haven't got time to test it now, but I'm sure taking >> out the typedefs will lead to the demo not compiling on windows. >> >> Dee >> >> On Thu, Nov 19, 2009 at 12:27 PM, John F. Fay <joh...@cy...> >> wrote: >>> Jeremy, >>> >>> The "GLUT_FORWARD_COMPATIBLE" bit is a way of setting the >>> "WGL_CONTEXT_FLAGS_ARB" field to include a value of >>> "WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB". >>> >>> Everybody else, >>> >>> Does anybody have a reason for the below-mentioned "typedef" >>> statements in "smooth_opengl.c"? A subversion "praise" says >>> something about needing Windows compatibility (revision 788). Other >>> relevant revisions are 775, 776, 777, and 787. >>> >>> Unless I hear a good reason for them I propose to take them >>> out tomorrow evening and then put out RC3. >>> >>> - John >>> >>> >>> At 03:16 PM 11/18/2009, Jeremy Huddleston wrote: >>>>Just get rid of the typedefs. Pick up the typedefs directly from gl.h >>>> >>>>I'm more concerned about the GLUT_FORWARD_COMPATIBLE... what is that, >>>>and where is it from? >>>> >>>>On Nov 18, 2009, at 10:52, Jack Howarth wrote: >>>> >>>>>Jeremy, >>>>> Current freeglut svn... >>>>> >>>>>svn co >>>>>https://freeglut.svn.sourceforge.net/svnroot/freeglut/trunk/freeglut/freeglut >>>>>freeglut >>>>> >>>>>has the same build issue with smooth_opengl3.c under Xquartz 2.4.0... >>>>> >>>>>Making all in smooth_opengl3 >>>>>gcc -DHAVE_CONFIG_H -I. -I../../.. -I/sw/include -I../../../ >>>>>include -I/usr/X11R6/include -O3 -DTARGET_HOST_POSIX_X11 -c -o >>>>>smooth_opengl3-smooth_opengl3.o `test -f 'smooth_opengl3.c' || echo >>>>>'./'`smooth_opengl3.c >>>>>smooth_opengl3.c:101: error: redefinition of typedef >>>>>'PFNGLGENBUFFERSPROC' >>>>>/usr/X11R6/include/GL/gl.h:1878: error: previous declaration of >>>>>'PFNGLGENBUFFERSPROC' was here >>>>>smooth_opengl3.c:104: error: redefinition of typedef >>>>>'PFNGLBINDBUFFERPROC' >>>>>/usr/X11R6/include/GL/gl.h:1876: error: previous declaration of >>>>>'PFNGLBINDBUFFERPROC' was here >>>>>smooth_opengl3.c:107: error: conflicting types for >>>>>'PFNGLBUFFERDATAPROC' >>>>>/usr/X11R6/include/GL/gl.h:1880: error: previous declaration of >>>>>'PFNGLBUFFERDATAPROC' was here >>>>>smooth_opengl3.c:110: error: redefinition of typedef >>>>>'PFNGLCREATESHADERPROC' >>>>>/usr/X11R6/include/GL/gl.h:1933: error: previous declaration of >>>>>'PFNGLCREATESHADERPROC' was here >>>>>smooth_opengl3.c:113: error: redefinition of typedef >>>>>'PFNGLSHADERSOURCEPROC' >>>>>/usr/X11R6/include/GL/gl.h:1934: error: previous declaration of >>>>>'PFNGLSHADERSOURCEPROC' was here >>>>>smooth_opengl3.c:116: error: redefinition of typedef >>>>>'PFNGLCOMPILESHADERPROC' >>>>>/usr/X11R6/include/GL/gl.h:1935: error: previous declaration of >>>>>'PFNGLCOMPILESHADERPROC' was here >>>>>smooth_opengl3.c:119: error: redefinition of typedef >>>>>'PFNGLCREATEPROGRAMPROC' >>>>>/usr/X11R6/include/GL/gl.h:1936: error: previous declaration of >>>>>'PFNGLCREATEPROGRAMPROC' was here >>>>>smooth_opengl3.c:122: error: redefinition of typedef >>>>>'PFNGLATTACHSHADERPROC' >>>>>/usr/X11R6/include/GL/gl.h:1937: error: previous declaration of >>>>>'PFNGLATTACHSHADERPROC' was here >>>>>smooth_opengl3.c:125: error: redefinition of typedef >>>>>'PFNGLLINKPROGRAMPROC' >>>>>/usr/X11R6/include/GL/gl.h:1938: error: previous declaration of >>>>>'PFNGLLINKPROGRAMPROC' was here >>>>>smooth_opengl3.c:128: error: redefinition of typedef >>>>>'PFNGLUSEPROGRAMPROC' >>>>>/usr/X11R6/include/GL/gl.h:1939: error: previous declaration of >>>>>'PFNGLUSEPROGRAMPROC' was here >>>>>smooth_opengl3.c:131: error: redefinition of typedef >>>>>'PFNGLGETSHADERIVPROC' >>>>>/usr/X11R6/include/GL/gl.h:1963: error: previous declaration of >>>>>'PFNGLGETSHADERIVPROC' was here >>>>>smooth_opengl3.c:134: error: redefinition of typedef >>>>>'PFNGLGETSHADERINFOLOGPROC' >>>>>/usr/X11R6/include/GL/gl.h:1966: error: previous declaration of >>>>>'PFNGLGETSHADERINFOLOGPROC' was here >>>>>smooth_opengl3.c:137: error: redefinition of typedef >>>>>'PFNGLGETPROGRAMIVPROC' >>>>>/usr/X11R6/include/GL/gl.h:1964: error: previous declaration of >>>>>'PFNGLGETPROGRAMIVPROC' was here >>>>>smooth_opengl3.c:140: error: redefinition of typedef >>>>>'PFNGLGETPROGRAMINFOLOGPROC' >>>>>/usr/X11R6/include/GL/gl.h:1967: error: previous declaration of >>>>>'PFNGLGETPROGRAMINFOLOGPROC' was here >>>>>smooth_opengl3.c:143: error: redefinition of typedef >>>>>'PFNGLGETATTRIBLOCATIONPROC' >>>>>/usr/X11R6/include/GL/gl.h:1975: error: previous declaration of >>>>>'PFNGLGETATTRIBLOCATIONPROC' was here >>>>>smooth_opengl3.c:146: error: redefinition of typedef >>>>>'PFNGLVERTEXATTRIBPOINTERPROC' >>>>>/usr/X11R6/include/GL/gl.h:1924: error: previous declaration of >>>>>'PFNGLVERTEXATTRIBPOINTERPROC' was here >>>>>smooth_opengl3.c:149: error: redefinition of typedef >>>>>'PFNGLENABLEVERTEXATTRIBARRAYPROC' >>>>>/usr/X11R6/include/GL/gl.h:1925: error: previous declaration of >>>>>'PFNGLENABLEVERTEXATTRIBARRAYPROC' was here >>>>>smooth_opengl3.c:152: error: redefinition of typedef >>>>>'PFNGLGETUNIFORMLOCATIONPROC' >>>>>/usr/X11R6/include/GL/gl.h:1968: error: previous declaration of >>>>>'PFNGLGETUNIFORMLOCATIONPROC' was here >>>>>smooth_opengl3.c:155: error: redefinition of typedef >>>>>'PFNGLUNIFORMMATRIX4FVPROC' >>>>>/usr/X11R6/include/GL/gl.h:1960: error: previous declaration of >>>>>'PFNGLUNIFORMMATRIX4FVPROC' was here >>>>>smooth_opengl3.c: In function 'main': >>>>>smooth_opengl3.c:425: error: 'GLUT_FORWARD_COMPATIBLE' undeclared >>>>>(first use in this function) >>>>>smooth_opengl3.c:425: error: (Each undeclared identifier is reported >>>>>only once >>>>>smooth_opengl3.c:425: error: for each function it appears in.) >>>>>smooth_opengl3.c:425: error: 'GLUT_DEBUG' undeclared (first use in >>>>>this function) >>>>>make[4]: *** [smooth_opengl3-smooth_opengl3.o] Error 1 >>>>>make[3]: *** [all-recursive] Error 1 >>>>>make[2]: *** [all-recursive] Error 1 >>>>>make[1]: *** [all-recursive] Error 1 >>>>>make: *** [all] Error 2 >>>>> >>>>>If you remove the offending declarations... >>>>> >>>>>--- smooth_opengl3.c.org 2009-11-18 13:40:51.000000000 -0500 >>>>>+++ smooth_opengl3.c 2009-11-18 13:49:13.000000000 -0500 >>>>>@@ -98,62 +98,24 @@ >>>>>#define APIENTRY >>>>>#endif >>>>> >>>>>-typedef void (APIENTRY *PFNGLGENBUFFERSPROC) (GLsizei n, GLuint >>>>>*buffers); >>>>>-PFNGLGENBUFFERSPROC gl_GenBuffers; >>>>> >>>>>-typedef void (APIENTRY *PFNGLBINDBUFFERPROC) (GLenum target, GLuint >>>>>buffer); >>>>>-PFNGLBINDBUFFERPROC gl_BindBuffer; >>>>> >>>>>-typedef void (APIENTRY *PFNGLBUFFERDATAPROC) (GLenum target, >>>>>ourGLsizeiptr size, const GLvoid *data, GLenum usage); >>>>>-PFNGLBUFFERDATAPROC gl_BufferData; >>>>> >>>>>-typedef GLuint (APIENTRY *PFNGLCREATESHADERPROC) (GLenum type); >>>>>-PFNGLCREATESHADERPROC gl_CreateShader; >>>>> >>>>>-typedef void (APIENTRY *PFNGLSHADERSOURCEPROC) (GLuint shader, >>>>>GLsizei count, const ourGLchar **string, const GLint *length); >>>>>-PFNGLSHADERSOURCEPROC gl_ShaderSource; >>>>> >>>>>-typedef void (APIENTRY *PFNGLCOMPILESHADERPROC) (GLuint shader); >>>>>-PFNGLCOMPILESHADERPROC gl_CompileShader; >>>>> >>>>>-typedef GLuint (APIENTRY *PFNGLCREATEPROGRAMPROC) (void); >>>>>-PFNGLCREATEPROGRAMPROC gl_CreateProgram; >>>>> >>>>>-typedef void (APIENTRY *PFNGLATTACHSHADERPROC) (GLuint program, >>>>>GLuint shader); >>>>>-PFNGLATTACHSHADERPROC gl_AttachShader; >>>>> >>>>>-typedef void (APIENTRY *PFNGLLINKPROGRAMPROC) (GLuint program); >>>>>-PFNGLLINKPROGRAMPROC gl_LinkProgram; >>>>> >>>>>-typedef void (APIENTRY *PFNGLUSEPROGRAMPROC) (GLuint program); >>>>>-PFNGLUSEPROGRAMPROC gl_UseProgram; >>>>> >>>>>-typedef void (APIENTRY *PFNGLGETSHADERIVPROC) (GLuint shader, >>>>>GLenum pname, GLint *params); >>>>>-PFNGLGETSHADERIVPROC gl_GetShaderiv; >>>>> >>>>>-typedef void (APIENTRY *PFNGLGETSHADERINFOLOGPROC) (GLuint shader, >>>>>GLsizei bufSize, GLsizei *length, ourGLchar *infoLog); >>>>>-PFNGLGETSHADERINFOLOGPROC gl_GetShaderInfoLog; >>>>> >>>>>-typedef void (APIENTRY *PFNGLGETPROGRAMIVPROC) (GLenum target, >>>>>GLenum pname, GLint *params); >>>>>-PFNGLGETPROGRAMIVPROC gl_GetProgramiv; >>>>> >>>>>-typedef void (APIENTRY *PFNGLGETPROGRAMINFOLOGPROC) (GLuint >>>>>program, GLsizei bufSize, GLsizei *length, ourGLchar *infoLog); >>>>>-PFNGLGETPROGRAMINFOLOGPROC gl_GetProgramInfoLog; >>>>> >>>>>-typedef GLint (APIENTRY *PFNGLGETATTRIBLOCATIONPROC) (GLuint >>>>>program, const ourGLchar *name); >>>>>-PFNGLGETATTRIBLOCATIONPROC gl_GetAttribLocation; >>>>> >>>>>-typedef void (APIENTRY *PFNGLVERTEXATTRIBPOINTERPROC) (GLuint >>>>>index, GLint size, GLenum type, GLboolean normalized, GLsizei >>>>>stride, const GLvoid *pointer); >>>>>-PFNGLVERTEXATTRIBPOINTERPROC gl_VertexAttribPointer; >>>>> >>>>>-typedef void (APIENTRY *PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint >>>>>index); >>>>>-PFNGLENABLEVERTEXATTRIBARRAYPROC gl_EnableVertexAttribArray; >>>>> >>>>>-typedef GLint (APIENTRY *PFNGLGETUNIFORMLOCATIONPROC) (GLuint >>>>>program, const ourGLchar *name); >>>>>-PFNGLGETUNIFORMLOCATIONPROC gl_GetUniformLocation; >>>>> >>>>>-typedef void (APIENTRY *PFNGLUNIFORMMATRIX4FVPROC) (GLint location, >>>>>GLsizei count, GLboolean transpose, const GLfloat *value); >>>>>-PFNGLUNIFORMMATRIX4FVPROC gl_UniformMatrix4fv; >>>>> >>>>>void initExtensionEntries(void) >>>>>{ >>>>> >>>>>the smooth_opengl3 demo fails to compile with... >>>>> >>>>>gcc -DHAVE_CONFIG_H -I. -I../../.. -I/sw/include -I../../../ >>>>>include -I/usr/X11R6/include -O3 -DTARGET_HOST_POSIX_X11 -c -o >>>>>smooth_opengl3-smooth_opengl3.o `test -f 'smooth_opengl3.c' || echo >>>>>'./'`smooth_opengl3.c >>>>>smooth_opengl3.c: In function 'initExtensionEntries': >>>>>smooth_opengl3.c:122: error: 'gl_GenBuffers' undeclared (first use >>>>>in this function) >>>>>smooth_opengl3.c:122: error: (Each undeclared identifier is reported >>>>>only once >>>>>smooth_opengl3.c:122: error: for each function it appears in.) >>>>>smooth_opengl3.c:123: error: 'gl_BindBuffer' undeclared (first use >>>>>in this function) >>>>>smooth_opengl3.c:124: error: 'gl_BufferData' undeclared (first use >>>>>in this function) >>>>>smooth_opengl3.c:125: error: 'gl_CreateShader' undeclared (first use >>>>>in this function) >>>>>smooth_opengl3.c:126: error: 'gl_ShaderSource' undeclared (first use >>>>>in this function) >>>>>smooth_opengl3.c:127: error: 'gl_CompileShader' undeclared (first >>>>>use in this function) >>>>>smooth_opengl3.c:128: error: 'gl_CreateProgram' undeclared (first >>>>>use in this function) >>>>>smooth_opengl3.c:129: error: 'gl_AttachShader' undeclared (first use >>>>>in this function) >>>>>smooth_opengl3.c:130: error: 'gl_LinkProgram' undeclared (first use >>>>>in this function) >>>>>smooth_opengl3.c:131: error: 'gl_UseProgram' undeclared (first use >>>>>in this function) >>>>>smooth_opengl3.c:132: error: 'gl_GetShaderiv' undeclared (first use >>>>>in this function) >>>>>smooth_opengl3.c:133: error: 'gl_GetShaderInfoLog' undeclared (first >>>>>use in this function) >>>>>smooth_opengl3.c:134: error: 'gl_GetProgramiv' undeclared (first use >>>>>in this function) >>>>>smooth_opengl3.c:135: error: 'gl_GetProgramInfoLog' undeclared >>>>>(first use in this function) >>>>>smooth_opengl3.c:136: error: 'gl_GetAttribLocation' undeclared >>>>>(first use in this function) >>>>>smooth_opengl3.c:137: error: 'gl_VertexAttribPointer' undeclared >>>>>(first use in this function) >>>>>smooth_opengl3.c:138: error: 'gl_EnableVertexAttribArray' undeclared >>>>>(first use in this function) >>>>>smooth_opengl3.c:139: error: 'gl_GetUniformLocation' undeclared >>>>>(first use in this function) >>>>>smooth_opengl3.c:140: error: 'gl_UniformMatrix4fv' undeclared (first >>>>>use in this function) >>>>>smooth_opengl3.c: In function 'main': >>>>>smooth_opengl3.c:387: error: 'GLUT_FORWARD_COMPATIBLE' undeclared >>>>>(first use in this function) >>>>>smooth_opengl3.c:387: error: 'GLUT_DEBUG' undeclared (first use in >>>>>this function) >>>>>make: *** [smooth_opengl3-smooth_opengl3.o] Error 1 >>>>> >>>>>So the problem is how do we declare gl_GenBuffers, etc without >>>>>redeclaring PFNGLGENBUFFERSPROC, etc. >>>>> Jack >>>>> >>>>>On Wed, Nov 18, 2009 at 10:10:00AM -0800, Jeremy Huddleston wrote: >>>>>>I'll take a look at the demo. Can you give me your svn url, and >>>>>>I'll check it out. >>>>>> >>>>>>Thanks, >>>>>>Jeremy >>>>>> >>>>>>On Nov 18, 2009, at 04:53, John F. Fay wrote: >>>>>> >>>>>>>Gentlemen, >>>>>>> >>>>>>> If I may introduce myself, I am a lead developer for the >>>>>>>"freeglut" open-source library. I found your discussion of >>>>>>>"freeglut" on the Xquartz-developers mailing list and would like >>>>>>>to do something to help. We are presently working on a new >>>>>>>release and I would much rather it support OSX than not support OSX. >>>>>>> >>>>>>> The discussion I am referring to is found at >>>>>>> >>>>>>>http://lists.macosforge.org/pipermail/xquartz-dev/2009-April/002301.html >>>>>>>http://lists.macosforge.org/pipermail/xquartz-dev/2009-April/002303.html >>>>>>>http://lists.macosforge.org/pipermail/xquartz-dev/2009-April/002308.html >>>>>>> >>>>>>>You are right, the "smooth_opengl3" demo does indeed blindly >>>>>>>define the "PFNGL*PROC" symbols. It is a fairly recent addition >>>>>>>and is not the core library itself. One of our number notes that >>>>>>>with a trifling change to the library (which I have now put into >>>>>>>the SVN tree) he can build the library on his OSX machine, >>>>>>>although none of his other demo programs execute. >>>>>>> >>>>>>> Are you able to give some help in getting "freeglut" to run >>>>>>> on >>>>>>>OSX? I would deeply appreciate it. >>>>>>> >>>>>>> I look forward to hearing from you. Unfortunately the time >>>>>>>available before the next release is quite short. >>>>>>> >>>>>>> Sincerely, >>>>>>> John F. Fay >>>>> >>>> >>>> >>>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 >>> 30-Day >>> trial. Simplify your report design, integration and deployment - and >>> focus on >>> what you do best, core application coding. Discover what's new with >>> Crystal Reports now. http://p.sf.net/sfu/bobj-july >>> _______________________________________________ >>> Freeglut-developer mailing list >>> Fre...@li... >>> https://lists.sourceforge.net/lists/listinfo/freeglut-developer >>> >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 >> 30-Day >> trial. Simplify your report design, integration and deployment - and focus >> on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> Freeglut-developer mailing list >> Fre...@li... >> https://lists.sourceforge.net/lists/listinfo/freeglut-developer >> > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Freeglut-developer mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freeglut-developer > |