diff --git a/freeglut/freeglut/include/GL/freeglut_ext.h b/freeglut/freeglut/include/GL/freeglut_ext.h index 0fda0e2..911f224 100644 --- a/freeglut/freeglut/include/GL/freeglut_ext.h +++ b/freeglut/freeglut/include/GL/freeglut_ext.h @@ -226,6 +226,11 @@ FGAPI void FGAPIENTRY glutInitContextProfile( int profile ); FGAPI void FGAPIENTRY glutInitErrorFunc( void (* vError)( const char *fmt, va_list ap ) ); FGAPI void FGAPIENTRY glutInitWarningFunc( void (* vWarning)( const char *fmt, va_list ap ) ); +/* OpenGL >= 2.0 support */ +FGAPI void FGAPIENTRY glutSetVertexAttribCoord3(GLint attrib); +FGAPI void FGAPIENTRY glutSetVertexAttribNormal(GLint attrib); + + /* * GLUT API macro definitions -- the display mode definitions */ diff --git a/freeglut/freeglut/src/fg_gl2.c b/freeglut/freeglut/src/fg_gl2.c index 47913f4..e7dea50 100644 --- a/freeglut/freeglut/src/fg_gl2.c +++ b/freeglut/freeglut/src/fg_gl2.c @@ -27,6 +27,16 @@ #include "fg_internal.h" #include "fg_gl2.h" +void glutSetVertexAttribCoord3(GLint attrib) { + if (fgStructure.CurrentWindow != NULL) + fgStructure.CurrentWindow->Window.attribute_v_coord = attrib; +} + +void glutSetVertexAttribNormal(GLint attrib) { + if (fgStructure.CurrentWindow != NULL) + fgStructure.CurrentWindow->Window.attribute_v_normal = attrib; +} + typedef void (APIENTRY *PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); typedef void (APIENTRY *PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); typedef void (APIENTRY *PFNGLBUFFERDATAPROC) (GLenum target, fghGLsizeiptr size, const GLvoid *data, GLenum usage); diff --git a/freeglut/freeglut/src/fg_gl2.h b/freeglut/freeglut/src/fg_gl2.h index 788db43..2450f8d 100644 --- a/freeglut/freeglut/src/fg_gl2.h +++ b/freeglut/freeglut/src/fg_gl2.h @@ -29,6 +29,7 @@ #ifndef APIENTRY # define APIENTRY #endif + typedef ptrdiff_t fghGLsizeiptr; typedef void (APIENTRY *PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); typedef void (APIENTRY *PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); diff --git a/freeglut/freeglut/src/fg_internal.h b/freeglut/freeglut/src/fg_internal.h index c7dd53b..da0b44d 100644 --- a/freeglut/freeglut/src/fg_internal.h +++ b/freeglut/freeglut/src/fg_internal.h @@ -319,8 +319,8 @@ struct tagSFG_State int MajorVersion; /* Major OpenGL context version */ int MinorVersion; /* Minor OpenGL context version */ int ContextFlags; /* OpenGL context flags */ - int HasOpenGL20; /* fgInitGL2 could find all OpenGL 2.0 functions */ int ContextProfile; /* OpenGL context profile */ + int HasOpenGL20; /* fgInitGL2 could find all OpenGL 2.0 functions */ FGError ErrorFunc; /* User defined error handler */ FGWarning WarningFunc; /* User defined warning handler */ }; @@ -361,6 +361,8 @@ struct tagSFG_Context SFG_PlatformContext pContext; /* The window's FBConfig (X11) or device context (Windows) */ int DoubleBuffered; /* Treat the window as double-buffered */ + GLint attribute_v_coord; + GLint attribute_v_normal; }; diff --git a/freeglut/freeglut/src/fg_window.c b/freeglut/freeglut/src/fg_window.c index 06efa03..9a980f8 100644 --- a/freeglut/freeglut/src/fg_window.c +++ b/freeglut/freeglut/src/fg_window.c @@ -145,6 +145,8 @@ void fgOpenWindow( SFG_Window* window, const char* title, glReadBuffer ( GL_FRONT ); } #endif + window->Window.attribute_v_coord = -1; + window->Window.attribute_v_normal = -1; } /*