diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..7fcde15 Binary files /dev/null and b/.DS_Store differ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 324dd26..0000000 --- a/.gitattributes +++ /dev/null @@ -1,176 +0,0 @@ -* text=auto !eol -freeglut/freeglut/AUTHORS svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/CMakeLists.txt svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/COPYING svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/ChangeLog svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/README svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/README.android -text -freeglut/freeglut/README.cmake -text -freeglut/freeglut/README.cygwin_mingw svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/README.mingw_cross svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/README.win32 svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/android/Android.mk -text -freeglut/freeglut/android/README -text -freeglut/freeglut/android_toolchain.cmake -text -freeglut/freeglut/config.h.in svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/doc/download.html svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/doc/freeglut.html svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/doc/freeglut_logo.png -text -freeglut/freeglut/doc/freeglut_user_interface.html svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/doc/index.html svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/doc/ogl_sm.png -text -freeglut/freeglut/doc/progress.html svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/doc/structure.html svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/freeglut.pc.in -text -freeglut/freeglut/freeglut.rc.in svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/include/GL/freeglut.h svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/include/GL/freeglut_ext.h svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/include/GL/freeglut_std.h svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/include/GL/glut.h svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/mingw_cross_toolchain.cmake -text -freeglut/freeglut/progs/demos/CallbackMaker/CallbackMaker.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/progs/demos/Fractals/fractals.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/progs/demos/Fractals/fractals.dat svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/progs/demos/Fractals_random/fractals.dat svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/progs/demos/Fractals_random/fractals_random.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/progs/demos/Lorenz/lorenz.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/progs/demos/One/objects.ico -text -freeglut/freeglut/progs/demos/One/one.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/progs/demos/One/one.rc -text -freeglut/freeglut/progs/demos/Resizer/Resizer.cpp -text -freeglut/freeglut/progs/demos/init_error_func/init_error_func.c -text -freeglut/freeglut/progs/demos/multi-touch/multi-touch.c -text -freeglut/freeglut/progs/demos/shapes/glmatrix.c -text -freeglut/freeglut/progs/demos/shapes/glmatrix.h -text -freeglut/freeglut/progs/demos/shapes/shapes.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/progs/demos/smooth_opengl3/smooth_opengl3.c -text -freeglut/freeglut/progs/demos/spaceball/spaceball.c -text -freeglut/freeglut/progs/demos/spaceball/vmath.c -text -freeglut/freeglut/progs/demos/spaceball/vmath.h -text -freeglut/freeglut/progs/demos/spaceball/vmath.inl -text -freeglut/freeglut/progs/demos/subwin/subwin.c -text -freeglut/freeglut/progs/demos/timer/timer.c -text -freeglut/freeglut/progs/test-shapes-gles1/AndroidManifest.xml -text -freeglut/freeglut/progs/test-shapes-gles1/CMakeLists.txt -text -freeglut/freeglut/progs/test-shapes-gles1/android_toolchain.cmake -text -freeglut/freeglut/progs/test-shapes-gles1/ndk/AndroidManifest.xml -text -freeglut/freeglut/progs/test-shapes-gles1/ndk/jni/Android.mk -text -freeglut/freeglut/progs/test-shapes-gles1/ndk/jni/Application.mk -text -freeglut/freeglut/progs/test-shapes-gles1/test-shapes-gles1.c -text -freeglut/freeglut/src/android/fg_cursor_android.c -text -freeglut/freeglut/src/android/fg_ext_android.c -text -freeglut/freeglut/src/android/fg_gamemode_android.c -text -freeglut/freeglut/src/android/fg_init_android.c -text -freeglut/freeglut/src/android/fg_input_devices_android.c -text -freeglut/freeglut/src/android/fg_internal_android.h -text -freeglut/freeglut/src/android/fg_joystick_android.c -text -freeglut/freeglut/src/android/fg_main_android.c -text -freeglut/freeglut/src/android/fg_main_android.h -text -freeglut/freeglut/src/android/fg_runtime_android.c -text -freeglut/freeglut/src/android/fg_spaceball_android.c -text -freeglut/freeglut/src/android/fg_state_android.c -text -freeglut/freeglut/src/android/fg_structure_android.c -text -freeglut/freeglut/src/android/fg_window_android.c -text -freeglut/freeglut/src/android/native_app_glue/README -text -freeglut/freeglut/src/android/native_app_glue/android_native_app_glue.c -text -freeglut/freeglut/src/android/native_app_glue/android_native_app_glue.h -text -freeglut/freeglut/src/egl/fg_display_egl.c -text -freeglut/freeglut/src/egl/fg_ext_egl.c -text -freeglut/freeglut/src/egl/fg_init_egl.c -text -freeglut/freeglut/src/egl/fg_init_egl.h -text -freeglut/freeglut/src/egl/fg_internal_egl.h -text -freeglut/freeglut/src/egl/fg_state_egl.c -text -freeglut/freeglut/src/egl/fg_state_egl.h -text -freeglut/freeglut/src/egl/fg_structure_egl.c -text -freeglut/freeglut/src/egl/fg_structure_egl.h -text -freeglut/freeglut/src/egl/fg_window_egl.c -text -freeglut/freeglut/src/egl/fg_window_egl.h -text -freeglut/freeglut/src/fg_callbacks.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_cursor.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_display.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_ext.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_font.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_font_data.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_gamemode.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_geometry.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_gl2.c -text -freeglut/freeglut/src/fg_gl2.h -text -freeglut/freeglut/src/fg_init.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_init.h -text -freeglut/freeglut/src/fg_input_devices.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_internal.h svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_joystick.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_main.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_menu.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_misc.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_overlay.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_spaceball.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_state.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_stroke_mono_roman.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_stroke_roman.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_structure.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_teapot.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_teapot_data.h svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_videoresize.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/fg_window.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/freeglutdll.def.in svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/gles_stubs.c -text -freeglut/freeglut/src/mswin/fg_cursor_mswin.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/mswin/fg_display_mswin.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/mswin/fg_ext_mswin.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/mswin/fg_gamemode_mswin.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/mswin/fg_init_mswin.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/mswin/fg_input_devices_mswin.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/mswin/fg_internal_mswin.h svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/mswin/fg_joystick_mswin.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/mswin/fg_main_mswin.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/mswin/fg_menu_mswin.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/mswin/fg_spaceball_mswin.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/mswin/fg_state_mswin.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/mswin/fg_structure_mswin.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/mswin/fg_window_mswin.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/util/xparsegeometry_repl.c -text -freeglut/freeglut/src/util/xparsegeometry_repl.h -text -freeglut/freeglut/src/x11 svnc_svn_005fkeywords=Author+Date+Id+Revision -freeglut/freeglut/src/x11/fg_cursor_x11.c svnc_svn_005fkeywords=Author+Date+Id+Revision -freeglut/freeglut/src/x11/fg_display_x11_glx.c -text -freeglut/freeglut/src/x11/fg_ext_x11.c svnc_svn_005fkeywords=Author+Date+Id+Revision -freeglut/freeglut/src/x11/fg_gamemode_x11.c svnc_svn_005fkeywords=Author+Date+Id+Revision -freeglut/freeglut/src/x11/fg_glutfont_definitions_x11.c svnc_svn_005fkeywords=Author+Date+Id+Revision -freeglut/freeglut/src/x11/fg_init_x11.c svnc_svn_005fkeywords=Author+Date+Id+Revision -freeglut/freeglut/src/x11/fg_input_devices_x11.c svnc_svn_005fkeywords=Author+Date+Id+Revision -freeglut/freeglut/src/x11/fg_internal_x11.h svnc_svn_005fkeywords=Author+Date+Id+Revision -freeglut/freeglut/src/x11/fg_internal_x11_glx.h -text -freeglut/freeglut/src/x11/fg_joystick_x11.c svnc_svn_005fkeywords=Author+Date+Id+Revision -freeglut/freeglut/src/x11/fg_main_x11.c svnc_svn_005fkeywords=Author+Date+Id+Revision -freeglut/freeglut/src/x11/fg_menu_x11.c svnc_svn_005fkeywords=Author+Date+Id+Revision -freeglut/freeglut/src/x11/fg_spaceball_x11.c svnc_svn_005fkeywords=Author+Date+Id+Revision -freeglut/freeglut/src/x11/fg_state_x11.c svnc_svn_005fkeywords=Author+Date+Id+Revision -freeglut/freeglut/src/x11/fg_state_x11_glx.c -text -freeglut/freeglut/src/x11/fg_state_x11_glx.h -text -freeglut/freeglut/src/x11/fg_structure_x11.c svnc_svn_005fkeywords=Author+Date+Id+Revision -freeglut/freeglut/src/x11/fg_window_x11.c svnc_svn_005fkeywords=Author+Date+Id+Revision -freeglut/freeglut/src/x11/fg_window_x11_glx.c -text -freeglut/freeglut/src/x11/fg_window_x11_glx.h -text -freeglut/freeglut/src/x11/fg_xinput_x11.c -text svnc_svn_005fkeywords=Author+Date+Id+Revision -freeglut/web-src/basic_page.php svn_keywords=Author+Date+Id+Revision -freeglut/web-src/docs/android.php -text -freeglut/web-src/docs/api.php svn_keywords=Author+Date+Id+Revision -freeglut/web-src/docs/gles.php -text -freeglut/web-src/docs/install.php svn_keywords=Author+Date+Id+Revision -freeglut/web-src/freeglut-style.css svn_keywords=Author+Date+Id+Revision -freeglut/web-src/help.php svn_keywords=Author+Date+Id+Revision -freeglut/web-src/images/OGL.png -text -freeglut/web-src/images/chessdemo.png -text -freeglut/web-src/images/freeglut_logo.png -text -freeglut/web-src/images/freeglut_logo.xcf -text -freeglut/web-src/images/freeglut_text.xcf -text -freeglut/web-src/images/freshmeat.png -text -freeglut/web-src/images/opengl.png -text -freeglut/web-src/images/tuxcake.png -text -freeglut/web-src/index.php svn_keywords=Author+Date+Id+Revision -freeglut/web-src/news.php svn_keywords=Author+Date+Id+Revision -freeglut/web-src/progress.php svn_keywords=Author+Date+Id+Revision -freeglut/web-src/template.php svn_keywords=Author+Date+Id+Revision -freeglut/web-src/uinfo.php svn_keywords=Author+Date+Id+Revision -freeglut/web-src/upload -text diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index a02656c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,5 +0,0 @@ -Thank you for submitting a pull request, it's much appreciated. - -Because this is a mirror repo, we may not respond to or merge the PR in the timely manner you may expect. - -One way to get more attention to your issue is to message our mailing list: `freeglut-developer at lists.sourceforge.net` \ No newline at end of file diff --git a/.github/issue_template.md b/.github/issue_template.md deleted file mode 100644 index d77d1e4..0000000 --- a/.github/issue_template.md +++ /dev/null @@ -1,13 +0,0 @@ -Thank you for submitting an issue, it's much appreciated. - -Couple points before you create this ticket: - -* Because this is a mirror repo, we may not respond to new issues in the timely manner you may expect. -* Our official Bug/Issue list is located [here](https://sourceforge.net/p/freeglut/bugs/). If you create a duplicate issue in the official list in addition to GitHub, please reference the GitHub and SourceForge tickets in the other site's ticket so we may close both tickets. -* There is also an official Feature Request list, located [here](https://sourceforge.net/p/freeglut/feature-requests/). -* One way to get more attention to your issue is to message our mailing list: `freeglut-developer at lists.sourceforge.net` - -If you still intend to make a ticket here, please provide the following: - -* OS -* FreeGLUT version \ No newline at end of file diff --git a/.gitignore b/.gitignore index f54e617..96e8a55 100644 --- a/.gitignore +++ b/.gitignore @@ -1,94 +1,33 @@ -freeglut/freeglut/.vs -freeglut/freeglut/INSTALL -freeglut/freeglut/Makefile -freeglut/freeglut/Makefile.in -freeglut/freeglut/aclocal.m4 -freeglut/freeglut/autom4te.cache -freeglut/freeglut/autoscan.log -freeglut/freeglut/build -freeglut/freeglut/build64 -freeglut/freeglut/compile -freeglut/freeglut/config.guess -freeglut/freeglut/config.h -freeglut/freeglut/config.log -freeglut/freeglut/config.lt -freeglut/freeglut/config.status -freeglut/freeglut/config.sub -freeglut/freeglut/configure -freeglut/freeglut/configure.scan -freeglut/freeglut/cross-android-gles1 -freeglut/freeglut/cross-android-gles2 -freeglut/freeglut/cross-woe -freeglut/freeglut/debugfiles.list -freeglut/freeglut/debugsources.list -freeglut/freeglut/depcomp -freeglut/freeglut/doc/Makefile -freeglut/freeglut/doc/Makefile.in -freeglut/freeglut/freeglut-*.tar.gz -freeglut/freeglut/include/GL/Makefile -freeglut/freeglut/include/GL/Makefile.in -freeglut/freeglut/include/Makefile -freeglut/freeglut/include/Makefile.in -freeglut/freeglut/install-sh -freeglut/freeglut/libtool -freeglut/freeglut/ltmain.sh -freeglut/freeglut/man-pages -freeglut/freeglut/missing -freeglut/freeglut/native -freeglut/freeglut/native-gles1 -freeglut/freeglut/native-gles2 -freeglut/freeglut/progs/Makefile -freeglut/freeglut/progs/Makefile.in -freeglut/freeglut/progs/demos/CallbackMaker/.deps -freeglut/freeglut/progs/demos/CallbackMaker/.libs -freeglut/freeglut/progs/demos/CallbackMaker/CallbackMaker -freeglut/freeglut/progs/demos/CallbackMaker/CallbackMaker.exe -freeglut/freeglut/progs/demos/CallbackMaker/Makefile -freeglut/freeglut/progs/demos/CallbackMaker/Makefile.in -freeglut/freeglut/progs/demos/Fractals/.deps -freeglut/freeglut/progs/demos/Fractals/.libs -freeglut/freeglut/progs/demos/Fractals/Makefile -freeglut/freeglut/progs/demos/Fractals/Makefile.in -freeglut/freeglut/progs/demos/Fractals/fractals -freeglut/freeglut/progs/demos/Fractals/fractals.exe -freeglut/freeglut/progs/demos/Fractals_random/.deps -freeglut/freeglut/progs/demos/Fractals_random/.libs -freeglut/freeglut/progs/demos/Fractals_random/Makefile -freeglut/freeglut/progs/demos/Fractals_random/Makefile.in -freeglut/freeglut/progs/demos/Fractals_random/fractals_random -freeglut/freeglut/progs/demos/Fractals_random/fractals_random.exe -freeglut/freeglut/progs/demos/Lorenz/.deps -freeglut/freeglut/progs/demos/Lorenz/.libs -freeglut/freeglut/progs/demos/Lorenz/Makefile -freeglut/freeglut/progs/demos/Lorenz/Makefile.in -freeglut/freeglut/progs/demos/Lorenz/lorenz -freeglut/freeglut/progs/demos/Lorenz/lorenz.exe -freeglut/freeglut/progs/demos/Makefile -freeglut/freeglut/progs/demos/Makefile.in -freeglut/freeglut/progs/demos/One/.deps -freeglut/freeglut/progs/demos/One/.libs -freeglut/freeglut/progs/demos/One/Makefile -freeglut/freeglut/progs/demos/One/Makefile.in -freeglut/freeglut/progs/demos/One/one -freeglut/freeglut/progs/demos/One/one.exe -freeglut/freeglut/progs/demos/shapes/.deps -freeglut/freeglut/progs/demos/shapes/.libs -freeglut/freeglut/progs/demos/shapes/Makefile -freeglut/freeglut/progs/demos/shapes/Makefile.in -freeglut/freeglut/progs/demos/shapes/shapes -freeglut/freeglut/progs/demos/shapes/shapes.exe -freeglut/freeglut/progs/demos/smooth_opengl3/.deps -freeglut/freeglut/progs/demos/smooth_opengl3/Makefile -freeglut/freeglut/progs/demos/smooth_opengl3/Makefile.in -freeglut/freeglut/progs/demos/smooth_opengl3/smooth_opengl3 -freeglut/freeglut/progs/demos/smooth_opengl3/smooth_opengl3.exe -freeglut/freeglut/progs/test-shapes-gles1/cross-android -freeglut/freeglut/progs/test-shapes-gles1/native -freeglut/freeglut/src/*.la -freeglut/freeglut/src/*.lo -freeglut/freeglut/src/.deps -freeglut/freeglut/src/.libs -freeglut/freeglut/src/Makefile -freeglut/freeglut/src/Makefile.in -freeglut/freeglut/stamp-h1 -freeglut/freeglut/.vs +Makefile.in +Makefile +INSTALL +.deps +aclocal.m4 +autom4te.cache +compile +config.guess +config.sub +configure +configure.cache +config.log +config.status +# config.h.in is now static and used with CMake, keep it: +#config.h.in +config.h +depcomp +install-sh +ltmain.sh +missing +stamp-h1 +*.tar +*.tar.gz +*.tar.bz2 +*.zip +*.o +*.a +*~ +# my build dirs: +cross-android +cross-woe +build +native diff --git a/freeglut/freeglut/AUTHORS b/AUTHORS similarity index 94% rename from freeglut/freeglut/AUTHORS rename to AUTHORS index 6af14c8..8f9546e 100644 --- a/freeglut/freeglut/AUTHORS +++ b/AUTHORS @@ -45,4 +45,10 @@ Matti Lehtonen Vincent Simonetti support for BlackBerry +Furkan Mudanyali +dots-tb +BigBlackOniiSan +Team CBPS + support for PS Vita + ...and all the opengl-gamedev-l people that made Pawel start this project :) diff --git a/freeglut/freeglut/CMakeLists.txt b/CMakeLists.txt similarity index 94% rename from freeglut/freeglut/CMakeLists.txt rename to CMakeLists.txt index ec360e8..9d9f52d 100644 --- a/freeglut/freeglut/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,17 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0 FATAL_ERROR) -PROJECT(freeglut) +OPTION(VITA OFF) +if(VITA) + if(DEFINED ENV{DOLCESDK}) + set(CMAKE_TOOLCHAIN_FILE "$ENV{DOLCESDK}/share/dolce.toolchain.cmake" CACHE PATH "toolchain file") + include("$ENV{DOLCESDK}/share/dolce.cmake" REQUIRED) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 -O3") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -o3") + else() + message(FATAL_ERROR "Please define DOLCESDK to point to your SDK path!") + endif() +endif() +PROJECT(freeglut) # for multiarch LIBDIR support (requires cmake>=2.8.8) INCLUDE(GNUInstallDirs) @@ -33,7 +44,11 @@ set(SO_REV 0) # if nothing else changed increment this # FREEGLUT_BUILD_SHARED_LIBS is already a standard CMake variable, but we need to # re-declare it here so it will show up in the GUI. # by default, we want to build both -OPTION(FREEGLUT_BUILD_SHARED_LIBS "Build FreeGLUT shared library." ON) +if(NOT VITA) + OPTION(FREEGLUT_BUILD_SHARED_LIBS "Build FreeGLUT shared library." ON) +else() + OPTION(FREEGLUT_BUILD_SHARED_LIBS "Build FreeGLUT shared library." OFF) +endif() OPTION(FREEGLUT_BUILD_STATIC_LIBS "Build FreeGLUT static library." ON) # option for whether warnings and errors should be printed @@ -51,9 +66,9 @@ ELSE() ENDIF() # OpenGL ES support -IF(ANDROID) +IF(VITA) OPTION(FREEGLUT_GLES "Use OpenGL ES (requires EGL)" ON) -ELSE() +ELSEIF() OPTION(FREEGLUT_GLES "Use OpenGL ES (requires EGL)" OFF) ENDIF() @@ -148,8 +163,7 @@ IF(WIN32) ${CMAKE_BINARY_DIR}/freeglutdll.def # generated below from src/freeglutdll.def.in ) ENDIF() - -ELSEIF(ANDROID OR BLACKBERRY) +ELSEIF(ANDROID OR BLACKBERRY OR VITA) # BlackBerry and Android share some similar design concepts and ideas, as with many mobile devices. # As such, some classes can be shared between the two. XXX: Possibly rename shareable classes to # a more generic name. *_stub? *_mobile? @@ -160,7 +174,18 @@ ELSEIF(ANDROID OR BLACKBERRY) src/android/fg_joystick_android.c src/android/fg_spaceball_android.c ) - IF(ANDROID) + IF(VITA) + LIST(APPEND FREEGLUT_SRCS + src/vita/fg_init_vita.c + src/vita/fg_input_vita.c + src/vita/fg_internal_vita.h + src/vita/fg_main_vita.c + src/vita/fg_main_vita.h + src/vita/fg_state_vita.c + src/vita/fg_window_vita.c + ) + add_definitions(-DVITA) + ELSEIF(ANDROID) LIST(APPEND FREEGLUT_SRCS src/android/native_app_glue/android_native_app_glue.c src/android/native_app_glue/android_native_app_glue.h @@ -305,13 +330,13 @@ IF(WIN32) ENDIF() -IF(CMAKE_COMPILER_IS_GNUCC) +IF(CMAKE_COMPILER_IS_GNUCC AND NOT VITA) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") IF(NOT(ANDROID OR BLACKBERRY OR FREEGLUT_WAYLAND)) # not setting -ansi as EGL/KHR headers doesn't support it SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic") ENDIF() -ENDIF(CMAKE_COMPILER_IS_GNUCC) +ENDIF() INCLUDE(CheckIncludeFiles) IF(UNIX AND NOT(ANDROID OR BLACKBERRY OR FREEGLUT_WAYLAND)) @@ -352,7 +377,6 @@ ENDIF() INCLUDE(CheckFunctionExists) INCLUDE(CheckTypeSize) -INCLUDE(CheckCCompilerFlag) CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H) CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H) CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H) @@ -460,7 +484,7 @@ ELSE() IF(FREEGLUT_BUILD_STATIC_LIBS) SET_TARGET_PROPERTIES(freeglut_static PROPERTIES OUTPUT_NAME ${LIBNAME}) ENDIF() - IF(ANDROID) + IF(ANDROID OR VITA) # Not in CMake toolchain file, because the toolchain # file is called several times and generally doesn't # seem to be meant for modifying CFLAGS: @@ -468,17 +492,10 @@ ELSE() # '-O0 -gstabs+' helps the currently buggy GDB port # Too late to manipulate ENV: SET(ENV{CFLAGS} "$ENV{CFLAGS} -mandroid") # Not using _INIT variables, they seem to be used internally only - IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND ANDROID) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mandroid") ENDIF() - CHECK_C_COMPILER_FLAG(-O0 HAVE_O0_FLAG) - IF(HAVE_O0_FLAG) - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0") - ENDIF() - CHECK_C_COMPILER_FLAG(-gstabs+ HAVE_GSTABSP_FLAG) - IF(HAVE_gstabsp_FLAG) - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -gstabs+") - ENDIF() + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -gstabs+") ENDIF() ENDIF() IF(FREEGLUT_BUILD_SHARED_LIBS) @@ -524,7 +541,11 @@ INSTALL(FILES ${FREEGLUT_HEADERS} DESTINATION include/GL COMPONENT Devel) # Optionally build demos, on by default. -option( FREEGLUT_BUILD_DEMOS "Build FreeGLUT demos." ON ) +IF(VITA) + option( FREEGLUT_BUILD_DEMOS "Build FreeGLUT demos." OFF ) +ELSE() + option( FREEGLUT_BUILD_DEMOS "Build FreeGLUT demos." ON ) +ENDIF() SET(DEMO_LIBS ${OPENGL_glu_LIBRARY} ${LIBS}) # lib m for math, not needed on windows @@ -585,6 +606,8 @@ IF(WIN32) ELSEIF(FREEGLUT_GLES) IF(ANDROID) SET(PC_LIBS_PRIVATE "-llog -landroid -lGLESv2 -lGLESv1_CM -lEGL -lm") + ELSEIF(VITA) + SET(PC_LIBS_PRIVATE "-lGLESv2 -lEGL -lpib -lm -DVITA -lSceThreadmgr_stub") ELSEIF(BLACKBERRY) IF(PLAYBOOK) SET(PC_LIBS_PRIVATE "-lbps -lscreen -lGLESv2 -lGLESv1_CM -lEGL -lm") diff --git a/freeglut/freeglut/COPYING b/COPYING similarity index 100% rename from freeglut/freeglut/COPYING rename to COPYING diff --git a/freeglut/freeglut/ChangeLog b/ChangeLog similarity index 100% rename from freeglut/freeglut/ChangeLog rename to ChangeLog diff --git a/freeglut/freeglut/FreeGLUTConfig.cmake.in b/FreeGLUTConfig.cmake.in similarity index 100% rename from freeglut/freeglut/FreeGLUTConfig.cmake.in rename to FreeGLUTConfig.cmake.in diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e72bfdd --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/freeglut/freeglut/README b/README similarity index 99% rename from freeglut/freeglut/README rename to README index ac9ed68..744b863 100644 --- a/freeglut/freeglut/README +++ b/README @@ -17,6 +17,7 @@ Currently supported platforms: - macOS with XQuartz (no native Cocoa support yet) - Android (NDK) - BlackBerry + - PS Vita Consult the platform-specific readme files for details on the level of support and build instructions. diff --git a/freeglut/freeglut/README.android b/README.android similarity index 100% rename from freeglut/freeglut/README.android rename to README.android diff --git a/freeglut/freeglut/README.blackberry b/README.blackberry similarity index 100% rename from freeglut/freeglut/README.blackberry rename to README.blackberry diff --git a/freeglut/freeglut/README.cmake b/README.cmake similarity index 100% rename from freeglut/freeglut/README.cmake rename to README.cmake diff --git a/freeglut/freeglut/README.cygwin_mingw b/README.cygwin_mingw similarity index 100% rename from freeglut/freeglut/README.cygwin_mingw rename to README.cygwin_mingw diff --git a/README.md b/README.md index 12289ef..2f92ffa 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,17 @@ -FreeGLUT -======== +# Freeglut for Vita -This readme file applies to the git clone of FreeGLUT's svn repo on [sourceforge.net](http://freeglut.sourceforge.net/) that is hosted on [github](https://github.com/dcnieho/FreeGLUT). This is provided here to enable user to contribute easier. +## To compile for DolceSDK: +``` +mkdir build +cd build +cmake .. -DVITA=1 +make -j8 +make install +``` -Every effort is made to ensure that the ``git_master`` branch only progresses in a fastforward manner, but complete guarantees cannot be given as the [sourceforge.net trunk](https://sourceforge.net/p/freeglut/code/HEAD/tree/) is at all times leading. - -I will be unable to merge a pull request if the github clone is behind ``svn/trunk`` on sourceforge.net. Should you detect this, please contact me, maybe through making an issue here on github. - -This copy of the svn repository was not created with ``git svn`` but with the excellent svn support of [SmartGit](http://www.syntevo.com/). - - -Notes to self on how to work with this: - Basic workflow upon receiving a pull request is as follows: -- Merge pull request on github -- pull in changes to my local clone of the ``git_master`` branch. -- cherry pick the merged commits onto my local clone of the ``svn/trunk`` branch -- push these commits to svn remote (this alters the commits in the local - ``svn/trunk`` clone as extra meta data is added) -- merge ``svn/trunk`` into local ``git_master`` -- push merge commit to github (its fast forward!) +## Credits: +- freeglut contributors +- FMudanyali +- dots-tb +- BigBlackOniiSan +- Team CBPS \ No newline at end of file diff --git a/freeglut/freeglut/README.mingw_cross b/README.mingw_cross similarity index 100% rename from freeglut/freeglut/README.mingw_cross rename to README.mingw_cross diff --git a/README.vita b/README.vita new file mode 100644 index 0000000..510bc5e --- /dev/null +++ b/README.vita @@ -0,0 +1,11 @@ +# PS Vita CMake toolchain file, for use with DolceSDK +# Requires DolceSDK +# +# Usage: +# mkdir build +# cd build +# cmake .. -DVITA=1 +# make -j8 +# make install +# +# You need to use "glutInitContextVersion(2, 0)" in your program for OpenGL ES 2.0. diff --git a/freeglut/freeglut/README.win32 b/README.win32 similarity index 100% rename from freeglut/freeglut/README.win32 rename to README.win32 diff --git a/freeglut/freeglut/android/Android.mk b/android/Android.mk similarity index 100% rename from freeglut/freeglut/android/Android.mk rename to android/Android.mk diff --git a/freeglut/freeglut/android/README b/android/README similarity index 100% rename from freeglut/freeglut/android/README rename to android/README diff --git a/freeglut/freeglut/android_toolchain.cmake b/android_toolchain.cmake similarity index 100% rename from freeglut/freeglut/android_toolchain.cmake rename to android_toolchain.cmake diff --git a/freeglut/freeglut/blackberry.toolchain.cmake b/blackberry.toolchain.cmake similarity index 100% rename from freeglut/freeglut/blackberry.toolchain.cmake rename to blackberry.toolchain.cmake diff --git a/freeglut/freeglut/config.h.in b/config.h.in similarity index 100% rename from freeglut/freeglut/config.h.in rename to config.h.in diff --git a/freeglut/freeglut/doc/download.html b/doc/download.html old mode 100755 new mode 100644 similarity index 100% rename from freeglut/freeglut/doc/download.html rename to doc/download.html diff --git a/freeglut/freeglut/doc/freeglut.html b/doc/freeglut.html old mode 100755 new mode 100644 similarity index 100% rename from freeglut/freeglut/doc/freeglut.html rename to doc/freeglut.html diff --git a/freeglut/freeglut/doc/freeglut_logo.png b/doc/freeglut_logo.png old mode 100755 new mode 100644 similarity index 100% rename from freeglut/freeglut/doc/freeglut_logo.png rename to doc/freeglut_logo.png diff --git a/freeglut/freeglut/doc/freeglut_user_interface.html b/doc/freeglut_user_interface.html similarity index 100% rename from freeglut/freeglut/doc/freeglut_user_interface.html rename to doc/freeglut_user_interface.html diff --git a/freeglut/freeglut/doc/index.html b/doc/index.html old mode 100755 new mode 100644 similarity index 100% rename from freeglut/freeglut/doc/index.html rename to doc/index.html diff --git a/freeglut/freeglut/doc/ogl_sm.png b/doc/ogl_sm.png old mode 100755 new mode 100644 similarity index 100% rename from freeglut/freeglut/doc/ogl_sm.png rename to doc/ogl_sm.png diff --git a/freeglut/freeglut/doc/progress.html b/doc/progress.html old mode 100755 new mode 100644 similarity index 100% rename from freeglut/freeglut/doc/progress.html rename to doc/progress.html diff --git a/freeglut/freeglut/doc/structure.html b/doc/structure.html old mode 100755 new mode 100644 similarity index 100% rename from freeglut/freeglut/doc/structure.html rename to doc/structure.html diff --git a/freeglut/freeglut/freeglut.pc.in b/freeglut.pc.in similarity index 100% rename from freeglut/freeglut/freeglut.pc.in rename to freeglut.pc.in diff --git a/freeglut/freeglut/freeglut.rc.in b/freeglut.rc.in old mode 100755 new mode 100644 similarity index 100% rename from freeglut/freeglut/freeglut.rc.in rename to freeglut.rc.in diff --git a/freeglut/freeglut/progs/test-shapes-gles1/android_toolchain.cmake b/freeglut/freeglut/progs/test-shapes-gles1/android_toolchain.cmake deleted file mode 120000 index 1a710d1..0000000 --- a/freeglut/freeglut/progs/test-shapes-gles1/android_toolchain.cmake +++ /dev/null @@ -1 +0,0 @@ -../../android_toolchain.cmake \ No newline at end of file diff --git a/freeglut/web-src/basic_page.php b/freeglut/web-src/basic_page.php deleted file mode 100644 index 8ff672b..0000000 --- a/freeglut/web-src/basic_page.php +++ /dev/null @@ -1,14 +0,0 @@ - - -
What?
-

freeglut is a completely OpenSourced alternative to the OpenGL Utility Toolkit (GLUT) library. GLUT was originally written by Mark Kilgard to support the sample programs in the second edition OpenGL 'RedBook'. Since then, GLUT has been used in a wide variety of practical applications because it is simple, widely available and highly portable.

- - diff --git a/freeglut/web-src/docs/android.php b/freeglut/web-src/docs/android.php deleted file mode 100644 index b61dc3c..0000000 --- a/freeglut/web-src/docs/android.php +++ /dev/null @@ -1,261 +0,0 @@ - - -

- - freeglut 3.0 introduces support for the Android platform.
- - This platform is different than traditional desktop platforms, requiring cross-compilation, interfacing with a touchscreen, and ability for your application to be paused and resumed at any time.
- - Here's how: - -

- - - - - - -

Compiling

- -

Note: a pre-built archive can be found here: - freeglut3-android-modules.tar.gz (2014-06-01 / SVN revision 1686).

- -
    - -
  • - - Use your own cross-compiler for Android, or export the one from - the Android NDK (API level 9 is required to use native activities): - -
    -        /usr/src/android-ndk-r9d/build/tools/make-standalone-toolchain.sh \
    -          --platform=android-9 \
    -          --install-dir=/usr/src/ndk-standalone-9
    -      
    - -
  • - -
  • Compile freeglut and install it in your Android cross-compiler - path: - -
    -        PATH=/usr/src/ndk-standalone-9/bin:$PATH
    -        cd /usr/src/freeglut-3.0/
    -        mkdir cross-android-gles/
    -        cd cross-android-gles/
    -        cmake \
    -          -D CMAKE_TOOLCHAIN_FILE=../android_toolchain.cmake \
    -          -D CMAKE_INSTALL_PREFIX=/usr/src/ndk-standalone-9/sysroot/usr \
    -          -D CMAKE_BUILD_TYPE=Debug \
    -          -D FREEGLUT_GLES=ON \
    -          -D FREEGLUT_BUILD_DEMOS=NO \
    -          ..
    -        make -j4
    -        make install
    -        # Only static for now:
    -        rm -f /usr/src/ndk-standalone-9/sysroot/usr/lib/libfreeglut-gles.so*
    -      
    - -
  • - -
- - -

Using in your projects

- -

Compile your own project using common build systems

- -

For instance if you use the autotools:

- -
-      PATH=/usr/src/ndk-standalone-9/bin:$PATH
-      export PKG_CONFIG_PATH=/usr/src/ndk-standalone-9/sysroot/usr/share/pkgconfig
-      ./configure --host=arm-linux-androideabi --prefix=/somewhere
-      make
-      make install
-    
- -

If you use CMake, you may want to copy our Android toolchain - 'android_toolchain.cmake':

- -
-      PATH="$PATH:/usr/src/android-ndk-r9d"
-      PATH="$PATH:/usr/src/android-sdk-linux/tools"
-      PATH="$PATH:/usr/src/android-sdk-linux/platform-tools"
-      export PKG_CONFIG_PATH=/usr/src/ndk-standalone-9/sysroot/usr/share/pkgconfig
-      cp .../freeglut-3.0/android_toolchain.cmake .
-      mkdir cross-android/
-      cd cross-android/
-      cmake \
-        -D CMAKE_TOOLCHAIN_FILE=../android_toolchain.cmake \
-        -D CMAKE_INSTALL_PREFIX=/somewhere \
-        -D CMAKE_BUILD_TYPE=Debug \
-        -D MY_PROG_OPTION=something ... \
-        ..
-      make -j4
-      make install
-    
- -

Check progs/test-shapes-gles1/ in the freeglut - source distribution for a complete, stand-alone example.

- -

Compile your own project using the NDK build-system

- -
    - -
  • - - Create a module hierarchy pointing to freeglut, with our Android.mk: - -
    -        mkdir freeglut-gles/
    -        cp .../freeglut-3.0/android/Android.mk freeglut-gles/
    -        ln -s /usr/src/ndk-standalone-9/sysroot/usr/include freeglut-gles/include
    -        ln -s /usr/src/ndk-standalone-9/sysroot/usr/lib freeglut-gles/lib
    -      
    - -
  • - -
  • - - Reference this module in your jni/Android.mk: - -
    -        LOCAL_STATIC_LIBRARIES := ... freeglut-gles
    -        ...
    -        $(call import-module,freeglut-gles)
    -      
    - -
  • - -
  • - - You now can point your NDK_MODULE_PATH to the directory containing the module: - -
    -        ndk-build NDK_MODULE_PATH=.
    -      
    - -
  • - -
- - - -

Roadmap

- -Done: -
    -
  • Initialize context with EGL
  • -
  • Keyboard support
  • -
  • Mouse support
  • -
  • Virtual keypad (on touchscreen)
  • -
  • Extract assets in cache dir on start-up
  • -
  • Make EGL support reusable by Mesa X11
  • -
  • freeglut_std.h can be used with GLES1 or GLES2 or non-ES headers
  • -
  • GLES1 and GLES2 support for geometry
  • -
  • Pause/resume application support
  • -
  • Callback to reload OpenGL resources lost during a pause
  • -
  • Callback for application status (pause/resume) notifications
  • -
- -TODO: -
    -
  • Multi-touch support (glutMultiMotionFunc & al.)
  • -
  • Display translucent keys on virtual keypad
  • -
  • API to access raw JVM structure and raw Activity(ies?) - structure
  • -
  • API to detect touchscreen presence
  • -
  • API (or configuration file?) to disable assets extraction
  • -
  • Accelerometer as a joystick input
  • -
- -Possibly implemented later: -
    -
  • Support for menus and basic fonts
  • -
  • Open new windows (if that's possible)
  • -
  • Joystick support (note: xperia play doesn't have a joystick, but a - touchpad)
  • -
- - -

New API

- -New callbacks were added : see API page. - -New functions will be necessary to : -
    -
  • detect touchscreen presence
  • -
  • disable assets extraction
  • -
- -(Work In Progress) - - -

Notes

- -
    - -
  • - Android never truly kills an application, even when pressing the - Back button, even when the application - is onDestroy'd: the process is still running and - ready to accept onCreate event to become active - again.
    - - By default, freeglut exit()s when the last window is - closed (without returning to your main). But this - behavior can be changed - with glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, ...), - in which case your have to either exit() yourself at - the end of your main, or make sure - your main can be called multiple times (in - particular: beware of static variables that won't be - reinitialized). -
  • - -
  • - When a key is repeated, down and up events happen most often at - the exact same time. This makes it impossible to animate based on - key press time.
    - - e.g. down/up/wait/down/up rather than down/wait/down/wait/up
    - - This looks like a bug in the Android virtual keyboard system :/ - Real buttons such as the Back button appear to work correctly - (series of down events with proper getRepeatCount value).
    - - To work around this, freeglut provides its own minimal virtual - keypad. It may be replaced by a virtual (touchscreen) joystick. -
  • - -
- - -

Links

- -
    - -
  • http://pygame.renpy.org/ : Pygame Subset for Android, it - designed an API for managing Android app lifecycle - (android.check_pause and - android.wait_for_resume)
  • - - - - diff --git a/freeglut/web-src/docs/api.php b/freeglut/web-src/docs/api.php deleted file mode 100644 index 8603eb2..0000000 --- a/freeglut/web-src/docs/api.php +++ /dev/null @@ -1,2963 +0,0 @@ - - -

    -
    -The Open-Source
    -OpenGL Utility Toolkit
    -(freeglut 3.0.0)
    -Application Programming Interface -
    - -

    -
    -Version 4.0 -
    - -

    -
    -The freeglut Programming Consortium
    -January, 2013 -
    - -

    -OpenGL is a trademark of Silicon Graphics, Inc. X Window System is a trademark -of X Consortium, Inc. Spaceball is a registered trademark of Spatial -Systems Inc. -

    - -

    -The authors have taken care in preparation of this documentation but make -no expressed or implied warranty of any kind and assumes no responsibility -for errors or omissions. No liability is assumed for incidental or consequential -damages in connection with or arising from the use of information or programs -contained herein. -

    - -

    1. Contents

    - -
      -
    1. Contents
    2. -
    3. Introduction
    4. -
    5. Background -
        -
      1. Design Philosophy
      2. -
      3. Conventions
      4. -
      5. Terminology
      6. -
      7. Differences from GLUT 3.7
      8. -
      -
    6. -
    7. Initialization Functions -
        -
      1. glutInit
      2. -
      3. glutInitWindowPosition, glutInitWindowSize
      4. -
      5. glutInitDisplayMode
      6. -
      7. glutInitDisplayString
      8. -
      9. glutInitErrorFunc, glutInitWarningFunc
      10. -
      -
    8. -
    9. Event Processing Functions -
        -
      1. glutMainLoop
      2. -
      3. glutMainLoopEvent
      4. -
      5. glutLeaveMainLoop
      6. -
      -
    10. -
    11. Window Functions -
        -
      1. glutCreateWindow
      2. -
      3. glutCreateSubwindow
      4. -
      5. glutDestroyWindow
      6. -
      7. glutSetWindow, glutGetWindow
      8. -
      9. glutSetWindowTitle, glutSetIconTitle
      10. -
      11. glutReshapeWindow
      12. -
      13. glutPositionWindow
      14. -
      15. glutShowWindow, glutHideWindow, glutIconifyWindow
      16. -
      17. glutPushWindow, glutPopWindow
      18. -
      19. glutFullScreen, glutLeaveFullScreen, glutFullScreenToggle
      20. -
      -
    12. -
    13. Display Functions -
        -
      1. glutPostRedisplay
      2. -
      3. glutPostWindowRedisplay
      4. -
      5. glutSwapBuffers
      6. -
      -
    14. -
    15. Mouse Cursor Functions -
        -
      1. glutSetCursor
      2. -
      3. glutWarpPointer
      4. -
      -
    16. -
    17. Overlay Functions -
        -
      1. glutEstablishOverlay
      2. -
      3. glutRemoveOverlay
      4. -
      5. glutUseLayer
      6. -
      7. glutPostOverlayRedisplay
      8. -
      9. glutPostWindowOverlayRedisplay
      10. -
      11. glutShowOverlay, glutHideOverlay
      12. -
      -
    18. -
    19. Menu Functions -
        -
      1. glutCreateMenu
      2. -
      3. glutDestroyMenu
      4. -
      5. glutGetMenu, glutSetMenu
      6. -
      7. glutAddMenuEntry
      8. -
      9. glutAddSubMenu
      10. -
      11. glutChangeToMenuEntry
      12. -
      13. glutChangeToSubMenu
      14. -
      15. glutSetMenuFont
      16. -
      17. glutRemoveMenuItem
      18. -
      19. glutAttachMenu, glutDetachMenu
      20. -
      21. glutMenuDestroyFunc
      22. -
      -
    20. -
    21. Global Callback Registration Functions -
        -
      1. glutTimerFunc
      2. -
      3. glutIdleFunc
      4. -
      5. glutMenuStatusFunc
      6. -
      7. glutMenuStateFunc
      8. -
      -
    22. -
    23. Window-Specific Callback Registration Functions -
        -
      1. glutDisplayFunc
      2. -
      3. glutOverlayDisplayFunc
      4. -
      5. glutReshapeFunc
      6. -
      7. glutPositionFunc
      8. -
      9. glutCloseFunc
      10. -
      11. glutKeyboardFunc
      12. -
      13. glutSpecialFunc
      14. -
      15. glutKeyboardUpFunc
      16. -
      17. glutSpecialUpFunc
      18. -
      19. glutMotionFunc, glutPassiveMotionFunc
      20. -
      21. glutMouseFunc
      22. -
      23. glutMouseWheelFunc
      24. -
      25. glutEntryFunc
      26. -
      27. glutJoystickFunc
      28. -
      29. glutSpaceballMotionFunc
      30. -
      31. glutSpaceballRotateFunc
      32. -
      33. glutSpaceballButtonFunc
      34. -
      35. glutButtonBoxFunc
      36. -
      37. glutDialsFunc
      38. -
      39. glutTabletMotionFunc
      40. -
      41. glutTabletButtonFunc
      42. -
      43. glutVisibilityFunc, glutWindowStatusFunc
      44. -
      -
    24. -
    25. State Setting and Retrieval Functions -
        -
      1. glutSetOption
      2. -
      3. glutGet
      4. -
      5. glutDeviceGet
      6. -
      7. glutGetModifiers
      8. -
      9. glutLayerGet
      10. -
      11. glutExtensionSupported
      12. -
      13. glutGetProcAddress
      14. -
      -
    26. -
    27. Font Rendering Functions -
        -
      1. glutBitmapCharacter
      2. -
      3. glutBitmapString
      4. -
      5. glutBitmapWidth
      6. -
      7. glutBitmapLength
      8. -
      9. glutBitmapHeight
      10. -
      11. glutStrokeCharacter
      12. -
      13. glutStrokeString
      14. -
      15. glutStrokeWidth
      16. -
      17. glutStrokeWidthf
      18. -
      19. glutStrokeLength
      20. -
      21. glutStrokeLengthf
      22. -
      23. glutStrokeHeight
      24. -
      -
    28. -
    29. Geometric Object Rendering Functions -
        -
      1. glutWireSphere, glutSolidSphere
      2. -
      3. glutWireTorus, glutSolidTorus
      4. -
      5. glutWireCone, glutSolidCone
      6. -
      7. glutWireCube, glutSolidCube
      8. -
      9. glutWireTetrahedron, glutSolidTetrahedron
      10. -
      11. glutWireOctahedron, glutSolidOctahedron
      12. -
      13. glutWireDodecahedron, glutSolidDodecahedron
      14. -
      15. glutWireIcosahedron, glutSolidIcosahedron
      16. -
      17. glutWireRhombicDodecahedron, glutSolidRhombicDodecahedron
      18. -
      19. glutWireTeapot, glutSolidTeapot, glutWireTeacup, - glutSolidTeacup, glutWireTeaspoon, glutSolidTeaspoon
      20. -
      21. glutSetVertexAttribCoord3, glutSetVertexAttribNormal, - glutSetVertexAttribTexCoord2
      22. -
      -
    30. -
    31. Game Mode Functions -
        -
      1. glutGameModeString
      2. -
      3. glutEnterGameMode, glutLeaveGameMode
      4. -
      5. glutGameModeGet
      6. -
      -
    32. -
    33. Video Resize Functions -
        -
      1. glutVideoResizeGet
      2. -
      3. glutSetupVideoResizing, glutStopVideoResizing
      4. -
      5. glutVideoResize
      6. -
      7. glutVideoPan
      8. -
      -
    34. -
    35. Color Map Functions -
        -
      1. glutSetColor, glutGetColor
      2. -
      3. glutCopyColormap
      4. -
      -
    36. -
    37. MultiTouch Functions -
        -
      1. glutMultiEntryFunc ← id, GLUT_ENTERED|GLUT_LEFT
      2. -
      3. glutMultiButtonFunc ← id, x, y, button, GLUT_DOWN|GLUT_UP
      4. -
      5. glutMultiMotionFunc ← id, x, y
      6. -
      7. glutMultiPassiveFunc ← id, x, y
      8. -
      -
    38. -
    39. Mobile functions -
        -
      1. glutInitContextFunc ← void
      2. -
      3. glutAppStatusFunc ← event
      4. -
      -
    40. -
    41. Miscellaneous Functions -
        -
      1. glutSetKeyRepeat, glutIgnoreKeyRepeat
      2. -
      3. glutForceJoystickFunc
      4. -
      5. glutReportErrors
      6. -
      -
    42. -
    43. Usage Notes -
        -
      1. Implementation Notes
      2. -
      3. GLUT State
      4. -
      5. "freeglut.h" Header File
      6. -
      7. References
      8. -
      9. Index
      10. -
      -
    44. -
    - -

    2. Introduction

    - -

    3. Background

    - -

    -The OpenGL programming world owes a tremendous debt to Mr. Mark J. Kilgard -for writing the OpenGL Utility Toolkit, or GLUT. The GLUT library -of functions allows an application programmer to create, control, and manipulate -windows independent of what operating system the program is running on. -By hiding the dependency on the operating system from the application programmer, -he allowed people to write truly portable OpenGL applications. -

    - -

    -Mr. Kilgard copyrighted his library and gave it a rather unusual license. -Under his license, people are allowed freely to copy and distribute the libraries -and the source code, but they are not allowed to modify it. For a long time this did -not matter because the GLUT library worked so well and because Mr. Kilgard -was releasing updates on a regular basis. But with the passage of time, -people started wanting some slightly different behaviours in their windowing -system. When Mr. Kilgard stopped supporting the GLUT library in 1999, -having moved on to bigger and better things, this started to become a problem. -

    - -

    -In December 1999, Mr. Pawel Olzsta started work on an open-source clone of the -GLUT library. -This open-source clone, which does not use any of the GLUT source code, has -evolved into the present freeglut library. This documentation -specifies the application program interface to the freeglut library. -

    - -

    3.1 Design Philosophy

    - -

    3.2 Conventions

    - -

    -In developing the freeglut library, we have taken careful steps -to ensure consistency in function operation across the board, in such a -manner as to maintain compatibility with GLUT's behavior whenever -possible. In this section some of the important conventions of freeglut, -and their compatibility with GLUT, are made explicit. -

    - -

    3.2.1 Window placement and size

    - -

    -There is considerable confusion about the "right thing to do" concerning -window size and position. GLUT itself is not consistent between -Windows and UNIX/X11; since platform independence is a virtue for -freeglut, we decided to break with GLUT's behaviour.
    -Under UNIX/X11, it is apparently not possible to get the window border -sizes in order to subtract them off the window's initial position until -some time after the window has been created. Therefore we decided on -the following behavior, both under Windows and under UNIX/X11: -

    • When you create a window with position (x,y) and size (w,h), the -upper left hand corner of the outside of the window (the non-client -area) is at (x,y) and the size of the drawable (client) area is (w,h). -The coordinates taken by glutInitPosition and -glutPositionWindow, as well as the coordinates provided by -freeglut when it calls the glutPositionFunc callback, -specify the top-left of the non-client area of the window. By default -only positive-signed coordinates are supported. If GLUT_ALLOW_NEGATIVE_WINDOW_POSITION -is enabled, then negative coordinates are supported. An exception -for glutPositionWindow exists as it's always supported negative -window coordinates.
    • -
    • When you query the size and position of the window using -glutGet, freeglut will return the size of the drawable -area--the (w,h) that you specified when you created the window--and the -coordinates of the upper left hand corner of the drawable (client) -area--which is NOT the (x,y) position of the window you specified -when you created it.
    -

    - -

    3.2.2 User-data callbacks

    - -

    -GLUT was created as a tool to help teach OpenGL programming. To simplify -development, callbacks were used for handling display, input, and other -events. But at the time it was developed, the purpose, or for some other -unknown reason, the callbacks lacked any user-provided data argument. -This has caused considerable difficulties for any significantly advanced -usage of GLUT, and now freeglut. This has prevented any attempt to -wrap freeglut in a C++ wrapper, make per-window, per-callback data -structure, and potentially made it undesirable to modern C developers who -tend to be well versed in "don't use globals". To combat these -complaints and issues, many callbacks (with some deprecated -callbacks excluded) support user-data callbacks provided through additional -functions provided in freeglut. All callbacks that support user-data -callbacks are marked as such. -

    - -

    -The general rule to follow is to take the freeglut callback function -and append "Ucall" to the end of the function, add an additional void* -argument to the end of the argument list of both the freeglut function -and the callback function. This will pass the user-data to the callback when it's -invoked. -

    - -

    Examples

    - -

    void glutPositionFunc ( void (* func)( int x, int y ) );
    -void glutPositionFuncUcall ( void (* func)( int x, int y, void* user_data ), void* user_data );

    - -

    void glutKeyboardUpFunc ( void (* func)( unsigned char key, int x, int y ) );
    -void glutKeyboardUpFuncUcall ( void (* func)( unsigned char key, int x, int y, void* user_data ), void* user_data );

    - -

    3.3 Terminology

    - -

    3.4 Differences from GLUT 3.7

    - -

    -Since the freeglut library was developed in order to update GLUT, -it is natural that there will be some differences between the two. -Each function in the API notes any differences between the GLUT and the -freeglut function behaviours. The important ones are summarized -here. -

    - -

    3.4.1 glutMainLoop Behaviour

    - -

    -One of the commonest complaints about the GLUT library was that once an -application called glutMainLoop, it never got control back. -There was no way for an application to loop in GLUT for a while, possibly -as a subloop while a specific window was open, and then return to the calling -function. A new function, glutMainLoopEvent, has been added -to allow this functionality. Another function, glutLeaveMainLoop, -has also been added to allow the application to tell freeglut to clean -up and close down. -

    - -

    3.4.2 Action on Window Closure

    - -

    -Another difficulty with GLUT, especially with multiple-window programs, -is that if the user clicks on the "x" in the window header the application -exits immediately. The application programmer can now set an option, - GLUT_ACTION_ON_WINDOW_CLOSE, to specify whether execution should -continue, whether GLUT should return control to the main program, or whether -GLUT should simply exit (the default). -

    - -

    3.4.3 Fullscreen windows

    - -

    -Function to leave fullscreen window mode, glutLeaveFullScreen, -or to toggle between fullscreen and normal window mode, -glutFullScreenToggle, have been added. -

    - -

    3.4.4 Changes to Callbacks

    - -

    -Several new callbacks have been added and several callbacks which were specific -to Silicon Graphics hardware have not been implemented. Most or all -of the new callbacks are listed in the GLUT Version 4 "glut.h" header file -but did not make it into the documentation. The new callbacks consist -of regular and special key release callbacks, a joystick callback, a menu -state callback (with one argument, distinct from the menu status callback -which has three arguments), a window status callback (also with one -argument), and a window position callback. Unsupported callbacks are -the two Tablet callbacks. If the user has a need for an unsupported -callback he should contact the freeglut development team. -

    - -

    3.4.5 String Rendering

    - -

    -New functions have been added to render full character strings (including -carriage returns) rather than rendering one character at a time. More -functions return the widths of character strings and the font heights, in -pixels for bitmapped fonts and in OpenGL units for the stroke fonts. -

    - -

    3.4.6 Geometry Rendering

    - -

    -Two functions have been added to render a wireframe and a solid rhombic -dodecahedron. Furthermore, solid and wireframe versions of the original -teacup and teaspoon that accompanied the famous Newell teapot. As these -geometry functions are often used for teaching purposes, -glutSetOption(GLUT_GEOMETRY_VISUALIZE_NORMALS,true/false) can -now be used to visualize the normal vectors for each vertex. Lastly, to -support drawing these objects with shaders, three functions have been -added with which users can provide the addresses of the Coordinate, -Normal and Texture Coordinate vertex attribs: -glutSetVertexAttribCoord3, glutSetVertexAttribNormal, -and glutSetVertexAttribTexCoord2. Texture coordinates are only -generated for the teaset. -

    - -

    3.4.7 Extension Function Queries

    - -

    -glutGetProcAddress is a wrapper for the glXGetProcAddressARB and wglGetProcAddress -functions. -

    - -

    4. Initialization Functions

    - -

    4.1 glutInit

    - -

    4.2 glutInitWindowPosition, glutInitWindowSize

    - -

    -The glutInitWindowPosition and glutInitWindowSize -functions specify a desired position and size for windows that freeglut -will create in the future. -

    - -

    Usage

    - -

    void glutInitWindowPosition ( int x, int y );
    - void glutInitWindowSize ( int width, int height );

    - -

    Description

    - -

    -The glutInitWindowPosition and glutInitWindowSize -functions specify a desired position and size for windows that -freeglut will create in the future. -The position is measured in pixels from the upper left hand corner of the -screen, with "x" increasing to the right and "y" increasing towards the bottom -of the screen. The size is measured in pixels. freeglut -does not promise to follow these specifications in creating its windows, -but it certainly makes an attempt to. -

    - -

    -The position and size of a window are a matter of some subtlety. Most -windows have a usable area surrounded by a border and with a title bar -on the top. The border and title bar are commonly called "decorations." -The position of the window unfortunately varies with the operating system. -On both Linux and Windows, you specify the coordinates of the upper -left-hand corner of the window's decorations. Also for both operating -systems, the size of the window is the size of the usable interior.
    -With glutGet information can be acquired about the current -window's size, position and decorations. Note however that according to -freeglut's conventions, the information -returned about the window coordinates does not correspond to the -coordinates used when setting window position. In addition, GLUT only -accepts positive window coordinates, and ignores all negative window -coordinates. But if GLUT_ALLOW_NEGATIVE_WINDOW_POSITION is enabled, -then negative window coordinates can be used. This is useful for -multi-montitor setups where the second monitor may be in the negative -desktop space of the primary monitor, as now the window can be placed -on the additional monitors. Furthermore, this flag also determines how -negative coordinates and sizes are interpreted for subwindows. -

    - -

    -Windows has some additional quirks which the application programmer -should know about. First, the minimum y-coordinate -of a window decoration is zero. (This is a feature of freeglut -and can be adjusted if so desired.) Second, there appears to be a -minimum window width on Windows which is 104 pixels. The user may specify -a smaller width, but the Windows system calls ignore it. It is also -impossible to make a window narrower than this by dragging on its corner. -

    - -

    Changes From GLUT

    - -

    -For some reason, GLUT is not affected by the 104-pixel minimum window width. -If the user clicks on the corner of a window which is narrower than this amount, -the window will immediately snap out to this width, but the application can -call glutReshapeWindow and make a window narrower again. -

    - -

    -If GLUT_ALLOW_NEGATIVE_WINDOW_POSITION is enabled, glutInitWindowPosition -will accept negative window coordinates. -

    - -

    4.3 glutInitDisplayMode

    - -

    4.4 glutInitDisplayString

    -

    Changes From GLUT

    - -

    -glutInitDisplayString support is limited: any of the tokens recognized -by GLUT are also recognized by freeglut, but any statements with -comparators cannot (yet: do help develop -this!) be handled. Any spec (comparator and value) after the token -is ignored. However, many of these values can be set with glutSetOption -for now... -

    - -

    4.5 glutInitErrorFunc, glutInitWarningFunc

    -

    -The glutInitErrorFunc and glutInitWarningFunc -functions specify callbacks that will be called upon warnings and errors -issued from within freeglut so that the user can deal with these. -Useful for rerouting to another output sink (e.g., logging) and also to -avoid exit(1) being called upon error. As with other glutInit* -functions, these can be set before glutInit is called, so any output -from the library can be handled by the user. -

    - -

    Usage

    -

    void glutInitErrorFunc   ( void (* callback)( const char *fmt, va_list ap) );
    -void glutInitWarningFunc ( void (* callback)( const char *fmt, va_list ap) );

    - -

    These functions have user-data callback functions.

    - -

    Description

    -

    -The users callback is passed a format string and a variable argument -list that can be passed to functions such as printf.
    -Note that there are the preprocessor definitions -FREEGLUT_PRINT_ERRORS and FREEGLUT_PRINT_WARNINGS, -which affect freeglut's warning and error behavior when no user -callback is defined. If defined at library (not client app!) compile -time--by default it is, warnings and errors are printed to -stderr. If not defined, warnings and errors are muted (not -printed to stderr), though errors still trigger deinitialization and -exit. Whether FREEGLUT_PRINT_ERRORS and -FREEGLUT_PRINT_WARNINGS is defined does not affect whether the -client callback is called, it only affects whether warnings and errors -are printed to stderr when no callback is defined. -

    - -

    Changes From GLUT

    -

    GLUT does not provide these functions.

    - -

    5. Event Processing Functions

    - -

    -After an application has finished initializing its windows and menus, it -enters an event loop. Within this loop, freeglut polls the -data entry devices (keyboard, mouse, etc.) and calls the application's appropriate -callbacks. -

    - -

    -In GLUT, control never returned from -the event loop (as invoked by the glutMainLoop function) to the -calling function. This prevented an application from having re-entrant -code, in which GLUT could be invoked from within a callback, and it prevented -the application from doing any post-processing (such as freeing allocated -memory) after GLUT had closed down. freeglut allows the application -programmer to specify more direct control over the event loop by means of -two new functions. The first, glutMainLoopEvent, processes -a single iteration of the event loop and allows the application to use a different -event loop controller or to contain re-entrant code. The second, -glutLeaveMainLoop, causes the event loop to exit nicely; this is preferable -to the application's calling exit from within a GLUT callback. -

    - -

    5.1 glutMainLoop

    - -

    -The glutMainLoop function enters the event loop. -

    - -

    Usage

    - -

    void glutMainLoop ( void );

    - -

    Description

    - -

    The glutMainLoop function -causes the program to enter the window event loop. An application should -call this function at most once. It will call any application callback -functions as required to process mouse clicks, mouse motion, key presses, -and so on. -

    - -

    Changes From GLUT

    - -

    -In GLUT, there was absolutely no way for the application programmer to -have control return from the glutMainLoop function to the -calling function. freeglut allows the programmer -to force this by setting the GLUT_ACTION_ON_WINDOW_CLOSE option -and invoking the glutLeaveMainLoop function from one of the callbacks. -Stopping the program this way is preferable to simply calling exit -from within a callback because this allows freeglut to free allocated -memory and otherwise clean up after itself. (I know I just said this, -but I think it is important enough that it bears repeating.) -

    - -

    5.2 glutMainLoopEvent

    - -

    -The glutMainLoopEvent function processes a single iteration -in the freeglut event loop. -

    - -

    Usage

    - -

    void glutMainLoopEvent ( void );

    - -

    Description

    - -

    -The glutMainLoopEvent function causes freeglut to process -one iteration's worth of events in its event loop. This allows the application -to control its own event loop and still use the freeglut windowing system. -

    - -

    Changes From GLUT

    - -

    GLUT does not include this function.

    - -

    5.3 glutLeaveMainLoop

    - -

    -The glutLeaveMainLoop function causes freeglut to stop -its event loop. -

    - -

    Usage

    - -

    void glutLeaveMainLoop ( void ); -

    - -

    Description

    - -

    -The glutLeaveMainLoop function causes freeglut to stop the event loop. If the -GLUT_ACTION_ON_WINDOW_CLOSE option has been set to -GLUT_ACTION_GLUTMAINLOOP_RETURNS or -GLUT_ACTION_CONTINUE_EXECUTION, control will return to the -function which called glutMainLoop; otherwise the application -will exit. -

    - -

    -If the application has two nested calls to glutMainLoop and calls -glutLeaveMainLoop, the behaviour -of freeglut is undefined. It may leave only the inner nested -loop or it may leave both loops. If the reader has a strong preference -for one behaviour over the other he should contact the freeglut Programming -Consortium and ask for the code to be fixed. -

    - -

    Changes From GLUT

    - -

    GLUT does not include this function.

    - -

    6. Window Functions

    - -

    6.1 glutCreateWindow

    - -

    6.2 glutCreateSubwindow

    - -

    -The glutCreateSubwindow function creates a subwindow of an existing window. -

    - -

    Usage

    - -

    -int glutCreateSubwindow(int window, int x, int y, int width, int height); -

    - -

    Description

    - -

    -Creates a subwindow of window that is at location x and y -relative to the window's upper-left corner, and is of the specified width and height. The newly created -window ID is returned by glutCreateSubwindow. By default, the position coordinates will only allow windows within the bounds of the parent. -Negative coordinates be treated as coordinates from the opposite edge for a given axis. In addition, the width of the window will be taken into account. -For example, if the parent window is 100 pixels wide, and the x is 10, and width is 20, the subwindow will be located at x = 10. -If x is -10, then the subwindow will be located at 70 (parent - abs(pos) - dim). If the width or height are negative, then the dimension is taken as a -subtraction of the parent dimension. For example, if the parent window is 100 pixels wide, and the x is 10, and width is 20, the -subwindow will have a size of 20. If width is -20, then the subwindow will have a width of 70 (parent - pos - abs(dim)). -

    - -

    -If GLUT_ALLOW_NEGATIVE_WINDOW_POSITION is enabled, the window behavior differs. Negative window coordinates are now accepted and may result in windows outside -of the viewing area, depending on the platform of operation. Negative width and height are still used as a subtraction of the parent window dimension, -but they do not take x or y into account. For example, if the parent window is 100 pixels wide, and the x is 10, and width is 20, the -subwindow will be located at x = 10. If x is -10, then the subwindow will be located at x = -10. If the parent window is 100 pixels wide, -and the x is 10, and width is 20, the subwindow will have a size of 20. If width is -20, then the subwindow will have a width of 80 (parent - abs(dim)). -

    - -

    Changes From GLUT

    - -

    -GLUT does not support negative x or y. Nor does it have GLUT_ALLOW_NEGATIVE_WINDOW_POSITION -which changes the the functionality of glutCreateSubwindow. -

    - -

    6.3 glutDestroyWindow

    - -

    6.4 glutSetWindow, glutGetWindow

    - -

    6.5 glutSetWindowTitle, glutSetIconTitle

    - -

    -The glutSetWindowTitle, glutSetIconTitle set the -window title for when the window is in a visible state and when it is in -an iconified state respectively. -

    - -

    Usage

    - -

    glutSetWindowTitle(const char* title);
    -glutSetIconTitle(const char* title); -

    - -

    Description

    - -

    -Normally a window system displays a title for every top-level window in -the system. The initial title is set when you call glutCreateWindow(). -By means of the glutSetWindowTitle function you can set the -titles for your top-level freeglut windows. If you just want one -title for the window over the window's entire life, you should set it -when you open the window with glutCreateWindow().
    -glutSetIconTitle sets the title to be displayed for the window -when it is in iconified (minimized) state. -

    - -

    Changes From GLUT

    - -

    glutSetIconTitle does nothing in GLUT on Windows, but is -emulated on Windows by freeglut.

    - -

    6.6 glutReshapeWindow

    - -

    6.7 glutPositionWindow

    - -

    6.8 glutShowWindow, glutHideWindow, glutIconifyWindow

    - -

    6.9 glutPushWindow, glutPopWindow

    - -

    6.10 glutFullScreen, glutLeaveFullScreen, glutFullScreenToggle

    - -

    -The glutFullScreen, glutLeaveFullScreen and -glutFullScreenToggle functions are used to transition the -current window between fullscreen and normal mode. -

    - -

    Usage

    - -

    void glutFullScreen ( void );
    -void glutLeaveFullScreen ( void );
    -void glutFullScreenToggle ( void ); -

    - -

    Description

    - -

    -The glutFullScreen function causes the current window to enter -fullscreen mode, glutLeaveFullScreen to go back to the window -size and position as it was before entering fullscreen mode, and -glutFullScreenToggle toggles between fullscreen and normal -mode.
    -In multi-monitor setups on Windows 2000 and newer, the window will -become fullscreen on the monitor that it overlaps the most.
    -Calls to these functions are ignored for gamemode and child windows.
    -Use glutGet(GLUT_FULL_SCREEN) to query fullscreen state of -current window. -

    - -

    Changes From GLUT

    - -

    GLUT does not include the glutLeaveFullScreen and -glutFullScreenToggle functions.

    - -

    7. Display Functions

    - -

    7.1 glutPostRedisplay

    - -

    7.2 glutPostWindowRedisplay

    - -

    7.3 glutSwapBuffers

    - -

    8. Mouse Cursor Functions

    - -

    8.1 glutSetCursor

    - -

    8.2 glutWarpPointer

    - -

    9. Overlay Functions

    - -

    -freeglut does not allow overlays, although it does "answer the mail" -with function stubs so that GLUT-based programs can compile and link against -freeglut without modification. -

    - -

    -If the reader needs overlays, he should contact the freeglut Programming -Consortium and ask for them to be implemented. He should also be prepared -to assist in the implementation. -

    - -

    9.1 glutEstablishOverlay

    - -

    -The glutEstablishOverlay function is not implemented in freeglut. -

    - -

    Usage

    - -

    void glutEstablishOverlay ( void );

    - -

    Description

    - -

    -The glutEstablishOverlay function is not implemented in freeglut. -

    - -

    Changes From GLUT

    - -

    GLUT implements this function.

    - -

    9.2 glutRemoveOverlay

    - -

    -The glutRemoveOverlay function is not implemented in freeglut. -

    - -

    Usage

    - -

    void glutRemoveOverlay ( void );

    - -

    Description

    - -

    -The glutRemoveOverlay function -is not implemented in freeglut. -

    - -

    Changes From GLUT

    - -

    GLUT implements this function.

    - -

    9.3 glutUseLayer

    - -

    -The glutUseLayer function is not implemented in freeglut. -

    - -

    Usage

    - -

    void glutUseLayer ( GLenum layer );

    - -

    Description

    - -

    -The glutUseLayer function -is not implemented in freeglut. -

    - -

    Changes From GLUT

    - -

    GLUT implements this function.

    - -

    9.4 glutPostOverlayRedisplay

    - -

    -The glutPostOverlayRedisplay function is not implemented in freeglut. -

    - -

    Usage

    - -

    void glutPostOverlayRedisplay ( void );

    - -

    Description

    - -

    -The glutPostOverlayRedisplay function is not implemented -in freeglut. -

    - -

    Changes From GLUT

    - -

    GLUT implements this function.

    - -

    9.5 glutPostWindowOverlayRedisplay

    - -

    -The glutPostWindowOverlayRedisplay function is not implemented -in freeglut. -

    - -

    Usage

    - -

    void glutPostWindowOverlayRedisplay ( int window );

    - -

    Description

    - -

    -The glutPostWindowOverlayRedisplay function is not implemented in freeglut. -

    - -

    Changes From GLUT

    - -

    GLUT implements this function.

    - -

    9.6 glutShowOverlay, glutHideOverlay

    - -

    -The glutShowOverlay and glutHideOverlay functions -are not implemented in freeglut. -

    - -

    Usage

    - -

    void glutShowOverlay( void ); -
    - void glutHideOverlay( void ); -

    - -

    Description

    - -

    -The glutShowOverlay and glutHideOverlay functions are not implemented in freeglut. -

    - -

    Changes From GLUT

    - -

    GLUT implements these functions.

    - -

    10. Menu Functions

    - -

    10.1 glutCreateMenu

    - -

    Has user-data callback function.

    - -

    10.2 glutDestroyMenu

    - -

    10.3 glutGetMenu, glutSetMenu

    - -

    10.4 glutAddMenuEntry

    - -

    10.5 glutAddSubMenu

    - -

    10.6 glutChangeToMenuEntry

    - -

    10.7 glutChangeToSubMenu

    - -

    10.8 glutSetMenuFont

    -

    -glutSetMenuFont sets the (bitmap) font to be used for drawing -the specified menu. -

    - -

    Usage

    - -

    void glutSetMenuFont( int menuID, void* fontID ); -

    - -

    Description

    - -

    -Only bitmap fonts (GLUT_BITMAP_xxx, see here for a list) can be used as menu fonts. A -warning is issued and the request is ignored if the supplied font is a -stroke font, or an unknown font. -

    - -

    Changes From GLUT

    - -

    GLUT does not provide this function.

    - -

    10.9 glutRemoveMenuItem

    - -

    10.10 glutAttachMenu, glutDetachMenu

    - -

    10.11 glutMenuDestroyFunc

    - -

    Has user-data callback function.

    - -

    11. Global Callback Registration Functions

    - -

    11.1 glutTimerFunc

    - -

    Has user-data callback function.

    - -

    11.2 glutIdleFunc

    - -

    -The glutIdleFunc function sets the global idle callback. -freeglut calls the idle callback when there are no inputs from the user. -

    - -

    Usage

    - -

    void glutIdleFunc ( void (*func ) ( void ) );

    - -

    func The new global idle callback function

    - -

    Has user-data callback function.

    - -

    Description

    - -

    -The glutIdleFunc function -specifies the function that freeglut will call to perform background -processing tasks such as continuous animation when window system events are -not being received. If enabled, this function is called continuously -from freeglut while no events are received. The callback function -has no parameters and returns no value. freeglut does not change -the current window or the current menu before invoking the idle -callback; programs with multiple windows or menus must explicitly set the -current window and current menu - and not rely on its current setting.
    -The amount of computation and rendering done in an idle -callback should be minimized to avoid affecting the program's interactive -response. In general, no more than a single frame of rendering should -be done in a single invocation of an idle callback. Note that no actual -drawing to the framebuffer should be done from the idle callback, this -is not supported. While it might work on some platforms, it will not on -others or might stop working in the future. Drawing should be done in -the glutDisplayFunc callback.
    -Calling glutIdleFunc with a NULL argument -disables the call to an idle callback. -

    - -

    Changes From GLUT

    - -

    Application programmers should note that -if they have specified the "continue execution" action on window closure, -freeglut will continue to call the -idle callback after the user has closed a window by clicking on the "x" in -the window header bar. If the idle callback renders a particular window -(this is considered bad form but is frequently done anyway), the programmer -should supply a window closure callback for that window which changes or disables -the idle callback.

    - -

    11.3 glutMenuStatusFunc

    - -

    Has user-data callback function.

    - -

    11.4 glutMenuStateFunc

    - -

    12. Window-Specific Callback Registration Functions

    - -

    12.1 glutDisplayFunc

    - -

    Has user-data callback function.

    - -

    12.2 glutOverlayDisplayFunc

    - -

    Has user-data callback function.

    - -

    12.3 glutReshapeFunc

    - -

    Has user-data callback function.

    - -

    12.4 glutPositionFunc

    - -

    -The glutPositionFunc function sets the window's position -callback. freeglut calls the position callback when the window is -repositioned/moved programatically or by the user. -

    - -

    Usage

    - -

    void glutPositionFunc ( void -(* func)( int x, int y) );

    - -

    Has user-data callback function.

    - -

    Description

    - -

    When freeglut calls this callback, it provides the new -position on the screen of the top-left of the non-client area, -that is, the same coordinates used by glutInitPosition and -glutPositionWindow. To get the position on the screen of the -top-left of the client area, use glutGet(GLUT_WINDOW_X) and -glutGet(GLUT_WINDOW_Y). See freeglut's -conventions for more information.

    - -

    Changes From GLUT

    - -

    This function is not implemented in GLUT.

    - -

    12.5 glutCloseFunc

    - -

    -The glutCloseFunc function sets the window's close -callback. freeglut calls the close callback when the window is -about to be destroyed. -

    - -

    Usage

    - -

    void glutCloseFunc ( void (*func) ( void ) );

    - -

    func The window's new closure callback function
    -

    - -

    Has user-data callback function.

    - -

    Description

    - -

    -The glutCloseFunc function specifies the function -that freeglut will call to notify the application that a window -is about to be closed, either because it is requested using -glutDestroyWindow, because the user clicked on the "x" in the -window header (for top-level windows only), or due to a pending closure -of a subwindow's parent window. In the first case, the closure callback -is not invoked from the glutDestroyWindow call, but at a -later time point.
    -freeglut sets the current window to the window -which is about to be closed when the callback is invoked. The window can -thus be retrieved in the callback using glutGetWindow.
    -Users looking to prevent freeglut from exiting when a window is -closed, should look into using glutSetOption to set -GLUT_ACTION_ON_WINDOW_CLOSE. Some settings will prevent the -application from exiting when a window is closed.
    -Please note that glutWMCloseFunc, a deprecated function, is an -alias to glutCloseFunc. - -

    Changes From GLUT

    - -

    This function is not implemented in GLUT.

    - -

    12.6 glutKeyboardFunc

    - -

    Has user-data callback function.

    - -

    12.7 glutSpecialFunc

    - -

    -The glutSpecialFunc function sets the window's special key press -callback. freeglut calls the special key press callback when the -user presses a special key. -

    - -

    Usage

    - -

    void glutSpecialFunc ( void (*func) -( int key, int x, int y ) );

    - -

    func The window's -new special key press callback function
    - key The -key whose press triggers the callback
    - x -The x-coordinate of the mouse relative -to the window at the time the key is pressed
    - y -The y-coordinate of the mouse relative -to the window at the time the key is pressed

    - -

    Has user-data callback function.

    - -

    Description

    - -

    -The glutSpecialFunc function specifies the function -that freeglut will call when the user -presses a special key on the keyboard. The callback function has one -argument: the name of the function to be invoked ("called back") at -the time at which the special key is pressed. The function returns no -value. freeglut sets the current window to the window -which is active when the callback is invoked. "Special keys" are the -function keys, the arrow keys, the Page Up and Page Down keys, and the Insert -key. The Delete key is considered to be a regular key.
    -Calling glutSpecialUpFunc with a NULL argument -disables the call to the window's special key press callback.

    - -

    -The key argument may take one of the following defined constant values: -

    - -
      -
    • GLUT_KEY_F1, GLUT_KEY_F2, ..., GLUT_KEY_F12 - F1 through F12 keys
    • -
    • GLUT_KEY_PAGE_UP, GLUT_KEY_PAGE_DOWN - Page Up and Page Down keys
    • -
    • GLUT_KEY_HOME, GLUT_KEY_END - Home and End keys
    • -
    • GLUT_KEY_LEFT, GLUT_KEY_RIGHT, GLUT_KEY_UP, GLUT_KEY_DOWN - Arrow keys
    • -
    • GLUT_KEY_INSERT - Insert key
    • -
    - -

    Changes From GLUT

    - -

    None.

    - -

    12.8 glutKeyboardUpFunc

    - -

    -The glutKeyboardUpFunc function sets the window's key release -callback. freeglut calls the key release callback when the user releases -a key. -

    - -

    Usage

    - -

    void glutKeyboardUpFunc ( void (*func) -( unsigned char key, int x, int y ) );

    - -

    func The window's -new key release callback function
    - key The -key whose release triggers the callback
    - x -The x-coordinate of the mouse relative -to the window at the time the key is released
    - y -The y-coordinate of the mouse relative -to the window at the time the key is released

    - -

    Has user-data callback function.

    - -

    Description

    - -

    -The glutKeyboardUpFunc -function specifies the function that freeglut will call when the -user releases a key from the keyboard. The callback function has one -argument: the name of the function to be invoked ("called back") at -the time at which the key is released. The function returns no value. -Freeglut sets the current window to the window which is -active when the callback is invoked.
    While freeglut checks -for upper or lower case letters, it does not do so for non-alphabetical -characters. Nor does it account for the Caps-Lock key being on. -The operating system may send some unexpected characters to -freeglut, such as "8" when the user is pressing the Shift -key. freeglut also invokes the callback when the user -releases the Control, Alt, or Shift keys, among others. Releasing -the Delete key causes this function to be invoked with a value of -127 for key.
    Calling glutKeyboardUpFunc with -a NULL argument disables the call to the window's key release callback. -

    - -

    Changes From GLUT

    - -

    This function is not implemented in GLUT -versions before Version 4. It has been designed to be as close to GLUT -as possible. Users who find differences should contact the -freeglut Programming Consortium to have them fixed.

    - -

    12.9 glutSpecialUpFunc

    - -

    -The glutSpecialUpFunc function sets the window's special key -release callback. freeglut calls the special key release callback -when the user releases a special key. -

    - -

    Usage

    - -

    void glutSpecialUpFunc ( void (*func) -( int key, int x, int y ) );

    - -

    func The window's -new special key release callback function
    - key The -key whose release triggers the callback
    - x -The x-coordinate of the mouse relative -to the window at the time the key is released
    - y -The y-coordinate of the mouse relative -to the window at the time the key is released

    - -

    Has user-data callback function.

    - -

    Description

    - -

    -The glutSpecialUpFuncfunction specifies the function that freeglut will call when the -user releases a special key from the keyboard. The callback function -has one argument: the name of the function to be invoked ("called back") -at the time at which the special key is released. The function returns -no value. freeglut sets the current window to the window -which is active when the callback is invoked. "Special keys" are the -function keys, the arrow keys, the Page Up and Page Down keys, and the Insert -key. The Delete key is considered to be a regular key.
    - Calling glutSpecialUpFunc with a NULL argument -disables the call to the window's special key release callback.

    - -

    -The key argument may take one of the following defined constant values:

    - -
      -
    • GLUT_KEY_F1, GLUT_KEY_F2, ..., GLUT_KEY_F12 - F1 through F12 keys
    • -
    • GLUT_KEY_PAGE_UP, GLUT_KEY_PAGE_DOWN - Page Up and Page Down keys
    • -
    • GLUT_KEY_HOME, GLUT_KEY_END - Home and End keys
    • -
    • GLUT_KEY_LEFT, GLUT_KEY_RIGHT, GLUT_KEY_UP, GLUT_KEY_DOWN - arrow keys
    • -
    • GLUT_KEY_INSERT - Insert key
    • -
    - -

    Changes From GLUT

    - -

    -This function is not implemented in GLUT -versions before Version 4. It has been designed to be as close to GLUT -as possible. Users who find differences should contact the -freeglut Programming Consortium to -have them fixed. -

    - -

    12.10 glutMotionFunc, glutPassiveMotionFunc

    - -

    Both functions have user-data callback functions.

    - -

    12.11 glutMouseFunc

    - -

    Has user-data callback function.

    - -

    12.12 glutMouseWheelFunc

    - -

    -The glutMouseWheelFunc function sets the window's mouse wheel -callback. freeglut calls the mouse wheel callback when the user -spins the mouse wheel. -

    - -

    Usage

    - -

    void glutMouseWheelFunc ( void( *callback )( int wheel, int -direction, int x, int y ));

    - -

    Has user-data callback function.

    - -

    Description

    - -

    If the mouse wheel is spun over your (sub)window, freeglut -will report this via the MouseWheel callback. wheel is the wheel -number, direction is +/- 1, and x and y are -the mouse coordinates.

    -If you do not register a wheel callback, wheel events will be reported -as mouse buttons. -

    - -

    Changes From GLUT

    - -

    This function is not implemented in GLUT.

    - -

    12.13 glutEntryFunc

    - -

    Has user-data callback function.

    - -

    12.14 glutJoystickFunc

    - -

    Has user-data callback function.

    - -

    12.15 glutSpaceballMotionFunc

    - -

    -The glutSpaceballMotionFunc function is implemented in -freeglut on X11 and Windows only. On other platforms, function stubs are -provided so that GLUT-based programs can compile and link against -freeglut without modification. -

    -

    The glutSpaceballMotionFunc function sets the window's Spaceball motion callback. freeglut invokes this callback when the user push/pull Spaceball cap in x, y, and z directions. -

    - -

    Usage

    - -

    void glutSpaceballMotionFunc ( void (* callback)( int x, int y, int z ) );

    - -

    Has user-data callback function.

    - -

    Description

    - -

    The x, y, and z arguments indicate the amount of translation in integer along x, y, and z axis respectively.

    -

    The x, y, and z axes form a common OpenGL right-handed coordinate system. A positive value of x, y, or z indicates movement along the positive direction of the respective axis, while the negative one denotes movement along negative direction.

    - -

    12.16 glutSpaceballRotateFunc

    - -

    -The glutSpaceballRotateFunc function is implemented in -freeglut on X11 and Windows only. On other platforms, function stubs are -provided so that GLUT-based programs can compile and link against -freeglut without modification. -

    -

    The glutSpaceballRotateFunc function sets the window's Spaceball rotation callback. freeglut invokes this callback when the user rotates/twists Spaceball cap. -

    - -

    Usage

    - -

    void glutSpaceballRotateFunc ( void (* callback)( int rx, int ry, int rz ) );

    - -

    Has user-data callback function.

    - -

    Description

    - -

    The rx, ry, and rz arguments indicate the amount of rotation in integer with respect to x, y, and z axis respectively.

    -

    The x, y, and z axes form a common OpenGL right-handed coordinate system. Positive value of rx, ry, or rz indicates counter-clock wise rotation along the respective axis, while negative one denotes clock wise rotation.

    - -

    12.17 glutSpaceballButtonFunc

    - -

    -The glutSpaceballButtonFunc function is implemented in -freeglut on X11 and Windows only. On other platforms, function stubs are -provided so that GLUT-based programs can compile and link against -freeglut without modification. -

    -

    -The glutSpaceballButtonFunc function sets the window's Spaceball button callback. freeglut invokes this callback when the user presses/releases one of the Spaceball buttons. -

    - -

    Usage

    - -

    void glutSpaceballButtonFunc ( void -(* callback)( int button, int updown ) );

    - -

    Has user-data callback function.

    - -

    Description

    - -

    The button argument may take one of the following defined -constant values:

    -
      -
    • GLUT_SPACEBALL_BUTTON_A (0x00000001)
    • -
    • GLUT_SPACEBALL_BUTTON_B (0x00000002)
    • -
    • GLUT_SPACEBALL_BUTTON_C (0x00000004)
    • -
    • GLUT_SPACEBALL_BUTTON_D (0x00000008)
    • -
    • GLUT_SPACEBALL_BUTTON_E (0x00000010)
    • -
    -

    The updown argument may take one of the two defined constant -values:

    -
      -
    • - GLUT_DOWN, GLUT_UP indicating if button is pressed or released. -
    • -
    - -

    Changes From GLUT

    - -

    -The GLUT_SPACEBALL_BUTTON_ defines for the button argument of -the callback are not provided by GLUT, but the numerical values returned -are the same. -

    - -

    12.18 glutButtonBoxFunc

    - -

    -The glutDialsFunc function sets the global dials&buttons box callback. freeglut calls the callback when there is input from the box buttons. -

    - -

    Usage

    - -

    -void glutButtonBoxFunc ( void (* callback)( int button, int updown ) ); -

    - -

    Has user-data callback function.

    - -

    Description

    - -

    -The Dials&Buttons box is an ancient device presenting several pushable -or rotatable buttons, sending the events to the computer via serial -I/O.
    - -See http://www.reputable.com/sgipix/sgi-dialnbutton1.jpg -[1] -for instance. -

    - -

    12.19 glutDialsFunc

    - -

    -The glutDialsFunc function sets the global dials&buttons box callback. freeglut calls the callback when there is input from the box dials. -

    - -

    Usage

    - -

    void glutDialsFunc ( void (* callback)( -int dial, int value ) );

    - -

    Has user-data callback function.

    - -

    Description

    - -

    -The Dials&Buttons box is an ancient device presenting several pushable -or rotatable buttons, sending the events to the computer via serial -I/O.
    - -See http://www.reputable.com/sgipix/sgi-dialnbutton1.jpg -[1] -for instance. -

    - -

    12.20 glutTabletMotionFunc

    - -

    -The glutTabletMotionFunc function is not implemented in -freeglut, although the library does "answer the mail" to the extent -that a call to the function will not produce an error.. -

    - -

    Usage

    - -

    -void glutTabletMotionFunc ( void (* callback)( int x, int y ) ); -

    - -

    Has user-data callback function.

    - -

    Description

    - -

    The glutTabletMotionFunc function -is not implemented in freeglut.

    - -

    Changes From GLUT

    - -

    GLUT implements this function.

    - -

    12.21 glutTabletButtonFunc

    - -

    -The glutTabletButtonFunc function is not implemented in -freeglut, although the library does "answer the mail" to the extent -that a call to the function will not produce an error.. -

    - -

    Usage

    - -

    void glutTabletButtonFunc ( void -(* callback)( int button, int updown, int x, int y ) );

    - -

    Has user-data callback function.

    - -

    Description

    - -

    -The glutTabletButtonFunc function -is not implemented in freeglut. -

    - -

    Changes From GLUT

    - -

    GLUT implements this function.

    - -

    12.22 glutVisibilityFunc, glutWindowStatusFunc

    - -

    -The glutVisibilityFunc and the glutWindowStatusFunc -functions set the window's visibility and windowStatus callbacks for the -current window. Setting one overwrites the other. freeglut calls -these callbacks when the visibility status of a window changes. -

    - -

    Usage

    - -

    void glutVisibilityFunc ( void( *callback )( int state )); -
    void glutWindowStatusFunc ( void( *callback )( int state )); -

    - -

    Both functions have user-data callback functions.

    - -

    Description

    - -

    -glutVisibilityFunc is deprecated and superseded by the more -informative glutWindowStatusFunc.
    -For glutWindowStatusFunc, the state callback parameter is one -of GLUT_HIDDEN, GLUT_FULLY_RETAINED, GLUT_PARTIALLY_RETAINED, or -GLUT_FULLY_COVERED depending on the current window status of the window. -GLUT_HIDDEN means that the window is not shown (often meaning that the -window is iconified). GLUT_FULLY_RETAINED means that the window is fully -retained (no pixels belonging to the window are covered by other -windows). GLUT_PARTIALLY_RETAINED means that the window is partially -retained (some but not all pixels belonging to the window are covered by -other windows). GLUT_FULLY_COVERED means the window is shown but no part -of the window is visible, i.e., until the window's status changes, all -further rendering to the window is discarded.
    -GLUT considers a window visible if any pixel of the window is visible or -any pixel of any descendant window is visible on the screen.
    -GLUT applications are encouraged to disable rendering and/or animation -when windows have a status of either GLUT_HIDDEN or -GLUT_FULLY_COVERED.
    -If the window status callback for a window is disabled and later -re-enabled, the window status of the window is undefined; any change in -window window status will be reported, that is if you disable a window -status callback and re-enable the callback, you are guaranteed the next -window status change will be reported.
    -Setting the window status callback for a window disables the visibility -callback set for the window (and vice versa). The visibility callback is -set with glutVisibilityFunc, and its -state callback parameter is either GLUT_NOT_VISIBLE or GLUT_VISIBLE -depending on the current visibility of the window. GLUT_VISIBLE does not -distinguish a window being totally versus partially visible. -GLUT_NOT_VISIBLE means no part of the window is visible, i.e., until the -window's visibility changes, all further rendering to the window is -discarded.
    -Not all window managers support such finegrained callback messages or -can even ensure basic correctness. On Windows, there are no -notifications if the visibility status of a window changes and -freeglut might be in visible state even if the window is fully -obscured by other windows. -

    - -

    Changes From GLUT

    - -

    None.

    - -

    13. State Setting and Retrieval Functions

    - -

    13.1 glutSetOption

    - -

    -Allows you to set some general state/option variables. -

    - -

    Usage

    - -

    -void glutSetOption ( GLenum eWhat, int value ); -

    - -

    Description

    - -

    Stores the value into a state variable named by -eWhat.

    -

    -The following state variables can be set: -

      -
    • GLUT_ACTION_ON_WINDOW_CLOSE - Controls what happens when a window is -closed by the user or system. GLUT_ACTION_EXIT will immediately exit the -application (default, GLUT's behavior). GLUT_ACTION_GLUTMAINLOOP_RETURNS -will immediately return from the main loop. -GLUT_ACTION_CONTINUE_EXECUTION will contine execution of remaining -windows.
    • -
    • GLUT_INIT_DISPLAY_MODE - Set the display mode for a new window, see -glutInitDisplayMode
    • -
    • GLUT_INIT_WINDOW_X - Set the initial horizontal position of new -windows.
    • -
    • GLUT_INIT_WINDOW_Y - Set the initial vertical position of new -windows.
    • -
    • GLUT_INIT_WINDOW_WIDTH - Set the width of new windows.
    • -
    • GLUT_INIT_WINDOW_HEIGHT - Set the height of new windows.
    • -
    • GLUT_RENDERING_CONTEXT - Set to either GLUT_CREATE_NEW_CONTEXT or -GLUT_USE_CURRENT_CONTEXT to indicate whether to share the current OpenGL -rendering context with new windows.
    • -
    • GLUT_WINDOW_CURSOR - Set the current window's cursor as if by -glutSetCursor().
    • -
    • GLUT_AUX - Set the number of auxiliary buffers requested for new -windows if GLUT_AUX was set in the displayMode.
    • -
    • GLUT_MULTISAMPLE - Set the number of samples to request for new -windows if GLUT_MULTISAMPLE was set in the displayMode.
    • -
    • GLUT_GEOMETRY_VISUALIZE_NORMALS - Set whether freeglut's geometric object rendering -functions also visualize the object's normals or not.
    • -
    • GLUT_STROKE_FONT_DRAW_JOIN_DOTS - Set whether join dots are drawn -between line segments when drawing letters of stroke fonts or not.
    • -
    • GLUT_ALLOW_NEGATIVE_WINDOW_POSITION - Set if negative positions can be -used for window coordinates.
    • -
    -

    - -

    Changes From GLUT

    - -

    This function is not implemented in GLUT.

    - -

    13.2 glutGet

    - - -

    -The following state variables may be queried with glutGet. -The returned value is an integer. -

    - -

    -example:
    -int windowLeft = glutGet(GLUT_WINDOW_X); -

    - -

    -These queries are with respect to the current window: -

    - -
      -
    • GLUT_WINDOW_X - window X position, see freeglut's conventions
    • -
    • GLUT_WINDOW_Y - window Y position, see freeglut's conventions
    • -
    • GLUT_WINDOW_WIDTH - window width, see freeglut's conventions
    • -
    • GLUT_WINDOW_HEIGHT - window height, see freeglut's conventions
    • -
    • GLUT_WINDOW_BORDER_WIDTH - window border width
    • -
    • GLUT_WINDOW_BORDER_HEIGHT - height of non-client area above window, -including both border and caption (if any)
    • -
    • GLUT_WINDOW_BUFFER_SIZE - number of color (including alpha) or color index bits per pixel
    • -
    • GLUT_WINDOW_STENCIL_SIZE - number of bits per stencil value
    • -
    • GLUT_WINDOW_DEPTH_SIZE - number of bits per depth value
    • -
    • GLUT_WINDOW_RED_SIZE - number of bits per red value
    • -
    • GLUT_WINDOW_GREEN_SIZE - number of bits per green value
    • -
    • GLUT_WINDOW_BLUE_SIZE - number of bits per blue value
    • -
    • GLUT_WINDOW_ALPHA_SIZE - number of bits per alpha value
    • -
    • GLUT_WINDOW_ACCUM_RED_SIZE - number of red bits in the accumulation buffer
    • -
    • GLUT_WINDOW_ACCUM_GREEN_SIZE - number of green bits in the accumulation buffer
    • -
    • GLUT_WINDOW_ACCUM_BLUE_SIZE - number of blue bits in the accumulation buffer
    • -
    • GLUT_WINDOW_ACCUM_ALPHA_SIZE - number of alpha bits in the accumulation buffer
    • -
    • GLUT_WINDOW_DOUBLEBUFFER - 1 if the color buffer is double buffered, 0 otherwise
    • -
    • GLUT_WINDOW_RGBA - 1 if the color buffers are RGB[A], 0 for color index
    • -
    • GLUT_WINDOW_PARENT - parent window ID
    • -
    • GLUT_WINDOW_NUM_CHILDREN - number of child windows
    • -
    • GLUT_WINDOW_COLORMAP_SIZE - number of entries in the window's colormap
    • -
    • GLUT_WINDOW_NUM_SAMPLES - number of samples per pixel if using multisampling
    • -
    • GLUT_WINDOW_STEREO - 1 if the window supports stereo, 0 otherwise
    • -
    • GLUT_WINDOW_CURSOR - current cursor
    • -
    • GLUT_WINDOW_FORMAT_ID - on Windows, return the pixel format number of the current window
    • -
    • GLUT_FULL_SCREEN - 1 if window is currently in fullscreen mode
    • -
    - -

    -These queries do not depend on the current window. -

    - -
      -
    • GLUT_SCREEN_WIDTH - width of the screen in pixels
    • -
    • GLUT_SCREEN_HEIGHT - height of the screen in pixels
    • -
    • GLUT_SCREEN_WIDTH_MM - width of the screen in millimeters
    • -
    • GLUT_SCREEN_HEIGHT_MM - height of the screen in millimeters
    • -
    • GLUT_MENU_NUM_ITEMS - number of items in the current menu
    • -
    • GLUT_DISPLAY_MODE_POSSIBLE - return 1 if the current display mode is supported, 0 otherwise
    • -
    • GLUT_INIT_WINDOW_X - X position last set by glutInitWindowPosition
    • -
    • GLUT_INIT_WINDOW_Y - Y position last set by glutInitWindowPosition
    • -
    • GLUT_INIT_WINDOW_WIDTH - width last set by glutInitWindowSize
    • -
    • GLUT_INIT_WINDOW_HEIGHT - height last set by glutInitWindowSize
    • -
    • GLUT_INIT_DISPLAY_MODE - display mode last set by -glutInitDisplayMode or glutSetOption(GLUT_INIT_DISPLAY_MODE, value)
    • -
    • GLUT_ELAPSED_TIME - time (in milliseconds) elapsed since glutInit or glutGet(GLUT_ELAPSED_TIME) was first called
    • -
    • GLUT_INIT_STATE - 1 if freeglut has been initialized through - a call to glutInit
    • -
    • GLUT_VERSION - Return value will be X*10000+Y*100+Z where X is the - major version, Y is the minor version and Z is the patch level. - This query is only supported in freeglut (version 2.0.0 or later).
    • -
    • GLUT_ALLOW_NEGATIVE_WINDOW_POSITION - 1 if negative window positions are enabled, 0 otherwise
    • -
    - -

    13.3 glutDeviceGet

    - -

    13.4 glutGetModifiers

    - -

    13.5 glutLayerGet

    - -

    13.6 glutExtensionSupported

    - -

    13.7 glutGetProcAddress

    - -

    -glutGetProcAddress returns -a pointer to a named GL or freeglut function. -

    - -

    Usage

    - -

    void *glutGetProcAddress ( const char *procName );

    - -

    procName Name of an OpenGL or GLUT function.

    - -

    Description

    - -

    -glutGetProcAddress is useful -for dealing with OpenGL extensions. If an application calls OpenGL extension -functions directly, that application will only link/run with an OpenGL library -that supports the extension. By using a function pointer returned from glutGetProcAddress(), -the application will avoid this hard dependency and be more portable and interoperate -better with various implementations of OpenGL. -

    - -

    -Both OpenGL functions and freeglut -functions can be queried with this function. -

    - -

    Changes From GLUT

    - -

    GLUT does not include this function. -

    - -

    14. Font Rendering Functions

    - -

    -freeglut supports two types of font rendering: bitmap fonts, -which are rendered using the glBitmap function call, and stroke -fonts, which are rendered as sequences of OpenGL line segments. Because -they are rendered as bitmaps, the bitmap fonts tend to render more quickly -than stroke fonts, but they are less flexible in terms of scaling and rendering. -Bitmap font characters are positioned with calls to the glRasterPos* -functions while stroke font characters use the OpenGL transformations -to position characters. -

    - -

    -It should be noted that freeglut fonts are similar but not identical to GLUT fonts. -At the moment, freeglut fonts do not support the "`" (backquote) and -"|" (vertical line) characters; in their place it renders asterisks. -

    - -

    -freeglut supports the following bitmap fonts: -

    - -
      -
    • GLUT_BITMAP_8_BY_13 - A variable-width font with every character fitting in a rectangle of 13 pixels high by at most 8 pixels wide.
    • -
    • GLUT_BITMAP_9_BY_15 - A variable-width font with every character fitting in a rectangle of 15 pixels high by at most 9 pixels wide.
    • -
    • GLUT_BITMAP_TIMES_ROMAN_10 - A 10-point variable-width Times Roman font.
    • -
    • GLUT_BITMAP_TIMES_ROMAN_24 - A 24-point variable-width Times Roman font.
    • -
    • GLUT_BITMAP_HELVETICA_10 - A 10-point variable-width Helvetica font.
    • -
    • GLUT_BITMAP_HELVETICA_12 - A 12-point variable-width Helvetica font.
    • -
    • GLUT_BITMAP_HELVETICA_18 - A 18-point variable-width Helvetica font.
    • -
    - -

    -freeglut calls glRasterPos4v to advance the cursor by -the width of a character and to render carriage returns when appropriate. -It does not use any display lists in it rendering in bitmap fonts. -

    - -

    -freeglut supports -the following stroke fonts: -

    - -
      -
    • GLUT_STROKE_ROMAN - A proportionally-spaced Roman Simplex font
    • -
    • GLUT_STROKE_MONO_ROMAN - A fixed-width Roman Simplex font
    • -
    - -

    -freeglut does not use any display lists in its rendering of stroke -fonts. It calls glTranslatef to advance the cursor by the -width of a character and to render carriage returns when appropriate. -

    - -

    14.1 glutBitmapCharacter

    - -

    -The glutBitmapCharacter function renders a single bitmapped -character in the current window using the specified font. -

    - -

    Usage

    - -

    void glutBitmapCharacter ( void *font, -int character );

    - -

    font -The bitmapped font to use in rendering -the character
    - character The ASCII -code of the character to be rendered

    - -

    Description

    - -

    -The glutBitmapCharacter function renders the given character in the specified bitmap font. -freeglut automatically sets the necessary -pixel unpack storage modes and restores the existing modes when it has finished. -Before the first call to glutBitMapCharacter the application -program should call glRasterPos* to set the position of the character -in the window. The glutBitmapCharacter function advances -the cursor position as part of its call to glBitmap and so the -application does not need to call glRasterPos* again for successive -characters on the same line.

    - -

    Changes From GLUT

    - -

    Nonexistent characters are rendered as -asterisks. The rendering position in freeglut is apparently off -from GLUT's position by a few pixels vertically and one or two pixels horizontally. -

    - -

    14.2 glutBitmapString

    - -

    -The glutBitmapString function renders a string of bitmapped -characters in the current window using the specified font. -

    - -

    Usage

    - -

    void glutBitmapString ( void *font, -char *string );

    - -

    font -The bitmapped font to use in rendering -the character string
    - string String -of characters to be rendered

    - -

    Description

    - -

    -The glutBitmapString function renders the given character -string in the specified bitmap font. -freeglut automatically sets the necessary -pixel unpack storage modes and restores the existing modes when it has finished. -Before calling glutBitMapString the application program should -call glRasterPos* to set the position of the string in the window. -The glutBitmapString function handles carriage returns. -Nonexistent characters are rendered as asterisks.

    - -

    Changes From GLUT

    - -

    GLUT does not include this function. -

    - -

    14.3 glutBitmapWidth

    - -

    -The glutBitmapWidth function returns the width in pixels of -a single bitmapped character in the specified font. -

    - -

    Usage

    - -

    int glutBitmapWidth ( void *font, -int character );

    - -

    font -The bitmapped font to use in calculating -the character width
    - character The ASCII -code of the character

    - -

    Description

    - -

    The glutBitmapWidth -function returns the width of the given character in the specified bitmap -font. Because the font is bitmapped, the width is an exact integer. -

    - -

    Changes From GLUT

    - -

    Nonexistent characters return the width -of an asterisk.

    - -

    14.4 glutBitmapLength

    - -

    -The glutBitmapLength function returns the width in pixels of -a string of bitmapped characters in the specified font. -

    - -

    Usage

    - -

    int glutBitmapLength ( void *font, -char *string );

    - -

    font The bitmapped -font to use in calculating the character width
    - string String of characters -whose width is to be calculated

    - -

    Description

    - -

    The glutBitmapLength function returns the width in pixels of the given character string in -the specified bitmap font. Because the font is bitmapped, the width -is an exact integer: the return value is identical to the sum of the -character widths returned by a series of calls to glutBitmapWidth. -The width of nonexistent characters is counted to be the width of -an asterisk.

    - -

    If the string contains -one or more carriage returns, freeglut calculates the widths in pixels -of the lines separately and returns the largest width.

    - -

    Changes From GLUT

    - -

    GLUT does not include this function. -

    - -

    14.5 glutBitmapHeight

    - -

    -The glutBitmapHeight function returns the height in pixels of -the specified font. -

    - -

    Usage

    - -

    int glutBitmapHeight ( void *font -);

    - -

    font -The bitmapped font to use in calculating -the character height

    - -

    Description

    - -

    The glutBitmapHeight function returns the height of a character in the specified bitmap font. -Because the font is bitmapped, the height is an exact integer. The fonts -are designed such that all characters have (nominally) the same height. -

    - -

    Changes From GLUT

    - -

    GLUT does not include this function. -

    - -

    14.6 glutStrokeCharacter

    - -

    -The glutStrokeCharacter function renders a single stroke character -in the current window using the specified font. -

    - -

    Usage

    - -

    -void glutStrokeCharacter ( void *font, int character ); -

    - -

    fontThe stroke font to use in rendering the character
    - characterThe ASCII code of the character to be rendered -

    - -

    Description

    - -

    -The glutStrokeCharacter function renders the given character in the specified stroke font. -Before the first call to glutStrokeCharacter the application program -should call the OpenGL transformation (positioning and scaling) functions -to set the position of the character in the window. The glutStrokeCharacter -function advances the cursor position by a call to glTranslatef -and so the application does not need to call the OpenGL positioning functions -again for successive characters on the same line. -

    - -

    Changes From GLUT

    - -

    Nonexistent characters are rendered as -asterisks.

    - -

    14.7 glutStrokeString

    - -

    -The glutStrokeString function renders a string of characters -in the current window using the specified stroke font. -

    - -

    Usage

    - -

    void glutStrokeString ( void *font, -char *string );

    - -

    font -The stroke font to use in rendering -the character string
    - string String -of characters to be rendered

    - -

    Description

    - -

    -The glutStrokeString function renders the given character string in the specified stroke font. -Before calling glutStrokeString the application program should -call the OpenGL transformation (positioning and scaling) functions to set -the position of the string in the window. The glutStrokeString -function handles carriage returns. Nonexistent characters are rendered -as asterisks.

    - -

    Changes From GLUT

    - -

    GLUT does not include this function. -

    - -

    14.8 glutStrokeWidth

    - -

    -The glutStrokeWidth function returns the width in model units of -a single character in the specified stroke font, rounded to an int. -

    - -

    Usage

    - -

    int glutStrokeWidth ( void *font, -int character );

    - -

    font -The stroke font to use in calculating -the character width
    - character The ASCII -code of the character

    - -

    Description

    - -

    -The glutStrokeWidth -function returns the width of the given character in the specified stroke -font. Because the font is a stroke font, the width is actually a floating-point -number; the function rounds it to the nearest integer for the return value. -

    - -

    Changes From GLUT

    - -

    Nonexistent characters return the width -of an asterisk.

    - -

    14.9 glutStrokeWidthf

    - -

    -The glutStrokeWidthf function returns the width in model units of -a single character in the specified stroke font. -

    - -

    Usage

    - -

    GLfloat glutStrokeWidthf ( void *font, -int character );

    - -

    font -The stroke font to use in calculating -the character width
    - character The ASCII -code of the character

    - -

    Description

    - -

    -The glutStrokeWidthf -function returns the width of the given character in the specified stroke -font. Function was included in an unreleased GLUT 3.8. -

    - -

    Changes From GLUT

    - -

    Nonexistent characters return the width -of an asterisk.

    - -

    14.10 glutStrokeLength

    - -

    -The glutStrokeLength function returns the width in model units of -a string of characters in the specified stroke font, rounded to an int. -

    - -

    Usage

    - -

    int glutStrokeLength ( void *font, -char *string );

    - -

    font The stroke -font to use in calculating the character width
    - string String of characters -whose width is to be calculated

    - -

    Description

    - -

    -The glutStrokeLength function returns the width in model units of the given character string in -the specified stroke font. Because the font is a stroke font, the width -of an individual character is a floating-point number. freeglut - adds the floating-point widths and rounds the final result to return the -integer value. Thus the return value may differ from the sum of the -character widths returned by a series of calls to glutStrokeWidth. -The width of nonexistent characters is counted to be the width -of an asterisk.

    - -

    If the string contains -one or more carriage returns, freeglut calculates the widths in pixels -of the lines separately and returns the largest width.

    - -

    14.11 glutStrokeLengthf

    - -

    -The glutStrokeLengthf function returns the width in model units of -a string of characters in the specified stroke font. -

    - -

    Usage

    - -

    GLfloat glutStrokeLengthf ( void *font, -char *string );

    - -

    font The stroke -font to use in calculating the character width
    - string String of characters -whose width is to be calculated

    - -

    Description

    - -

    -The glutStrokeLengthf function returns the width in model units of the given character string in -the specified stroke font. The return value is equal to the sum of the -character widths returned by a series of calls to -glutStrokeWidthf. Function was included in an unreleased GLUT 3.8. -The width of nonexistent characters is counted to be the width -of an asterisk.

    - -

    If the string contains -one or more carriage returns, freeglut calculates the widths in pixels -of the lines separately and returns the largest width.

    - -

    14.12 glutStrokeHeight

    - -

    -The glutStrokeHeight function returns the height in pixels of -the specified font. -

    - -

    Usage

    - -

    GLfloat glutStrokeHeight ( void *font -);

    - -

    font -The stroke font to use in calculating -the character height

    - -

    Description

    - -

    -The glutStrokeHeight function returns the height of a character in the specified stroke font. -The application programmer should note that, unlike the other freeglut - font functions, this one returns a floating-point number. The fonts -are designed such that all characters have (nominally) the same height.

    - -

    Changes From GLUT

    - -

    GLUT does not include this function. -

    - -

    15. Geometric Object Rendering Functions

    - -

    -freeglut includes twenty two routines for generating -easily-recognizable 3-d geometric objects. These routines are -effectively the same ones that are included in the GLUT library, and -reflect the functionality available in the aux toolkit described -in the OpenGL Programmer's Guide. They are included to allow -programmers to create with a single line of code a three-dimensional -object which can be used to test a variety of OpenGL functionality. -None of the routines generates a display list for the object which it -draws. The functions generate normals appropriate for lighting but, -except for the teapot functions, do not generate texture coordinates. Do -note that depth testing (GL_LESS) should be enabled for the correct -drawing of the nonconvex objects, i.e., the glutTorus, -glutSierpinskiSponge, glutTeapot, glutTeacup and glutTeaspoon.
    -Also see the GLUT_GEOMETRY_VISUALIZE_NORMALS option that can be -set with glutSetOption. Lastly, see -glutSetVertexAttribCoord3, glutSetVertexAttribNormal, -and glutSetVertexAttribTexCoord2 if you wish to use these -objects with shaders. -

    - -

    15.1 glutWireSphere, glutSolidSphere

    - -

    -The glutWireSphere and glutSolidSphere functions -draw a wireframe and solid sphere respectively. -

    - -

    Definition

    - -

    -void glutWireSphere (double dRadius, GLint slices, GLint stacks);
    -void glutSolidSphere(double dRadius, GLint slices, GLint stacks);

    - -

    Arguments

    -

    dRadius  The desired radius of the sphere

    - -

    slices   The desired number of slices (divisions -in the longitudinal direction) in the sphere

    - -

    stacks   The desired number of stacks (divisions -in the latitudinal direction) in the sphere. The number of points in -this direction, including the north and south poles, is stacks+1

    - -

    Description

    - -

    The glutWireSphere and - glutSolidSphere functions render a sphere centered at the origin -of the modeling coordinate system. The north and south poles of the -sphere are on the positive and negative Z-axes respectively and the prime -meridian crosses the positive X-axis.

    - -

    Changes From GLUT

    - -

    None that we know of.

    - -

    15.2 glutWireTorus, glutSolidTorus

    - - -

    -The glutWireTorus and glutSolidTorus functions draw -a wireframe and solid torus (donut shape) respectively. -

    - -

    Definition

    - -

    -void glutWireTorus (double dInnerRadius, double dOuterRadius, GLint -nSides, GLint nRings);
    -void glutSolidTorus(double dInnerRadius, double dOuterRadius, GLint -nSides, GLint nRings);

    - -

    Arguments

    -

    dInnerRadius  The radius of the tube.

    - -

    dOuterRadius  The distance from the center of the -Torus to the center of the tube.

    - -

    nSides        The desired number of segments in a -single outer circle of the torus

    - -

    nRings        The desired number of outer circles -around the origin of the torus

    - -

    Description

    - -

    The glutWireTorus and - glutSolidTorus functions render a torus centered at the origin of -the modeling coordinate system. The torus is circularly symmetric about -the Z-axis and starts at the positive X-axis.

    - -

    Changes From GLUT

    - -

    None that we know of.

    - -

    15.3 glutWireCylinder, glutSolidCylinder

    - -

    -The glutWireCylinder and glutSolidCylinder functions draw -a wireframe and solid cone respectively. -

    - -

    Definition

    - -

    -void glutWireCylinder (double base, double height, GLint slices, GLint -stacks);
    -void glutSolidCylinder(double base, double height, GLint slices, GLint -stacks);

    - -

    Arguments

    -

    radius  The desired radius of the cylinder

    - -

    height  The desired height of the cylinder

    - -

    slices  The desired number of slices around -the cylinder

    - -

    stacks  The desired number of segments between -the base and the top of the cylinder (the number of points, including -the tip, is stacks + 1)

    - -

    15.4 glutWireCone, glutSolidCone

    - -

    -The glutWireCone and glutSolidCone functions draw -a wireframe and solid cone respectively. -

    - -

    Definition

    - -

    -void glutWireCone (double base, double height, GLint slices, GLint -stacks);
    -void glutSolidCone(double base, double height, GLint slices, GLint -stacks);

    - -

    Arguments

    -

    base    The desired radius of the base of the cone

    - -

    height  The desired height of the cone

    - -

    slices  The desired number of slices around -the base of the cone

    - -

    stacks  The desired number of segments between -the base and the tip of the cone (the number of points, including the tip, -is stacks + 1)

    - -

    Description

    - -

    The glutWireCone and - glutSolidCone functions render a right circular cone with a base -centered at the origin and in the X-Y plane and its tip on the positive Z-axis. -The wire cone is rendered with triangular elements.

    - -

    Changes From GLUT

    - -

    None that we know of.

    - -

    15.5 glutWireCube, glutSolidCube

    - -

    -The glutWireCube and glutSolidCube functions draw a -wireframe and solid cube respectively. -

    - -

    Definition

    - -

    -void glutWireCube (double dSize);
    -void glutSolidCube(double dSize);

    - -

    Arguments

    -

    dSize  The desired length of an edge of the cube

    - -

    Description

    - -

    The glutWireCube and - glutSolidCube functions render a cube of the desired size, centered -at the origin. Its faces are normal to the coordinate directions.

    - -

    Changes From GLUT

    - -

    None that we know of.

    - -

    15.6 glutWireTetrahedron, glutSolidTetrahedron

    - -

    -The glutWireTetrahedron and glutSolidTetrahedron -functions draw a wireframe and solid tetrahedron (four-sided Platonic solid) -respectively. -

    - -

    Definition

    - -

    -void glutWireTetrahedron (void);
    -void glutSolidTetrahedron(void);

    - -

    Description

    - -

    The glutWireTetrahedron and -glutSolidTetrahedron functions render a tetrahedron whose corners -are each a distance of one from the origin. The length of each side -is 2/3 sqrt(6). One corner is on the positive X-axis and another is -in the X-Y plane with a positive Y-coordinate.

    - -

    Changes From GLUT

    - -

    None that we know of.

    - -

    15.7 glutWireOctahedron, glutSolidOctahedron

    - -

    -The glutWireOctahedron and glutSolidOctahedron functions -draw a wireframe and solid octahedron (eight-sided Platonic solid) respectively. -

    - -

    Definition

    - -

    -void glutWireOctahedron (void);
    -void glutSolidOctahedron(void);

    - -

    Description

    - -

    The glutWireOctahedron and -glutSolidOctahedron functions render an octahedron whose corners -are each a distance of one from the origin. The length of each side -is sqrt(2). The corners are on the positive and negative coordinate -axes.

    - -

    Changes From GLUT

    - -

    None that we know of.

    - -

    15.8 glutWireDodecahedron, glutSolidDodecahedron

    - -

    -The glutWireDodecahedron and glutSolidDodecahedron -functions draw a wireframe and solid dodecahedron (twelve-sided Platonic -solid) respectively. -

    - -

    Definition

    - -

    -void glutWireDodecahedron (void);
    -void glutSolidDodecahedron(void);

    - -

    Description

    - -

    The glutWireDodecahedron and -glutSolidDodecahedron functions render a dodecahedron whose corners -are each a distance of sqrt(3) from the origin. The length of each -side is sqrt(5)-1. There are twenty corners; interestingly enough, -eight of them coincide with the corners of a cube with sizes of length 2. -

    - -

    Changes From GLUT

    - -

    None that we know of.

    - -

    15.9 glutWireIcosahedron, glutSolidIcosahedron

    - -

    -The glutWireIcosahedron and glutSolidIcosahedron -functions draw a wireframe and solid icosahedron (twenty-sided Platonic solid) -respectively. -

    - -

    Definition

    - -

    -void glutWireIcosahedron (void);
    -void glutSolidIcosahedron(void);

    - -

    Description

    - -

    -The glutWireIcosahedron and -glutSolidIcosahedron functions render an icosahedron whose corners -are each a unit distance from the origin. The length of each side is -slightly greater than one. Two of the corners lie on the positive and -negative X-axes. -

    - -

    Changes From GLUT

    - -

    None that we know of.

    - -

    15.10 glutWireRhombicDodecahedron, glutSolidRhombicDodecahedron

    - -

    -The glutWireRhombicDodecahedron and glutSolidRhombicDodecahedron -functions draw a wireframe and solid rhombic dodecahedron (twelve-sided -semi-regular solid) respectively. -

    - -

    Definition

    - -

    -void glutWireRhombicDodecahedron (void);
    -void glutSolidRhombicDodecahedron(void);

    - -

    Description

    - -

    -The glutWireRhombicDodecahedron and glutSolidRhombicDodecahedron -functions render a rhombic -dodecahedron whose corners are at most a distance of one from the origin. -The rhombic dodecahedron has faces which are identical rhombuses (rhombi?) -but which have some vertices at which three faces meet and some vertices at -which four faces meet. The length of each side is sqrt(3)/2. Vertices -at which four faces meet are found at (0, 0, +/- 1) and (+/- sqrt(2)/2, -+/- sqrt(2)/2, 0). -

    - -

    Changes From GLUT

    - -

    GLUT does not include these functions. -

    - -

    15.11 glutWireTeapot, glutSolidTeapot, glutWireTeacup, -glutSolidTeacup, glutWireTeaspoon, glutSolidTeaspoon

    - -

    -The glutWireTeapot and glutSolidTeapot functions draw -a wireframe and solid teapot respectively, the glutWireTeacup -and glutSolidTeacup functions a wireframe and solid teacup, and -the glutWireTeaspoon and glutSolidTeaspoon functions a -wireframe and solid teaspoon. -

    - -

    Definition

    - -

    -void glutWireTeapot   (double dSize);
    -void glutSolidTeapot  (double dSize);
    -void glutWireTeacup   (double dSize);
    -void glutSolidTeacup  (double dSize);
    -void glutWireTeaspoon (double dSize);
    -void glutSolidTeaspoon(double dSize);

    - -

    Arguments

    -

    dSize  The desired size of the teapot, teacup and -teaspoon - relative to a "standard" size

    - -

    Description

    - -

    The glutWireTeapot and glutSolidTeapot functions -render a teapot of the desired size, centered at the origin. This is the -famous teapot created by Martin Newell. The other functions render the -teacup and teaspoon he used in the table scene figure in his PhD thesis. -Vertex data retrieved from: ftp://ftp.funet.fi/pub/sci/graphics/packages/objects/teasetorig.gz.

    - -

    Bugs

    -

    OpenGL's default glFrontFace state assumes that front facing -polygons (for the purpose of face culling) have vertices that wind -counter clockwise when projected into window space. This teapot, teacup -and teaspoon are rendered with their front facing polygon vertices -winding clockwise. For OpenGL's default back face culling to work, you -should use:

    - -

      glFrontFace(GL_CW);
    -  glutSolidTeapot(size);
    -  glFrontFace(GL_CCW);

    - -

    This bug reflect issues in the original teaset's vertex data -(and is thus present in GLUT too).

    - -

    Changes From GLUT

    - -

    GLUT only has the teapot and misses the rest of the teaset.

    - -

    15.12 glutSetVertexAttribCoord3, glutSetVertexAttribNormal, glutSetVertexAttribTexCoord2

    -

    -To draw shapes with shaders (OpenGL 2 and later), one need to upload -vertices and associated normal vectors and texture coordinates to -vertex attributes of your shaders. Use these functions to set the -indices (addresses) of the vertex attributes in your currently active -shaders before calling the above geometry functions, and freeglut -will upload the object geometry there. Texture coordinates are only -generated for the teapot, teacup and teaspoon. -

    - -

    Definition

    - -

    -void glutSetVertexAttribCoord3   (GLint attrib);
    -void glutSetVertexAttribNormal   (GLint attrib);
    -void glutSetVertexAttribTexCoord2(GLint attrib);

    - -

    Arguments

    -

    attrib  The index (address) of the vertex -attribute

    - -

    Changes From GLUT

    - -

    GLUT does not include these functions.

    - -

    16. Game Mode Functions

    - -

    16.1 glutGameModeString

    - -

    -Specify the display mode that should be entered when GameMode is -entered. Default is the current display mode of the monitor on which the -GameMode screen will be opened. -

    - -

    Usage
    -A string is passed to this function that specifies a combination of -resolution, pixel depth (ignored on Linux) and refresh rate. Valid -formats are: -

      -
    • WxH:D@R
    • -
    • WxH:D
    • -
    • WxH@R
    • -
    • WxH
    • -
    • :D@R
    • -
    • :D
    • -
    • @R
    • -
    -Where W, H, D and R are placeholders for horizontal resolution, vertical -resolution, pixel depth and refresh rate respectively, as integers. Note -the "x", ":" and "@" characters. -

    - -

    16.2 glutEnterGameMode, glutLeaveGameMode

    - -

    -Attempt to change to the requested display mode and open the GameMode -window, or close the GameMode window and return to the original display -mode. -For multi-monitor display setups, freeglut can be told on which -monitor the gamemode window should be opened by providing the --display command line option to glutInit. -

    - -

    16.3 glutGameModeGet

    - -

    -The following state variables may be queried with glutGet. -The returned value is an integer. -

    - -

    -example:
    -int windowLeft = glutGet(GLUT_WINDOW_X); -

    - -
      -
    • GLUT_GAME_MODE_ACTIVE - 1 if currently in GameMode
    • -
    • GLUT_GAME_MODE_DISPLAY_CHANGED - 1 if currently in GameMode
    • -
    • GLUT_GAME_MODE_POSSIBLE - 1 if display mode requested with - glutGameModeString is possible
    • -
    - -

    -These queries return information about the current display mode if in -GameMode, or about the requested display mode before entering -GameMode: -

    - -
      -
    • GLUT_GAME_MODE_WIDTH - (requested) width of GameMode window
    • -
    • GLUT_GAME_MODE_HEIGHT - (requested) height of GameMode window
    • -
    • GLUT_GAME_MODE_PIXEL_DEPTH - (requested) pixel depth of GameMode window
    • -
    • GLUT_GAME_MODE_REFRESH_RATE - (requested) refresh rate of GameMode window
    • -
    - -

    17. Video Resize Functions

    - -

    These functions are not implemented in freeglut.

    - -

    17.1 glutVideoResizeGet

    - -

    17.2 glutSetupVideoResizing, -glutStopVideoResizing

    - -

    17.3 glutVideoResize

    - -

    17.4 glutVideoPan

    - -

    18. Color Map Functions

    - -

    18.1 glutSetColor, glutGetColor

    - -

    18.2 glutCopyColormap

    - -

    19. MultiTouch Functions

    - -MultiTouch callbacks are used to handle environments with multiple -inputs, such as a multi-touch screen, multi-touch touchpad, or -multiple mouses.
    - -

    19.1 glutMultiEntryFunc ← id, GLUT_ENTERED|GLUT_LEFT

    -

    19.2 glutMultiButtonFunc ← id, x, y, button, GLUT_DOWN|GLUT_UP

    -

    19.3 glutMultiMotionFunc ← id, x, y

    -

    19.4 glutMultiPassiveFunc ← id, x, y

    - -These functions work like their non-multi variants, with an additional -'deviceid' parameter describing the current input device (mouse or -finger).
    - -Exception: in MultiButtonFunc, the order of callback parameters is -different (x,y,button,state instead of button,state,x,y).
    - -Currently, under X11, the non-multi callback variants are also called -on X11 for each event.
    - -Currently, under windows, the first (oldest) touch point also controls -the mouse cursor, which triggers the non-multi callbacks as -usual.
    - -All these functions have user-data callback functions. - -
    - -Limitation: currently on the cursor id is provided. It may be -desirable to get the device id as well in the following situations: - -
      - -
    • Support a 2-fingers gesture such as pinch-to-zoom on the - touchscreen, while the mouse pointer or touchpad is performing an - unrelated action, not part of the touchscreen gesture (may not be - possible on some platforms).
    • - -
    • Avoid touch id conflicts between touchscreen and - touchpad/gamepad on Android; a possible work-around is to shift the - device id in the touch id.
    • - -
    - -

    Since this extra support comes at the cost of extra complexity, we're -considering -whether/how to implement it.

    - -

    20. Mobile Functions

    - -

    These new callbacks were added:

    - -
      -
    • glutInitContextFunc ← void : called when the context -is initialized or re-initialized (e.g. after a pause). Has user-data callback -function.
    • -
    • glutAppStatusFunc ← event : called when the -application's status changes, with event identifying the state entered. Has -user-data callback function. -Possible states: -
        -
      • application goes on a pause (or a stop) → GLUT_APPSTATUS_PAUSE
      • -
      • application comes back from a pause → GLUT_APPSTATUS_RESUME. Is -called after the glutInitContextFunc callback.
      • -
      -
    - -

    Supported mobile platforms

    -
      -
    • Android support is further described at -the Android page.
    • -
    • BlackBerry 10/BlackBerry PlayBook
    • -
    - -

    21. Miscellaneous Functions

    - -

    21.1 glutSetKeyRepeat, glutIgnoreKeyRepeat

    - -

    -The glutSetKeyRepeat and glutIgnoreKeyRepeat functions -set whether repeated key presses (generated by keeping a key depressed) -are passed on to the keyboard callbacks. glutSetKeyRepeat -allows to globally switch off key repeat, while -glutIgnoreKeyRepeat offers control over this behavior on a -per-window basis. -

    - -

    Definition

    - -

    -void glutSetKeyRepeat   (int repeatMode);
    -void glutIgnoreKeyRepeat(int ignore);

    - -

    Arguments

    -

    glutSetKeyRepeat's repeatMode   -GLUT_KEY_REPEAT_OFF to globally switch key repeat off, or -GLUT_KEY_REPEAT_ON and GLUT_KEY_REPEAT_DEFAULT to globally switch key -repeat on.
    -glutIgnoreKeyRepeat's ignore    if non-zero, key -repeat is switched off for the current window.

    - -

    Notes

    - -

    If key repeat is globally switched off through -glutSetKeyRepeat, it cannot be reenabled on a per-window basis -with glutIgnoreKeyRepeat. If you want per-window control of key -repeat, set glutSetKeyRepeat to GLUT_KEY_REPEAT_ON and -use glutIgnoreKeyRepeat(GL_TRUE) to switch off key repeat for -the windows for which you don't want it.

    - -

    Changes From GLUT

    - -

    Nate Robbins' port of GLUT to win32 did not implement -glutSetKeyRepeat, but freeglut's behavior should conform on all -platforms to GLUT's behavior on X11.

    - -

    21.2 glutForceJoystickFunc

    - -

    21.3 glutReportErrors

    - -

    22. Usage Notes

    - -

    The following environment variables -are recognized by freeglut: -

    - -
      -
    • DISPLAY - specifies a display name.
    • -
    • GLUT_FPS - specifies a time interval - (in milliseconds) for reporting framerate messages to stderr. For example, - if FREEGLUT_FPS is set to 5000, every 5 seconds a message will be printed - to stderr showing the current frame rate. The frame rate is measured by counting - the number of times glutSwapBuffers() is called over the time interval.
    • -
    - -

    -Furthermore, on windows, there is a resource file identifier GLUT_ICON -that you can specify for your executable file. It specifies the icon -that goes in the upper left-hand corner of the freeglut windows. -Your application's resource file should contain the line:
    -GLUT_ICON ICON DISCARDABLE "icon.ico"
    where -icon.ico is the filename of your icon. The One demo includes such an -icon as an example. -

    - -

    21.1 Implementation Notes

    - -

    21.2 GLUT State

    - -

    21.3 "freeglut.h" Header File

    - -

    -Application programmers who are porting their GLUT programs to freeglut may continue -to include <GL/glut.h> in their programs. -Programs which use the freeglut-specific extensions to GLUT should include -<GL/freeglut.h>. One possible arrangement is as follows: -

    - -
    -#ifdef FREEGLUT
    -#include <GL/freeglut.h>
    -#else
    -#include <GL/glut.h>
    -#endif
    -
    - -

    -It was initially planned to -define FREEGLUT_VERSION_2_0, FREEGLUT_VERSION_2_1, FREEGLUT_VERSION_2_2, -etc., but this was only done for FREEGLUT_VERSION_2_0. -This constant still exist in current freeglut releases but is -deprecated. -

    - -

    -The freeglut version can be queried at runtime by calling -glutGet(GLUT_VERSION). -The result will be X*10000+Y*100+Z where X is the major version, Y is the -minor version and Z is the patch level. -

    -

    -This may be used as follows: -

    - -
    -if (glutGet(GLUT_VERSION) < 20001) {
    -    printf("Sorry, you need freeglut version 2.0.1 or later to run this program.\n");
    -    exit(1);
    -}
    -
    - -

    21.4 References

    - -

    21.5 Index

    - - diff --git a/freeglut/web-src/docs/gles.php b/freeglut/web-src/docs/gles.php deleted file mode 100644 index 44ed5c0..0000000 --- a/freeglut/web-src/docs/gles.php +++ /dev/null @@ -1,101 +0,0 @@ - - - - - -

    Introduction

    - -

    freeglut can initialize an OpenGL ES (GLES) context. It works under platforms that supports EGL:

    -
      -
    • Android (see dedicated page)
    • -
    • BlackBerry 10/BlackBerry PlayBook
    • -
    • Unix X11 with Mesa EGL
    • -
    • TODO: Raspberry PI: Mesa EGL doesn't work due to X11's fbdev limitation (no GL); - it needs to use libraries from libraspeberrypi-dev which will shortcut X11 - [1] - [2] - [3] -
    • -
    - -

    freeglut ES is provided as a separate library, because OpenGL ES -has a distinct library from plain OpenGL (-lGLESv1_CM --lGLESv2 instead of -lGL, and different headers too). -We could consider dynamically loading the OpenGL symbols we need, -like libSDL.

    - -

    It is possible to select OpenGL ES 1, 2 or 3 (if the device and -driver supports it) by calling -e.g. glutInitContextVersion(3,0) before creating a -window.

    - - -

    Compiling

    - -

    The following explains how to use freeglut ES for Mesa EGL.
    -See also the Android page.

    - -

    First, check README.cmake to install the dependencies for your system.

    - -

    Then:

    - -
    -apt-get install libgles1-mesa-dev libgles2-mesa-dev
    -cd /usr/src/freeglut-3.0.0/
    -mkdir native-gles/ && cd native-gles/
    -cmake \
    -  -DCMAKE_INSTALL_PREFIX=/tmp/freeglut-native-gles \
    -  -D CMAKE_BUILD_TYPE=Debug \
    -  -DFREEGLUT_GLES=ON \
    -  -DFREEGLUT_BUILD_DEMOS=NO \
    -  ..
    -make -j4
    -make install
    -
    - - -

    Using in your projects

    - -

    Get the 'freeglut-gles' module through pkg-config.

    - -

    If you use CMake, you can do that with:

    - -
    -include(FindPkgConfig)
    -pkg_check_modules(freeglut REQUIRED freeglut-gles>=3.0.0)
    -if(freeglut_FOUND)
    -  include_directories(${freeglut_STATIC_INCLUDE_DIRS})
    -  link_directories(${freeglut_STATIC_LIBRARY_DIRS})
    -  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${freeglut_STATIC_CFLAGS_OTHER}")
    -  add_definitions(${freeglut_STATIC_CFLAGS_OTHER})
    -endif()
    -
    - -
    -cd your_project/
    -mkdir native-gles/ && cd native-gles/
    -PKG_CONFIG_PATH=/tmp/freeglut-native-gles/share/pkgconfig/ cmake ..
    -
    - -

    Examples:

    -
      -
    • OpenGL Wikibook's - tut04_transform-gles2 - example: it uses a basic Makefile targeting freeglut-gles
    • -
    • progs/test-shapes-gles1/ in the source distribution: - it is a standalone CMake app that uses freeglut GLES (v1).
    • -
    - - diff --git a/freeglut/web-src/docs/install.php b/freeglut/web-src/docs/install.php deleted file mode 100644 index 69b5c2d..0000000 --- a/freeglut/web-src/docs/install.php +++ /dev/null @@ -1,56 +0,0 @@ - - -
    How to install freeglut...
    -

    It's not *that* hard...

    - -

    Presently, there are few pre-packaged installs, so the recommended method for most users is to follow these instructions. Even if you have a package system that includes freeglut, you may wish to manually install for a variety of reasons. A likely reason is simply that the latest version of freeglut may not have been packaged.

    - -

    So...

    - -
    Download freeglut
    -

    First, you need to download a freeglut release. Newer is generally better, but unless you know what you're doing, you should use a release marked "Stable." So download the newest Stable release that you can. (On the other hand, if you discover a bug and want to report it, it is helpful to try to run the "current" freeglut, as we have been known to fix some bugs before they are reported.)

    - -
    Untar and configure the packages
    -

    Copy the tarball you downloaded into a temporary directory. Untar it as follows:

    -
    zcat freeglut-2.2.0.tar.bz2 | tar -vxf -
    - -
    Change to the resulting directory:
    -
    cd freeglut-2.X.X
    - -
    Now, configure the packages:
    -
    ./configure
    - -

    NetBSD users may need a slightly different command:

    - -
    LDFLAGS=-Wl,-R/usr/X11R6/lib ./configure
    - -

    ...to properly handle things.

    - -
    Build and install freeglut
    -

    Once that completes, it's time to build and install freeglut (Note that you will have to be the superuser to make install).

    - -

    This is as simple as:

    - -
    -make all
    -make install
    -
    - -

    This will install the libraries, headers, and symlinks to replace GLUT.

    - -

    For Android, please see the dedicated Android page.

    - -

    For BlackBerry support, please see README.blackberry in the project source code.

    - -

    For OpenGL ES support (1.x and 2.x), please see the -dedicated GLES page.

    - - diff --git a/freeglut/web-src/freeglut-style.css b/freeglut/web-src/freeglut-style.css deleted file mode 100644 index 564adfd..0000000 --- a/freeglut/web-src/freeglut-style.css +++ /dev/null @@ -1,120 +0,0 @@ -body { - margin-top: 0px ; - margin-left: 140px ; - background-color: #FFFFFF; - color: #000000; -} - -a { - text-decoration: none; - color: #DD3322; -} - -a:hover { - text-decoration: underline; -} - -blockquote, pre { - color: #000000 ; - border: 1px #0000CC solid ; - background-color: #C0C0FF ; - padding: 3px; -} - -.textheader { - font-size: 1.4em; - border-bottom: 1px #111166 solid ; - width: 100%; -} - -h1 { - font-size: 1.4em; - border-bottom: 1px #111166 solid ; - width: 100%; - padding-top: 5px; -} - -h2 { - font-size: 1.2em; - border-bottom: 1px #999999 solid ; - width: 100%; - padding-left: 3px; -} - -h3 { - font-size: 1.1em; - padding-left: 6px; -} - - -.indent { - margin-left: 20px; -} - -.navbar-left -{ - font-size: 0.8em - color: #000000 ; - background-color: #EDEDFF ; - position: absolute ; - float: left; - left: 0px ; - top: 0px ; - width: 130px ; - border: 1px #A0A0A0 solid ; - text-align: center; -} - -.navbar-smalltext { - font-size: 0.7em; - font-style: italic; -} - -.navbar-header { - font-size: 1.0em; - color: #151111; - background-color: transparent; -} - -.navbar-item { - font-size: 1.0em ; - color: #303010 ; - background-color: #FFFFFF ; - border: 0px #EDEDFF solid ; - margin-top: 0px; - padding: 0px; -} - -.img-right { - float: right; - color: #209040; - text-align: center; -} - -.news-item { - border: 1px #000000 solid ; - margin-bottom: 5px; - padding: 8px; - background-color: #EFEFFF; - color: #000000; -} - -.news-header { - font-size: 1.4em; - border: 1px #111166 solid ; - background-color: #FEFEFF; - color: #000000; - padding: 5px; - width: 90%; -} - -.news-subheader { - font-size: 1.1em; - border-bottom: 1px #111166 solid ; - width: 100%; -} - -th, td { - border-bottom: 1px solid #aaa; - vertical-align: top; -} diff --git a/freeglut/web-src/help.php b/freeglut/web-src/help.php deleted file mode 100644 index 2d3f594..0000000 --- a/freeglut/web-src/help.php +++ /dev/null @@ -1,76 +0,0 @@ - -
    -OpenGL
    -This is OpenGL at its finest. -
    - -
    This is better than GLUT.
    -

    freeglut started out as a GLUT clone, but now it's something much -better than that. It's a GLUT replacement. Here are the features you -have wanted -- and if you have ideas for more, share them (see below), -or fork our github -repository and implement them! freeglut is under continuous -development. Currently, work on 3.0 is in full swing. See here for the list of work that is still to be -done.

    - -
    Everyone can help
    -

    -Free software projects depend on the community around them for their growth. -It's by contributions that truly wonderful pieces of open and free software come to be. -Contributions can be nearly anything. The point is involvement!

    - -

    Examples: -

    - -

    -But simply, become involved! -The project is not just software, it's the people that contribute, too. -

    - -
    freeglut 3.0
    -

    -Click here for an overview of the major work, -its status and planned milestones for freeglut 3.0 and beyond. Help on -any of these plans, as well as suggestions and/or patches for anything -else are very welcome! -

    - -
    Go to SourceForge and...
    - - - -
    Anonymous SVN Access
    -

    To check out the most up to date development copy of freeglut, issue the following commands at your command line. See also SourceForge's Anonymous SVN Instructions.

    - -
    -svn co http://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut freeglut
    -
    - - diff --git a/freeglut/web-src/images/OGL.png b/freeglut/web-src/images/OGL.png deleted file mode 100644 index 439b0a5..0000000 Binary files a/freeglut/web-src/images/OGL.png and /dev/null differ diff --git a/freeglut/web-src/images/chessdemo.png b/freeglut/web-src/images/chessdemo.png deleted file mode 100644 index 863749b..0000000 Binary files a/freeglut/web-src/images/chessdemo.png and /dev/null differ diff --git a/freeglut/web-src/images/freeglut_logo.png b/freeglut/web-src/images/freeglut_logo.png deleted file mode 100644 index a43d43e..0000000 Binary files a/freeglut/web-src/images/freeglut_logo.png and /dev/null differ diff --git a/freeglut/web-src/images/freeglut_logo.xcf b/freeglut/web-src/images/freeglut_logo.xcf deleted file mode 100644 index 38b2b87..0000000 Binary files a/freeglut/web-src/images/freeglut_logo.xcf and /dev/null differ diff --git a/freeglut/web-src/images/freeglut_text.xcf b/freeglut/web-src/images/freeglut_text.xcf deleted file mode 100644 index 85245a0..0000000 Binary files a/freeglut/web-src/images/freeglut_text.xcf and /dev/null differ diff --git a/freeglut/web-src/images/freshmeat.png b/freeglut/web-src/images/freshmeat.png deleted file mode 100644 index 30e0f6e..0000000 Binary files a/freeglut/web-src/images/freshmeat.png and /dev/null differ diff --git a/freeglut/web-src/images/opengl.png b/freeglut/web-src/images/opengl.png deleted file mode 100644 index abc1b7e..0000000 Binary files a/freeglut/web-src/images/opengl.png and /dev/null differ diff --git a/freeglut/web-src/images/tuxcake.png b/freeglut/web-src/images/tuxcake.png deleted file mode 100644 index dc4410a..0000000 Binary files a/freeglut/web-src/images/tuxcake.png and /dev/null differ diff --git a/freeglut/web-src/index.php b/freeglut/web-src/index.php deleted file mode 100644 index d866f63..0000000 --- a/freeglut/web-src/index.php +++ /dev/null @@ -1,154 +0,0 @@ - -
    - chess demo
    - GLUT's "Chess" demo
    - running with freeglut. -
    - -

    - -
    What?
    - -

    freeglut is a free-software/open-source alternative to the OpenGL Utility -Toolkit (GLUT) library. GLUT was originally written by Mark Kilgard to support -the sample programs in the second edition OpenGL 'RedBook'. Since then, GLUT has -been used in a wide variety of practical applications because it is simple, -widely available and highly portable.

    - -

    GLUT (and hence freeglut) takes care of all the system-specific chores -required for creating windows, initializing OpenGL contexts, and handling input -events, to allow for trully portable OpenGL programs.

    - -

    freeglut is released under the X-Consortium license.

    - -
    Why?
    - -

    The original GLUT library seems to have been abandoned with the most recent -version (3.7) dating back to August 1998. Its license does not allow anyone to -distribute modified library code. This is really unfortunate, since GLUT is -getting old and really needs improvement. Also, GLUT's license is incompatible -with some software distributions (e.g., XFree86).

    - -
    Who?
    - -

    freeglut was originally written by Pawel W. Olszta with contributions from -Andreas Umbach and Steve Baker.

    - -

    John F. Fay, John Tsiombikas, and Diederick C. Niehorster are the current -maintainers of the freeglut project.

    - -
    When?
    - -

    Pawel started freeglut development on December 1st, 1999. The project is now -virtually a 100% replacement for the original GLUT with only a few departures -(such as the abandonment of SGI-specific features such as the Dials&Buttons -box and Dynamic Video Resolution) and a shrinking set of bugs.

    - -

    freeglut adds some additional features over the basic GLUT functionality, -such as a larger set of predefined objects to use, the ability to run single -iterations of the event loop, or exit from it gracefully, mousewheel input -callbacks, optional OpenGL core/compatibility profile context creation, -multitouch/multi-pointer input, and support for a larger and growing set of -platforms, being just some of them.

    - -
    Help out!
    - -

    We are looking for developers to help out with further work on the Android -and BlackBerry 10 ports. Furthermore, ports to Cocoa on OSX, and maybe even -Wayland are planned, along with some enhancements to the API and implementation.

    - -

    See here for an overview of the major points -on our todo list. You can easily help out by forking the unofficial clone -of our sourceforge.net -SVN repository on github. For more -information about helping out, see the Help Out -page and join -the freeglut-developer -mailing list.

    - -
    Downloads...
    -

    Below are file links for the freeglut project. README files are included. Have fun!

    - -
    -
    Testing Releases
    -

    Feel free to test by downloading a tarball - of current trunk, or grabbing a copy from - svn, and give us feedback on how it worked for you. All this - will eventually become a freeglut 3.4 release.

    -

    There are no presently active testing releases.

    -
    - - -
    -
    Stable Releases
    -

    - freeglut 3.2.1 [Released: 29 September 2019]
    - freeglut 3.2.0 [Released: 16 September 2019]
    - freeglut 3.0.0 [Released: 7 March 2015]
    - freeglut 2.8.1 [Released: 5 April 2013]
    - freeglut 2.8.0 [Released: 2 January 2012]
    - freeglut 2.6.0 [Released: 27 November 2009]
    - freeglut 2.4.0 [Released: 9 June 2005]
    - freeglut 2.2.0 [Released: 12 December 2003]
    - freeglut 2.0.1 [Released: 23 October 2003] -

    - -
    Prepackaged Releases
    - -

    The freeglut project does not support packaged versions of freeglut -excepting, of course, the tarballs distributed here. However, various members of -the community have put time and effort into providing source or binary rollups, -and we thank them for their efforts. Here's a list which is likely -incomplete:

    - - -

    - Martin Payne's Windows binaries (MSVC and MinGW)
    - Florian Echtler's MPX Patch -

    - -

    If you have problems with these packages, please contact their maintainers - we of the freeglut team probably can't help.

    - -
    Development Releases
    -

    - SVN trunk tarball
    - Anonymous SVN Instructions -

    -
    - -
    Questions?
    -

    Don't be afraid to ask for help. We don't bite. Much.

    -

    Send freeglut related questions to the appropriate freeglut mailing list:

    - - - -

    Please note that you must -subscribe before you can post to our mailing lists. Sorry for the -inconvenience.

    - - - diff --git a/freeglut/web-src/news.php b/freeglut/web-src/news.php deleted file mode 100644 index d8e06a2..0000000 --- a/freeglut/web-src/news.php +++ /dev/null @@ -1,134 +0,0 @@ - - -
    -
    freeglut 2.8.1 Released [5 April 2013]
    -

    A new bugfix release of "freeglut" is now available. Here is a -incomplete list of fixes and enhancements:

    -
      -
    • Visual Studio 2012 project files, and a fix for the disappearing -windows with this toolset.
    • -
    • X11 menu regression fixed, menu behavior improved on Windows.
    • -
    • Now using monotonic clock on X11.
    • -
    • GameMode now doesn't attempt to change unspecified display params to -arbitrary defaults, and not changing display mode when unnecessary to -avoid flicker.
    • -
    • On Windows, windows no longer attain focus as soon as the mouse -enters them
    • -
    • Various demo enhancements.
    • -
    • Many bugs have been fixed.
    • -
    -
    - -
    -
    freeglut 2.8.0 Released [2 January 2012]
    -

    After two years of quiet maintenance, a new version of "freeglut" has been released. Here are some of the major changes:

    -
      -
    • There are now callbacks to support multitouch capability.
    • -
    • Solaris and OSX support have improved.
    • -
    • Fullscreen mode and Game mode behave better.
    • -
    • Addition of Visual Studio 2010 projects & solutions.
    • -
    • Many bugs have been fixed.
    • -
    -

    Visit the downloads section to get your hands on the latest release.

    -
    - -
    -
    freeglut 2.6.0 Released [27 November 2009]
    -

    The long awaited 2.6.0 release has arrived! This release features:

    -
      -
    • Truly full screen windows under X11 when calling glutFullScreen().
    • -
    • Spaceball support on Linux.
    • -
    • Addition of the "atexit" hack, making the freeglut Windows DLL binary compatible with GLUT.
    • -
    • Addition of Visual Studio 2008 projects & solutions.
    • -
    • Many other fixes.
    • -
    -
    - -
    -
    API is now online! [30 December 2003]
    -

    The Application Programming Interface documentation is now online, in addition to being distributed with the tarball. There have been a few changes to freeglut since the last update to the API documentation, and if anyone would like to make the appropriate updates, the whole project would appreciate it. Despite that, it's nearly wholly up-to-date. Please make good use of it.

    -
    - -
    -
    freeglut 2.2.0 Released [12 December 2003]
    -

    The freeglut Project proudly announces freeglut 2.2.0. This version contains:

    -
      -
    • Mousewheel Support for Win32 & X11
    • -
    • More unified Win32/*nix behavior and code
    • -
    • Code style cleanups
    • -
    • Visibility support in Win32
    • -
    • Many other Good Bug Fixes™
    • -
    -

    [Read the full ChangeLog.]

    - -

    Click the Downloads link on the left and enjoy!

    - -
    - - -
    -
    freeglut 2.0.1 Released [23 October 2003]
    -

    2.0.1 fixes a number of bugs with menus, especially in the UNIX_X11.

    -
    - - -
    -
    freeglut 2.0.0 is GOLD! [29 September 2003]
    - -
    Tux Cake
    -A cake one of our developers
    -(John Fay) received in honor
    -of his freeglut work.
    - -

    freeglut 2.0.0 marks the first true departure from Mark Kilgard's original GLUT library, adding much-requested features while still retaining not only high backward compatibility with older implementations of GLUT, but all the polish of the original -- and more!

    - -
    What have we done? A lot.
    -

    This isn't the GLUT you remember.

    - -

    This is an incomplete list -- there are simply too many improvements to write!

    -

    General Improvements:

    -
    • You can now control program behavior when a GLUT window is closed by the user, rather than simply exiting. Options include: -
        -
      • Immediate exit() (old GLUT behavior)
      • -
      • glutMainLoop() returns to you
      • -
      • continue execution
      • -
      -
    • -
    • Option to share a rendering context for each new window
    • -
    • Interruptable glutMainLoop (glutMainLoopEvent, glutLeaveMainLoop)
    • -
    • Window-specific callback functions (Close, WindowManager Close, Menu destruction)
    • -
    • User-specified data in Windows and Menus
    • -
    • Additional font statistics (stroke and bitmap heights...)
    • -
    • New font functions to allow the user to print strings instead of one character at a time
    • -
    • New primitives (RhombicDodecahedron, SierpinskiSponge)
    • -
    • Good-looking menus
    • -
    - -

    XFree86 GameMode improvements:

    -
    • force re-establishment of the original video mode by the X server even if the application exits immediately after leaving game mode
    • -
    • make sure that the X server has finished game mode preparations before continuing; fixes window sliding(missed mouse grab) and application exits.
    • -
    • fix support for game mode resolution equal to maximum screen resolution
    • -
    • restore original view port and Pointer position when leaving game mode
    - -

    Win32 GameMode improvements:

    -
    • if desired display frequency for entering game mode is not found, a display mode without matching display frequency is tried.
    - -
    Get involved!
    - -

    If you like freeglut, think about helping out with the project. There's always more to be done to enhance the library!

    - -

    Documentation, example programs, suggestions for improvement -- they're all needed.

    - -

    Look at the "How You Can Help" section on the left for ideas on how you can do your part!

    - -
    - - diff --git a/freeglut/web-src/progress.php b/freeglut/web-src/progress.php deleted file mode 100644 index 999091d..0000000 --- a/freeglut/web-src/progress.php +++ /dev/null @@ -1,100 +0,0 @@ - - -
    freeglut 3.0 an onwards
    -

    -Major work, its status and planned milestone. Help on any of these plans is very welcome! Fork the -github repository, join -and contact us on the freeglut-developer -mailing list to discuss your plans, and get cracking!

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    FeatureStatusMilestone
    Android portBasic but complete functionality by Sylvain -Beucler, but there are todo -pointsBasic functionality as is now done: 3.0. Future -enhancements: 3.0 or later.
    BlackBerry 10 portBasic but complete functionality -by Vinnie -Simonetti.Basic functionality as is now done: 3.0. Future -enhancements: 3.0 or later.
    Windows 8 touch supportWindows 8 replaced how touch -input works, so we need to implement support for that.3.2
    10bit display formatsGLUT supports that but freeglut -currently does not. Unfinished effort to implement here.3.0 -or later.
    handling non-western script input to windowsFor -Windows, see associated github -branch. What can be done on the Linux side?Figure this out -for 3.2
    option to not deinitialize when mainloop terminatesAs -is often requested, in some usage cases, it would be advantageous if -freeglut did not automatically deinitialize when its last window is -closed. This has been implemented, but is awaiting testing on platforms -other than windows. Discussed here.As -it has potential complications on mobile platforms, it was decided to -leave this feature until after 3.0.
    High-DPI awareness.As discussed here, -it is unclear what should be done. See also associated github -branch, though in the end maybe no code has to be added to freeglut -for this at all, its the host program's responsibility to decide on DPI -awareness for his work.Figure this out for 3.2
    GL2+ and GLES 1/2 clean API for fonts and menusFor -stroke fonts, we can use a similar approach as for the shapes, should -thus be straightforward. For the bitmap fonts, this is more complex. -John T suggested "using a glyph atlas texture with GL_STREAM_DRAW VBOs", -which would get us somewhere. Code could be ripped from his libdrawtext -libraryThe sooner the better, but will have to wait for -asap after 3.0.
    At runtime loading of OpenGL or OpenGL ES libraries, -like SDL.Currently CMake variables define at compile time which -of the two the library will be compiled against. No work has been -done to move this to an at-runtime API.After 3.0
    Position callbackDone: we now have a position callback -to notify the client when the position of the window -changed.3.0
    Carbon/Cocoa portNot started. As Carbon is legacy, one -might want to port to Cocoa first or even forget about Carbon all -together.Undecided
    Unicode supportNot started, we'd need to discuss this -carefully on the mailing list first to minimize impact on the -API.Undecided
    Complete glutInitDisplayString supportfreeglut now only -partially supports glutInitDisplayString, any spec (comparator and -value) after each token are ignored. This is a significant way in which -freeglut is not compatible with GLUT. Could be a nice project for -someone who want to become familiar with the intricacies of requesting -specific display formats on at least one of the various window servers -(Windows, X11 and Android/BlackBerry 10/EGL at the -moment).Undecided
    - - diff --git a/freeglut/web-src/template.php b/freeglut/web-src/template.php deleted file mode 100644 index ad101bd..0000000 --- a/freeglut/web-src/template.php +++ /dev/null @@ -1,113 +0,0 @@ -"Name of Page", page=>"Filename/URL"), -# -$sidebarentries = array(0, # We skip this entry anyway... - array("name"=>"About", "page"=>"/index.php"), - array("name"=>"News", "page"=>"/news.php"), - array("name"=>"Progress", "page"=>"/progress.php"), - array("name"=>"Help Out", "page"=>"/help.php"), - 1, - array("name"=>"Download", "page"=>"/index.php#download"), - 1, - array("name"=>"Install", "page"=>"/docs/install.php"), - array("name"=>"API", "page"=>"/docs/api.php"), - array("name"=>"OpenGL Wikibook", "page"=>"http://en.wikibooks.org/wiki/OpenGL_Programming"), - 1, - array("name"=>"Report a Bug", "page"=>"http://sourceforge.net/p/freeglut/bugs/"), - array("name"=>"Request a Feature", "page"=>"http://sourceforge.net/p/freeglut/feature-requests/"), - array("name"=>"Project Interface", "page"=>"http://sourceforge.net/projects/freeglut/") -); - -function generateHeader($self) -{ - global $title; - - echo "\n"; - echo "\n"; - echo ""; - -?> - - - - - <? echo $title ?> - - - - - -\n"; - else if ($current_page == $item["page"]) - echo "\t
    $item[name]
    \n"; - else - echo "\t\n"; -} - -function generateSideBar($current_page) -{ - global $sidebarentries; - - # Print out the logo and title -?> - - diff --git a/freeglut/web-src/uinfo.php b/freeglut/web-src/uinfo.php deleted file mode 100644 index 44c3f94..0000000 --- a/freeglut/web-src/uinfo.php +++ /dev/null @@ -1,17 +0,0 @@ -1; $slashes--) { $require_target .= "../"; } -$require_target .= "template.php"; -require($require_target); - -# Now set the title of the page: -setPageTitle("Information for Users"); - -# Make the header. -generateHeader($_SERVER['PHP_SELF']); -?> - - diff --git a/freeglut/web-src/upload b/freeglut/web-src/upload deleted file mode 100755 index 434a1d9..0000000 --- a/freeglut/web-src/upload +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -if [ -n "$1" ]; then - user=$1 -else - # read the username out of .sfuser - if [ -f .sfuser ]; then - user=$(cat .sfuser) - else - user=$USER - fi - - if [ -z "$user" ]; then - echo "please pass your sourceforge username as argument, or create a .sfuser file" >&2 - exit 1 - fi -fi - -echo "connecting as user: $user ..." -rsync -avP -e ssh --exclude='.sfuser' --exclude '*.swp' \ - * $user@web.sourceforge.net:/home/project-web/freeglut/htdocs/ diff --git a/freeglut/freeglut/include/GL/freeglut.h b/include/GL/freeglut.h similarity index 100% rename from freeglut/freeglut/include/GL/freeglut.h rename to include/GL/freeglut.h diff --git a/freeglut/freeglut/include/GL/freeglut_ext.h b/include/GL/freeglut_ext.h similarity index 100% rename from freeglut/freeglut/include/GL/freeglut_ext.h rename to include/GL/freeglut_ext.h diff --git a/freeglut/freeglut/include/GL/freeglut_std.h b/include/GL/freeglut_std.h similarity index 99% rename from freeglut/freeglut/include/GL/freeglut_std.h rename to include/GL/freeglut_std.h index a658c7c..d0151ef 100644 --- a/freeglut/freeglut/include/GL/freeglut_std.h +++ b/include/GL/freeglut_std.h @@ -132,7 +132,10 @@ /* Note: FREEGLUT_GLES is only used to cleanly bootstrap headers inclusion here; use GLES constants directly (e.g. GL_ES_VERSION_2_0) for all other needs */ -#ifdef FREEGLUT_GLES +#ifdef __VITA__ +# include +# include +#elif FREEGLUT_GLES # include # include # include diff --git a/freeglut/freeglut/include/GL/freeglut_ucall.h b/include/GL/freeglut_ucall.h similarity index 100% rename from freeglut/freeglut/include/GL/freeglut_ucall.h rename to include/GL/freeglut_ucall.h diff --git a/freeglut/freeglut/include/GL/glut.h b/include/GL/glut.h similarity index 100% rename from freeglut/freeglut/include/GL/glut.h rename to include/GL/glut.h diff --git a/freeglut/freeglut/mingw_cross_toolchain.cmake b/mingw_cross_toolchain.cmake similarity index 100% rename from freeglut/freeglut/mingw_cross_toolchain.cmake rename to mingw_cross_toolchain.cmake diff --git a/freeglut/freeglut/progs/demos/CallbackMaker/CallbackMaker.c b/progs/demos/CallbackMaker/CallbackMaker.c similarity index 100% rename from freeglut/freeglut/progs/demos/CallbackMaker/CallbackMaker.c rename to progs/demos/CallbackMaker/CallbackMaker.c diff --git a/freeglut/freeglut/progs/demos/Fractals/fractals.c b/progs/demos/Fractals/fractals.c similarity index 100% rename from freeglut/freeglut/progs/demos/Fractals/fractals.c rename to progs/demos/Fractals/fractals.c diff --git a/freeglut/freeglut/progs/demos/Fractals/fractals.dat b/progs/demos/Fractals/fractals.dat similarity index 100% rename from freeglut/freeglut/progs/demos/Fractals/fractals.dat rename to progs/demos/Fractals/fractals.dat diff --git a/freeglut/freeglut/progs/demos/Fractals_random/fractals.dat b/progs/demos/Fractals_random/fractals.dat similarity index 100% rename from freeglut/freeglut/progs/demos/Fractals_random/fractals.dat rename to progs/demos/Fractals_random/fractals.dat diff --git a/freeglut/freeglut/progs/demos/Fractals_random/fractals_random.c b/progs/demos/Fractals_random/fractals_random.c similarity index 100% rename from freeglut/freeglut/progs/demos/Fractals_random/fractals_random.c rename to progs/demos/Fractals_random/fractals_random.c diff --git a/freeglut/freeglut/progs/demos/Lorenz/lorenz.c b/progs/demos/Lorenz/lorenz.c similarity index 100% rename from freeglut/freeglut/progs/demos/Lorenz/lorenz.c rename to progs/demos/Lorenz/lorenz.c diff --git a/freeglut/freeglut/progs/demos/One/objects.ico b/progs/demos/One/objects.ico similarity index 100% rename from freeglut/freeglut/progs/demos/One/objects.ico rename to progs/demos/One/objects.ico diff --git a/freeglut/freeglut/progs/demos/One/one.c b/progs/demos/One/one.c similarity index 100% rename from freeglut/freeglut/progs/demos/One/one.c rename to progs/demos/One/one.c diff --git a/freeglut/freeglut/progs/demos/One/one.rc b/progs/demos/One/one.rc similarity index 100% rename from freeglut/freeglut/progs/demos/One/one.rc rename to progs/demos/One/one.rc diff --git a/freeglut/freeglut/progs/demos/Resizer/Resizer.cpp b/progs/demos/Resizer/Resizer.cpp similarity index 100% rename from freeglut/freeglut/progs/demos/Resizer/Resizer.cpp rename to progs/demos/Resizer/Resizer.cpp diff --git a/freeglut/freeglut/progs/demos/init_error_func/init_error_func.c b/progs/demos/init_error_func/init_error_func.c similarity index 100% rename from freeglut/freeglut/progs/demos/init_error_func/init_error_func.c rename to progs/demos/init_error_func/init_error_func.c diff --git a/freeglut/freeglut/progs/demos/multi-touch/multi-touch.c b/progs/demos/multi-touch/multi-touch.c similarity index 100% rename from freeglut/freeglut/progs/demos/multi-touch/multi-touch.c rename to progs/demos/multi-touch/multi-touch.c diff --git a/freeglut/freeglut/progs/demos/shapes/glmatrix.c b/progs/demos/shapes/glmatrix.c similarity index 100% rename from freeglut/freeglut/progs/demos/shapes/glmatrix.c rename to progs/demos/shapes/glmatrix.c diff --git a/freeglut/freeglut/progs/demos/shapes/glmatrix.h b/progs/demos/shapes/glmatrix.h similarity index 100% rename from freeglut/freeglut/progs/demos/shapes/glmatrix.h rename to progs/demos/shapes/glmatrix.h diff --git a/freeglut/freeglut/progs/demos/shapes/shapes.c b/progs/demos/shapes/shapes.c similarity index 100% rename from freeglut/freeglut/progs/demos/shapes/shapes.c rename to progs/demos/shapes/shapes.c diff --git a/freeglut/freeglut/progs/demos/smooth_opengl3/smooth_opengl3.c b/progs/demos/smooth_opengl3/smooth_opengl3.c old mode 100755 new mode 100644 similarity index 100% rename from freeglut/freeglut/progs/demos/smooth_opengl3/smooth_opengl3.c rename to progs/demos/smooth_opengl3/smooth_opengl3.c diff --git a/freeglut/freeglut/progs/demos/spaceball/spaceball.c b/progs/demos/spaceball/spaceball.c similarity index 100% rename from freeglut/freeglut/progs/demos/spaceball/spaceball.c rename to progs/demos/spaceball/spaceball.c diff --git a/freeglut/freeglut/progs/demos/spaceball/vmath.c b/progs/demos/spaceball/vmath.c similarity index 100% rename from freeglut/freeglut/progs/demos/spaceball/vmath.c rename to progs/demos/spaceball/vmath.c diff --git a/freeglut/freeglut/progs/demos/spaceball/vmath.h b/progs/demos/spaceball/vmath.h similarity index 100% rename from freeglut/freeglut/progs/demos/spaceball/vmath.h rename to progs/demos/spaceball/vmath.h diff --git a/freeglut/freeglut/progs/demos/spaceball/vmath.inl b/progs/demos/spaceball/vmath.inl similarity index 100% rename from freeglut/freeglut/progs/demos/spaceball/vmath.inl rename to progs/demos/spaceball/vmath.inl diff --git a/freeglut/freeglut/progs/demos/subwin/subwin.c b/progs/demos/subwin/subwin.c similarity index 100% rename from freeglut/freeglut/progs/demos/subwin/subwin.c rename to progs/demos/subwin/subwin.c diff --git a/freeglut/freeglut/progs/demos/timer/timer.c b/progs/demos/timer/timer.c similarity index 100% rename from freeglut/freeglut/progs/demos/timer/timer.c rename to progs/demos/timer/timer.c diff --git a/freeglut/freeglut/progs/demos/timer_callback/timer.c b/progs/demos/timer_callback/timer.c similarity index 100% rename from freeglut/freeglut/progs/demos/timer_callback/timer.c rename to progs/demos/timer_callback/timer.c diff --git a/freeglut/freeglut/progs/test-shapes-gles1/AndroidManifest.xml b/progs/test-shapes-gles1/AndroidManifest.xml similarity index 100% rename from freeglut/freeglut/progs/test-shapes-gles1/AndroidManifest.xml rename to progs/test-shapes-gles1/AndroidManifest.xml diff --git a/freeglut/freeglut/progs/test-shapes-gles1/CMakeLists.txt b/progs/test-shapes-gles1/CMakeLists.txt similarity index 100% rename from freeglut/freeglut/progs/test-shapes-gles1/CMakeLists.txt rename to progs/test-shapes-gles1/CMakeLists.txt diff --git a/freeglut/freeglut/progs/test-shapes-gles1/ndk/AndroidManifest.xml b/progs/test-shapes-gles1/ndk/AndroidManifest.xml similarity index 100% rename from freeglut/freeglut/progs/test-shapes-gles1/ndk/AndroidManifest.xml rename to progs/test-shapes-gles1/ndk/AndroidManifest.xml diff --git a/freeglut/freeglut/progs/test-shapes-gles1/ndk/jni/Android.mk b/progs/test-shapes-gles1/ndk/jni/Android.mk similarity index 100% rename from freeglut/freeglut/progs/test-shapes-gles1/ndk/jni/Android.mk rename to progs/test-shapes-gles1/ndk/jni/Android.mk diff --git a/freeglut/freeglut/progs/test-shapes-gles1/ndk/jni/Application.mk b/progs/test-shapes-gles1/ndk/jni/Application.mk similarity index 100% rename from freeglut/freeglut/progs/test-shapes-gles1/ndk/jni/Application.mk rename to progs/test-shapes-gles1/ndk/jni/Application.mk diff --git a/freeglut/freeglut/progs/test-shapes-gles1/test-shapes-gles1.c b/progs/test-shapes-gles1/test-shapes-gles1.c similarity index 100% rename from freeglut/freeglut/progs/test-shapes-gles1/test-shapes-gles1.c rename to progs/test-shapes-gles1/test-shapes-gles1.c diff --git a/freeglut/freeglut/src/android/fg_cursor_android.c b/src/android/fg_cursor_android.c similarity index 100% rename from freeglut/freeglut/src/android/fg_cursor_android.c rename to src/android/fg_cursor_android.c diff --git a/freeglut/freeglut/src/android/fg_ext_android.c b/src/android/fg_ext_android.c similarity index 100% rename from freeglut/freeglut/src/android/fg_ext_android.c rename to src/android/fg_ext_android.c diff --git a/freeglut/freeglut/src/android/fg_gamemode_android.c b/src/android/fg_gamemode_android.c similarity index 100% rename from freeglut/freeglut/src/android/fg_gamemode_android.c rename to src/android/fg_gamemode_android.c diff --git a/freeglut/freeglut/src/android/fg_init_android.c b/src/android/fg_init_android.c similarity index 100% rename from freeglut/freeglut/src/android/fg_init_android.c rename to src/android/fg_init_android.c diff --git a/freeglut/freeglut/src/android/fg_input_devices_android.c b/src/android/fg_input_devices_android.c similarity index 100% rename from freeglut/freeglut/src/android/fg_input_devices_android.c rename to src/android/fg_input_devices_android.c diff --git a/freeglut/freeglut/src/android/fg_internal_android.h b/src/android/fg_internal_android.h similarity index 100% rename from freeglut/freeglut/src/android/fg_internal_android.h rename to src/android/fg_internal_android.h diff --git a/freeglut/freeglut/src/android/fg_joystick_android.c b/src/android/fg_joystick_android.c similarity index 100% rename from freeglut/freeglut/src/android/fg_joystick_android.c rename to src/android/fg_joystick_android.c diff --git a/freeglut/freeglut/src/android/fg_main_android.c b/src/android/fg_main_android.c similarity index 100% rename from freeglut/freeglut/src/android/fg_main_android.c rename to src/android/fg_main_android.c diff --git a/freeglut/freeglut/src/android/fg_main_android.h b/src/android/fg_main_android.h similarity index 100% rename from freeglut/freeglut/src/android/fg_main_android.h rename to src/android/fg_main_android.h diff --git a/freeglut/freeglut/src/android/fg_runtime_android.c b/src/android/fg_runtime_android.c similarity index 100% rename from freeglut/freeglut/src/android/fg_runtime_android.c rename to src/android/fg_runtime_android.c diff --git a/freeglut/freeglut/src/android/fg_spaceball_android.c b/src/android/fg_spaceball_android.c similarity index 100% rename from freeglut/freeglut/src/android/fg_spaceball_android.c rename to src/android/fg_spaceball_android.c diff --git a/freeglut/freeglut/src/android/fg_state_android.c b/src/android/fg_state_android.c similarity index 100% rename from freeglut/freeglut/src/android/fg_state_android.c rename to src/android/fg_state_android.c diff --git a/freeglut/freeglut/src/android/fg_structure_android.c b/src/android/fg_structure_android.c similarity index 100% rename from freeglut/freeglut/src/android/fg_structure_android.c rename to src/android/fg_structure_android.c diff --git a/freeglut/freeglut/src/android/fg_window_android.c b/src/android/fg_window_android.c similarity index 100% rename from freeglut/freeglut/src/android/fg_window_android.c rename to src/android/fg_window_android.c diff --git a/freeglut/freeglut/src/android/native_app_glue/README b/src/android/native_app_glue/README similarity index 100% rename from freeglut/freeglut/src/android/native_app_glue/README rename to src/android/native_app_glue/README diff --git a/freeglut/freeglut/src/android/native_app_glue/android_native_app_glue.c b/src/android/native_app_glue/android_native_app_glue.c similarity index 100% rename from freeglut/freeglut/src/android/native_app_glue/android_native_app_glue.c rename to src/android/native_app_glue/android_native_app_glue.c diff --git a/freeglut/freeglut/src/android/native_app_glue/android_native_app_glue.h b/src/android/native_app_glue/android_native_app_glue.h similarity index 100% rename from freeglut/freeglut/src/android/native_app_glue/android_native_app_glue.h rename to src/android/native_app_glue/android_native_app_glue.h diff --git a/freeglut/freeglut/src/blackberry/fg_init_blackberry.c b/src/blackberry/fg_init_blackberry.c similarity index 100% rename from freeglut/freeglut/src/blackberry/fg_init_blackberry.c rename to src/blackberry/fg_init_blackberry.c diff --git a/freeglut/freeglut/src/blackberry/fg_internal_blackberry.h b/src/blackberry/fg_internal_blackberry.h similarity index 100% rename from freeglut/freeglut/src/blackberry/fg_internal_blackberry.h rename to src/blackberry/fg_internal_blackberry.h diff --git a/freeglut/freeglut/src/blackberry/fg_main_blackberry.c b/src/blackberry/fg_main_blackberry.c similarity index 100% rename from freeglut/freeglut/src/blackberry/fg_main_blackberry.c rename to src/blackberry/fg_main_blackberry.c diff --git a/freeglut/freeglut/src/blackberry/fg_state_blackberry.c b/src/blackberry/fg_state_blackberry.c similarity index 100% rename from freeglut/freeglut/src/blackberry/fg_state_blackberry.c rename to src/blackberry/fg_state_blackberry.c diff --git a/freeglut/freeglut/src/blackberry/fg_structure_blackberry.c b/src/blackberry/fg_structure_blackberry.c similarity index 100% rename from freeglut/freeglut/src/blackberry/fg_structure_blackberry.c rename to src/blackberry/fg_structure_blackberry.c diff --git a/freeglut/freeglut/src/blackberry/fg_window_blackberry.c b/src/blackberry/fg_window_blackberry.c similarity index 100% rename from freeglut/freeglut/src/blackberry/fg_window_blackberry.c rename to src/blackberry/fg_window_blackberry.c diff --git a/freeglut/freeglut/src/egl/fg_display_egl.c b/src/egl/fg_display_egl.c similarity index 100% rename from freeglut/freeglut/src/egl/fg_display_egl.c rename to src/egl/fg_display_egl.c diff --git a/freeglut/freeglut/src/egl/fg_ext_egl.c b/src/egl/fg_ext_egl.c similarity index 100% rename from freeglut/freeglut/src/egl/fg_ext_egl.c rename to src/egl/fg_ext_egl.c diff --git a/freeglut/freeglut/src/egl/fg_init_egl.c b/src/egl/fg_init_egl.c similarity index 75% rename from freeglut/freeglut/src/egl/fg_init_egl.c rename to src/egl/fg_init_egl.c index 3c83fb2..b64bcf5 100644 --- a/freeglut/freeglut/src/egl/fg_init_egl.c +++ b/src/egl/fg_init_egl.c @@ -21,17 +21,41 @@ * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ + * + * Copyright (c) 2020 by Furkan Mudanyali + * + * This file is part of Freeglut-Vita + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + ****************************************************************************/ #define FREEGLUT_BUILDING_LIB #include #include "fg_internal.h" +#ifdef VITA +#include +#endif /* * A call to this function should initialize all the display stuff... */ void fghPlatformInitializeEGL() { +#ifdef VITA + pibInit(PIB_SHACCCG); +#endif /* CreateDisplay */ /* Using EGL_DEFAULT_DISPLAY, or a specific native display */ #ifdef FREEGLUT_WAYLAND diff --git a/freeglut/freeglut/src/egl/fg_init_egl.h b/src/egl/fg_init_egl.h similarity index 100% rename from freeglut/freeglut/src/egl/fg_init_egl.h rename to src/egl/fg_init_egl.h diff --git a/freeglut/freeglut/src/egl/fg_internal_egl.h b/src/egl/fg_internal_egl.h similarity index 100% rename from freeglut/freeglut/src/egl/fg_internal_egl.h rename to src/egl/fg_internal_egl.h diff --git a/freeglut/freeglut/src/egl/fg_state_egl.c b/src/egl/fg_state_egl.c similarity index 100% rename from freeglut/freeglut/src/egl/fg_state_egl.c rename to src/egl/fg_state_egl.c diff --git a/freeglut/freeglut/src/egl/fg_state_egl.h b/src/egl/fg_state_egl.h similarity index 100% rename from freeglut/freeglut/src/egl/fg_state_egl.h rename to src/egl/fg_state_egl.h diff --git a/freeglut/freeglut/src/egl/fg_structure_egl.c b/src/egl/fg_structure_egl.c similarity index 100% rename from freeglut/freeglut/src/egl/fg_structure_egl.c rename to src/egl/fg_structure_egl.c diff --git a/freeglut/freeglut/src/egl/fg_structure_egl.h b/src/egl/fg_structure_egl.h similarity index 100% rename from freeglut/freeglut/src/egl/fg_structure_egl.h rename to src/egl/fg_structure_egl.h diff --git a/freeglut/freeglut/src/egl/fg_window_egl.c b/src/egl/fg_window_egl.c similarity index 84% rename from freeglut/freeglut/src/egl/fg_window_egl.c rename to src/egl/fg_window_egl.c index 110a38b..31c61d1 100644 --- a/freeglut/freeglut/src/egl/fg_window_egl.c +++ b/src/egl/fg_window_egl.c @@ -1,5 +1,4 @@ /* - * fg_display_android.c * * Window management methods for EGL * @@ -21,10 +20,32 @@ * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ + * + * + * Copyright (c) 2020 by Furkan Mudanyali + * + * This file is part of Freeglut-Vita + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + ****************************************************************************/ #include #include "fg_internal.h" +#ifdef TARGET_HOST_VITA +#include +#endif int fghChooseConfig(EGLConfig* config) { EGLint num_config; @@ -50,7 +71,7 @@ int fghChooseConfig(EGLConfig* config) { context, but currently our build system assumes EGL => GLES */ /* attribs[i++] = EGL_RENDERABLE_TYPE; */ /* attribs[i++] = EGL_OPENGL_BIT; */ -#ifdef TARGET_HOST_BLACKBERRY +#ifdef TARGET_HOST_BLACKBERRY || TARGET_HOST_VITA /* Only 888 and 565 seem to work. Based on http://qt.gitorious.org/qt/qtbase/source/893deb1a93021cdfabe038cdf1869de33a60cbc9:src/plugins/platforms/qnx/qqnxglcontext.cpp and https://twitter.com/BlackBerryDev/status/380720927475912706 */ @@ -62,13 +83,20 @@ int fghChooseConfig(EGLConfig* config) { ATTRIB_VAL(EGL_GREEN_SIZE, 1); ATTRIB_VAL(EGL_RED_SIZE, 1); #endif +#ifdef TARGET_HOST_VITA + ATTRIB_VAL(EGL_ALPHA_SIZE, 8); + ATTRIB_VAL(EGL_DEPTH_SIZE, 32); + ATTRIB_VAL(EGL_STENCIL_SIZE, 8); + ATTRIB_VAL(EGL_SURFACE_TYPE, 5); + ATTRIB(EGL_NONE); +#elif ATTRIB_VAL(EGL_ALPHA_SIZE, (fgState.DisplayMode & GLUT_ALPHA) ? 1 : 0); ATTRIB_VAL(EGL_DEPTH_SIZE, (fgState.DisplayMode & GLUT_DEPTH) ? 1 : 0); ATTRIB_VAL(EGL_STENCIL_SIZE, (fgState.DisplayMode & GLUT_STENCIL) ? 1 : 0); ATTRIB_VAL(EGL_SAMPLE_BUFFERS, (fgState.DisplayMode & GLUT_MULTISAMPLE) ? 1 : 0); ATTRIB_VAL(EGL_SAMPLES, (fgState.DisplayMode & GLUT_MULTISAMPLE) ? fgState.SampleNumber : 0); ATTRIB(EGL_NONE); - +#endif if (!eglChooseConfig(fgDisplay.pDisplay.egl.Display, attributes, config, 1, &num_config)) { fgWarning("eglChooseConfig: error %x\n", eglGetError()); @@ -84,7 +112,6 @@ int fghChooseConfig(EGLConfig* config) { EGLContext fghCreateNewContextEGL( SFG_Window* window ) { EGLContext context; EGLint ver = -1; - EGLDisplay eglDisplay = fgDisplay.pDisplay.egl.Display; EGLConfig eglConfig = window->Window.pContext.egl.Config; @@ -105,11 +132,12 @@ EGLContext fghCreateNewContextEGL( SFG_Window* window ) { fgWarning("Cannot initialize EGL context, err=%x\n", eglGetError()); fghContextCreationError(); } - +#ifndef TARGET_HOST_VITA eglQueryContext(fgDisplay.pDisplay.egl.Display, context, EGL_CONTEXT_CLIENT_VERSION, &ver); - if (ver != fgState.MajorVersion) { + if (2 != fgState.MajorVersion) { fgError("Wrong GLES major version: %d\n", ver); } +#endif #ifdef EGL_CONTEXT_MINOR_VERSION if (fgDisplay.pDisplay.egl.MinorVersion >= 5) { eglQueryContext(fgDisplay.pDisplay.egl.Display, context, EGL_CONTEXT_MINOR_VERSION, &ver); @@ -140,8 +168,11 @@ void fghPlatformOpenWindowEGL( SFG_Window* window ) { EGLDisplay display = fgDisplay.pDisplay.egl.Display; EGLConfig config = window->Window.pContext.egl.Config; - +#ifndef TARGET_HOST_VITA EGLSurface surface = eglCreateWindowSurface(display, config, window->Window.Handle, NULL); +#else + EGLSurface surface = eglCreateWindowSurface(display, config, VITA_WINDOW_960X544, NULL); +#endif if (surface == EGL_NO_SURFACE) fgError("Cannot create EGL window surface, err=%x\n", eglGetError()); window->Window.pContext.egl.Surface = surface; diff --git a/freeglut/freeglut/src/egl/fg_window_egl.h b/src/egl/fg_window_egl.h similarity index 100% rename from freeglut/freeglut/src/egl/fg_window_egl.h rename to src/egl/fg_window_egl.h diff --git a/freeglut/freeglut/src/fg_callback_macros.h b/src/fg_callback_macros.h similarity index 100% rename from freeglut/freeglut/src/fg_callback_macros.h rename to src/fg_callback_macros.h diff --git a/freeglut/freeglut/src/fg_callbacks.c b/src/fg_callbacks.c similarity index 100% rename from freeglut/freeglut/src/fg_callbacks.c rename to src/fg_callbacks.c diff --git a/freeglut/freeglut/src/fg_cursor.c b/src/fg_cursor.c similarity index 100% rename from freeglut/freeglut/src/fg_cursor.c rename to src/fg_cursor.c diff --git a/freeglut/freeglut/src/fg_display.c b/src/fg_display.c similarity index 100% rename from freeglut/freeglut/src/fg_display.c rename to src/fg_display.c diff --git a/freeglut/freeglut/src/fg_ext.c b/src/fg_ext.c similarity index 100% rename from freeglut/freeglut/src/fg_ext.c rename to src/fg_ext.c diff --git a/freeglut/freeglut/src/fg_font.c b/src/fg_font.c similarity index 100% rename from freeglut/freeglut/src/fg_font.c rename to src/fg_font.c diff --git a/freeglut/freeglut/src/fg_font_data.c b/src/fg_font_data.c similarity index 100% rename from freeglut/freeglut/src/fg_font_data.c rename to src/fg_font_data.c diff --git a/freeglut/freeglut/src/fg_gamemode.c b/src/fg_gamemode.c similarity index 100% rename from freeglut/freeglut/src/fg_gamemode.c rename to src/fg_gamemode.c diff --git a/freeglut/freeglut/src/fg_geometry.c b/src/fg_geometry.c similarity index 99% rename from freeglut/freeglut/src/fg_geometry.c rename to src/fg_geometry.c index e41f01d..ac2f8db 100644 --- a/freeglut/freeglut/src/fg_geometry.c +++ b/src/fg_geometry.c @@ -44,12 +44,14 @@ /* declare for drawing using the different OpenGL versions here so we can have a nice code order below */ +#ifndef VITA static void fghDrawGeometryWire11(GLfloat *vertices, GLfloat *normals, GLushort *vertIdxs, GLsizei numParts, GLsizei numVertPerPart, GLenum vertexMode, GLushort *vertIdxs2, GLsizei numParts2, GLsizei numVertPerPart2 ); static void fghDrawGeometrySolid11(GLfloat *vertices, GLfloat *normals, GLfloat *textcs, GLsizei numVertices, GLushort *vertIdxs, GLsizei numParts, GLsizei numVertIdxsPerPart); +#endif static void fghDrawGeometryWire20(GLfloat *vertices, GLfloat *normals, GLsizei numVertices, GLushort *vertIdxs, GLsizei numParts, GLsizei numVertPerPart, GLenum vertexMode, GLushort *vertIdxs2, GLsizei numParts2, GLsizei numVertPerPart2, @@ -60,7 +62,9 @@ static void fghDrawGeometrySolid20(GLfloat *vertices, GLfloat *normals, GLfloat GLint attribute_v_coord, GLint attribute_v_normal, GLint attribute_v_texture); /* declare function for generating visualization of normals */ static void fghGenerateNormalVisualization(GLfloat *vertices, GLfloat *normals, GLsizei numVertices); +#ifndef VITA static void fghDrawNormalVisualization11(); +#endif static void fghDrawNormalVisualization20(GLint attribute_v_coord); /* Drawing geometry: @@ -143,10 +147,12 @@ void fghDrawGeometryWire(GLfloat *vertices, GLfloat *normals, GLsizei numVertice vertIdxs, numParts, numVertPerPart, vertexMode, vertIdxs2, numParts2, numVertPerPart2, attribute_v_coord, attribute_v_normal); + #ifndef VITA else fghDrawGeometryWire11(vertices, normals, vertIdxs, numParts, numVertPerPart, vertexMode, vertIdxs2, numParts2, numVertPerPart2); + #endif } /* Draw the geometric shape with filled triangles @@ -197,6 +203,7 @@ void fghDrawGeometrySolid(GLfloat *vertices, GLfloat *normals, GLfloat *textcs, /* draw normals for each vertex as well */ fghDrawNormalVisualization20(attribute_v_coord); } + #ifndef VITA else { fghDrawGeometrySolid11(vertices, normals, textcs, numVertices, @@ -206,11 +213,13 @@ void fghDrawGeometrySolid(GLfloat *vertices, GLfloat *normals, GLfloat *textcs, /* draw normals for each vertex as well */ fghDrawNormalVisualization11(); } + #endif } /* Version for OpenGL (ES) 1.1 */ +#ifndef VITA static void fghDrawGeometryWire11(GLfloat *vertices, GLfloat *normals, GLushort *vertIdxs, GLsizei numParts, GLsizei numVertPerPart, GLenum vertexMode, GLushort *vertIdxs2, GLsizei numParts2, GLsizei numVertPerPart2 @@ -241,7 +250,6 @@ static void fghDrawGeometryWire11(GLfloat *vertices, GLfloat *normals, glDisableClientState(GL_NORMAL_ARRAY); } - static void fghDrawGeometrySolid11(GLfloat *vertices, GLfloat *normals, GLfloat *textcs, GLsizei numVertices, GLushort *vertIdxs, GLsizei numParts, GLsizei numVertIdxsPerPart) { @@ -273,7 +281,7 @@ static void fghDrawGeometrySolid11(GLfloat *vertices, GLfloat *normals, GLfloat if (textcs) glDisableClientState(GL_TEXTURE_COORD_ARRAY); } - +#endif /* Version for OpenGL (ES) >= 2.0 */ static void fghDrawGeometryWire20(GLfloat *vertices, GLfloat *normals, GLsizei numVertices, GLushort *vertIdxs, GLsizei numParts, GLsizei numVertPerPart, GLenum vertexMode, @@ -530,6 +538,7 @@ static void fghGenerateNormalVisualization(GLfloat *vertices, GLfloat *normals, } /* Version for OpenGL (ES) 1.1 */ +#ifndef VITA static void fghDrawNormalVisualization11() { GLfloat currentColor[4]; @@ -548,7 +557,7 @@ static void fghDrawNormalVisualization11() free(verticesForNormalVisualization); glColor4f(currentColor[0],currentColor[1],currentColor[2],currentColor[3]); } - +#endif /* Version for OpenGL (ES) >= 2.0 */ static void fghDrawNormalVisualization20(GLint attribute_v_coord) { diff --git a/freeglut/freeglut/src/fg_gl2.c b/src/fg_gl2.c similarity index 83% rename from freeglut/freeglut/src/fg_gl2.c rename to src/fg_gl2.c index 54b4285..38b0acb 100644 --- a/freeglut/freeglut/src/fg_gl2.c +++ b/src/fg_gl2.c @@ -27,20 +27,6 @@ #include "fg_internal.h" #include "fg_gl2.h" -#ifndef GL_ES_VERSION_2_0 -/* GLES2 has the corresponding entry points built-in, and these fgh-prefixed - * names are defined in fg_gl2.h header to reference them, for any other case, - * define them as function pointers here. - */ -FGH_PFNGLGENBUFFERSPROC fghGenBuffers; -FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers; -FGH_PFNGLBINDBUFFERPROC fghBindBuffer; -FGH_PFNGLBUFFERDATAPROC fghBufferData; -FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray; -FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray; -FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer; -#endif - void FGAPIENTRY glutSetVertexAttribCoord3(GLint attrib) { if (fgStructure.CurrentWindow != NULL) fgStructure.CurrentWindow->Window.attribute_v_coord = attrib; diff --git a/freeglut/freeglut/src/fg_gl2.h b/src/fg_gl2.h similarity index 87% rename from freeglut/freeglut/src/fg_gl2.h rename to src/fg_gl2.h index fb3d467..ab8ba5c 100644 --- a/freeglut/freeglut/src/fg_gl2.h +++ b/src/fg_gl2.h @@ -67,13 +67,13 @@ typedef void (APIENTRY *FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); typedef void (APIENTRY *FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint); typedef void (APIENTRY *FGH_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); -extern FGH_PFNGLGENBUFFERSPROC fghGenBuffers; -extern FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers; -extern FGH_PFNGLBINDBUFFERPROC fghBindBuffer; -extern FGH_PFNGLBUFFERDATAPROC fghBufferData; -extern FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray; -extern FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray; -extern FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer; +FGH_PFNGLGENBUFFERSPROC fghGenBuffers; +FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers; +FGH_PFNGLBINDBUFFERPROC fghBindBuffer; +FGH_PFNGLBUFFERDATAPROC fghBufferData; +FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray; +FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray; +FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer; # endif diff --git a/freeglut/freeglut/src/fg_init.c b/src/fg_init.c similarity index 99% rename from freeglut/freeglut/src/fg_init.c rename to src/fg_init.c index b8a38f7..26ea724 100644 --- a/freeglut/freeglut/src/fg_init.c +++ b/src/fg_init.c @@ -351,14 +351,12 @@ void FGAPIENTRY glutInit( int* pargc, char** argv ) fgCreateStructure( ); fghParseCommandLineArguments ( pargc, argv, &displayName, &geometry ); - /* * Have the display created now. If there wasn't a "-display" * in the program arguments, we will use the DISPLAY environment * variable for opening the X display (see code above): */ fgPlatformInitialize( displayName ); - /* * Geometry parsing deferred until here because we may need the screen * size. diff --git a/freeglut/freeglut/src/fg_init.h b/src/fg_init.h similarity index 100% rename from freeglut/freeglut/src/fg_init.h rename to src/fg_init.h diff --git a/freeglut/freeglut/src/fg_input_devices.c b/src/fg_input_devices.c similarity index 100% rename from freeglut/freeglut/src/fg_input_devices.c rename to src/fg_input_devices.c diff --git a/freeglut/freeglut/src/fg_internal.h b/src/fg_internal.h similarity index 97% rename from freeglut/freeglut/src/fg_internal.h rename to src/fg_internal.h index 2131f4a..2791844 100644 --- a/freeglut/freeglut/src/fg_internal.h +++ b/src/fg_internal.h @@ -23,7 +23,25 @@ * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ + * + * Copyright (c) 2020 by Furkan Mudanyali + * + * This file is part of Freeglut-Vita + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + ****************************************************************************/ #ifndef FREEGLUT_INTERNAL_H #define FREEGLUT_INTERNAL_H @@ -63,7 +81,9 @@ /* This is a placeholder until we get native OSX support ironed out -- JFF 11/18/09 */ # define TARGET_HOST_POSIX_X11 1 /* # define TARGET_HOST_MAC_OSX 1 */ - +#elif defined (__VITA__) +# define TARGET_HOST_VITA 1 +# define GL_ES_VERSION_2_0 1 #else # error "Unrecognized target host!" @@ -207,11 +227,12 @@ #if TARGET_HOST_ANDROID #include "android/fg_internal_android.h" #endif +#if TARGET_HOST_VITA +#include "vita/fg_internal_vita.h" +#endif #if TARGET_HOST_BLACKBERRY #include "blackberry/fg_internal_blackberry.h" #endif - - /* -- GLOBAL TYPE DEFINITIONS ---------------------------------------------- */ /* diff --git a/freeglut/freeglut/src/fg_joystick.c b/src/fg_joystick.c similarity index 100% rename from freeglut/freeglut/src/fg_joystick.c rename to src/fg_joystick.c diff --git a/freeglut/freeglut/src/fg_main.c b/src/fg_main.c similarity index 100% rename from freeglut/freeglut/src/fg_main.c rename to src/fg_main.c diff --git a/freeglut/freeglut/src/fg_menu.c b/src/fg_menu.c similarity index 100% rename from freeglut/freeglut/src/fg_menu.c rename to src/fg_menu.c diff --git a/freeglut/freeglut/src/fg_misc.c b/src/fg_misc.c similarity index 100% rename from freeglut/freeglut/src/fg_misc.c rename to src/fg_misc.c diff --git a/freeglut/freeglut/src/fg_overlay.c b/src/fg_overlay.c similarity index 100% rename from freeglut/freeglut/src/fg_overlay.c rename to src/fg_overlay.c diff --git a/freeglut/freeglut/src/fg_spaceball.c b/src/fg_spaceball.c similarity index 100% rename from freeglut/freeglut/src/fg_spaceball.c rename to src/fg_spaceball.c diff --git a/freeglut/freeglut/src/fg_state.c b/src/fg_state.c similarity index 100% rename from freeglut/freeglut/src/fg_state.c rename to src/fg_state.c diff --git a/freeglut/freeglut/src/fg_stroke_mono_roman.c b/src/fg_stroke_mono_roman.c similarity index 100% rename from freeglut/freeglut/src/fg_stroke_mono_roman.c rename to src/fg_stroke_mono_roman.c diff --git a/freeglut/freeglut/src/fg_stroke_roman.c b/src/fg_stroke_roman.c similarity index 100% rename from freeglut/freeglut/src/fg_stroke_roman.c rename to src/fg_stroke_roman.c diff --git a/freeglut/freeglut/src/fg_structure.c b/src/fg_structure.c similarity index 100% rename from freeglut/freeglut/src/fg_structure.c rename to src/fg_structure.c diff --git a/freeglut/freeglut/src/fg_teapot.c b/src/fg_teapot.c similarity index 100% rename from freeglut/freeglut/src/fg_teapot.c rename to src/fg_teapot.c diff --git a/freeglut/freeglut/src/fg_teapot_data.h b/src/fg_teapot_data.h similarity index 100% rename from freeglut/freeglut/src/fg_teapot_data.h rename to src/fg_teapot_data.h diff --git a/freeglut/freeglut/src/fg_version.h b/src/fg_version.h similarity index 100% rename from freeglut/freeglut/src/fg_version.h rename to src/fg_version.h diff --git a/freeglut/freeglut/src/fg_version.h.in b/src/fg_version.h.in similarity index 100% rename from freeglut/freeglut/src/fg_version.h.in rename to src/fg_version.h.in diff --git a/freeglut/freeglut/src/fg_videoresize.c b/src/fg_videoresize.c similarity index 100% rename from freeglut/freeglut/src/fg_videoresize.c rename to src/fg_videoresize.c diff --git a/freeglut/freeglut/src/fg_window.c b/src/fg_window.c similarity index 100% rename from freeglut/freeglut/src/fg_window.c rename to src/fg_window.c diff --git a/freeglut/freeglut/src/freeglutdll.def.in b/src/freeglutdll.def.in similarity index 100% rename from freeglut/freeglut/src/freeglutdll.def.in rename to src/freeglutdll.def.in diff --git a/freeglut/freeglut/src/gles_stubs.c b/src/gles_stubs.c similarity index 100% rename from freeglut/freeglut/src/gles_stubs.c rename to src/gles_stubs.c diff --git a/freeglut/freeglut/src/mswin/fg_cursor_mswin.c b/src/mswin/fg_cursor_mswin.c similarity index 100% rename from freeglut/freeglut/src/mswin/fg_cursor_mswin.c rename to src/mswin/fg_cursor_mswin.c diff --git a/freeglut/freeglut/src/mswin/fg_display_mswin.c b/src/mswin/fg_display_mswin.c similarity index 100% rename from freeglut/freeglut/src/mswin/fg_display_mswin.c rename to src/mswin/fg_display_mswin.c diff --git a/freeglut/freeglut/src/mswin/fg_ext_mswin.c b/src/mswin/fg_ext_mswin.c similarity index 100% rename from freeglut/freeglut/src/mswin/fg_ext_mswin.c rename to src/mswin/fg_ext_mswin.c diff --git a/freeglut/freeglut/src/mswin/fg_gamemode_mswin.c b/src/mswin/fg_gamemode_mswin.c similarity index 100% rename from freeglut/freeglut/src/mswin/fg_gamemode_mswin.c rename to src/mswin/fg_gamemode_mswin.c diff --git a/freeglut/freeglut/src/mswin/fg_init_mswin.c b/src/mswin/fg_init_mswin.c similarity index 100% rename from freeglut/freeglut/src/mswin/fg_init_mswin.c rename to src/mswin/fg_init_mswin.c diff --git a/freeglut/freeglut/src/mswin/fg_input_devices_mswin.c b/src/mswin/fg_input_devices_mswin.c similarity index 100% rename from freeglut/freeglut/src/mswin/fg_input_devices_mswin.c rename to src/mswin/fg_input_devices_mswin.c diff --git a/freeglut/freeglut/src/mswin/fg_internal_mswin.h b/src/mswin/fg_internal_mswin.h similarity index 100% rename from freeglut/freeglut/src/mswin/fg_internal_mswin.h rename to src/mswin/fg_internal_mswin.h diff --git a/freeglut/freeglut/src/mswin/fg_joystick_mswin.c b/src/mswin/fg_joystick_mswin.c similarity index 100% rename from freeglut/freeglut/src/mswin/fg_joystick_mswin.c rename to src/mswin/fg_joystick_mswin.c diff --git a/freeglut/freeglut/src/mswin/fg_main_mswin.c b/src/mswin/fg_main_mswin.c similarity index 100% rename from freeglut/freeglut/src/mswin/fg_main_mswin.c rename to src/mswin/fg_main_mswin.c diff --git a/freeglut/freeglut/src/mswin/fg_menu_mswin.c b/src/mswin/fg_menu_mswin.c similarity index 100% rename from freeglut/freeglut/src/mswin/fg_menu_mswin.c rename to src/mswin/fg_menu_mswin.c diff --git a/freeglut/freeglut/src/mswin/fg_spaceball_mswin.c b/src/mswin/fg_spaceball_mswin.c similarity index 100% rename from freeglut/freeglut/src/mswin/fg_spaceball_mswin.c rename to src/mswin/fg_spaceball_mswin.c diff --git a/freeglut/freeglut/src/mswin/fg_state_mswin.c b/src/mswin/fg_state_mswin.c similarity index 100% rename from freeglut/freeglut/src/mswin/fg_state_mswin.c rename to src/mswin/fg_state_mswin.c diff --git a/freeglut/freeglut/src/mswin/fg_structure_mswin.c b/src/mswin/fg_structure_mswin.c similarity index 100% rename from freeglut/freeglut/src/mswin/fg_structure_mswin.c rename to src/mswin/fg_structure_mswin.c diff --git a/freeglut/freeglut/src/mswin/fg_window_mswin.c b/src/mswin/fg_window_mswin.c similarity index 100% rename from freeglut/freeglut/src/mswin/fg_window_mswin.c rename to src/mswin/fg_window_mswin.c diff --git a/freeglut/freeglut/src/util/xparsegeometry_repl.c b/src/util/xparsegeometry_repl.c similarity index 100% rename from freeglut/freeglut/src/util/xparsegeometry_repl.c rename to src/util/xparsegeometry_repl.c diff --git a/freeglut/freeglut/src/util/xparsegeometry_repl.h b/src/util/xparsegeometry_repl.h similarity index 100% rename from freeglut/freeglut/src/util/xparsegeometry_repl.h rename to src/util/xparsegeometry_repl.h diff --git a/src/vita/fg_init_vita.c b/src/vita/fg_init_vita.c new file mode 100644 index 0000000..f30fccd --- /dev/null +++ b/src/vita/fg_init_vita.c @@ -0,0 +1,47 @@ +/***************************************************************************** + * + * Copyright (c) 2020 by Furkan Mudanyali + * + * This file is part of Freeglut-Vita + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + ****************************************************************************/ + +#include +#include "fg_internal.h" +#include "fg_init.h" +#include "egl/fg_init_egl.h" + +void fgPlatformDeinitialiseInputDevices ( void ) +{ + fghCloseInputDevices (); + fgState.JoysticksInitialised = GL_FALSE; + fgState.InputDevsInitialised = GL_FALSE; +} + +void fgPlatformInitialize() +{ + fghPlatformInitializeEGL(); + + /* Get start time */ + fgState.Time = fgSystemTime(); + + fgState.Initialised = GL_TRUE; +} + +void fgPlatformCloseDisplay() +{ + fghPlatformCloseDisplayEGL(); +} diff --git a/src/vita/fg_input_vita.c b/src/vita/fg_input_vita.c new file mode 100644 index 0000000..b0b4c1e --- /dev/null +++ b/src/vita/fg_input_vita.c @@ -0,0 +1,33 @@ +/***************************************************************************** + * + * Copyright (c) 2020 by Furkan Mudanyali + * + * This file is part of Freeglut-Vita + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + ****************************************************************************/ + +#include +#include "fg_internal.h" +typedef struct _serialport SERIALPORT; + +void fgPlatformRegisterDialDevice ( const char *dial_device ) { + fgWarning("GLUT_HAS_DIAL_AND_BUTTON_BOX: not implemented"); +} +SERIALPORT *fg_serial_open ( const char *device ) { return NULL; } +void fg_serial_close(SERIALPORT *port) {} +int fg_serial_getchar(SERIALPORT *port) { return EOF; } +int fg_serial_putchar(SERIALPORT *port, unsigned char ch) { return 0; } +void fg_serial_flush ( SERIALPORT *port ) {} diff --git a/src/vita/fg_internal_vita.h b/src/vita/fg_internal_vita.h new file mode 100644 index 0000000..67ed122 --- /dev/null +++ b/src/vita/fg_internal_vita.h @@ -0,0 +1,84 @@ +/***************************************************************************** + * + * Copyright (c) 2020 by Furkan Mudanyali + * + * This file is part of Freeglut-Vita + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + ****************************************************************************/ + +#include "egl/fg_internal_egl.h" + +/* The structure used by display initialization in fg_init.c */ +typedef struct tagSFG_PlatformDisplay SFG_PlatformDisplay; +struct tagSFG_PlatformContextEGL egl; +struct tagSFG_PlatformDisplay +{ + struct tagSFG_PlatformDisplayEGL egl; + EGLNativeWindowType single_native_window; +}; + +typedef struct tagSFG_PlatformContext SFG_PlatformContext; +/* SFG_PlatformContext is used for SFG_Window.Window */ +struct tagSFG_PlatformContext +{ + struct tagSFG_PlatformContextEGL egl; +}; +/* -- JOYSTICK-SPECIFIC STRUCTURES AND TYPES ------------------------------- */ +/* + * Initial defines from "js.h" starting around line 33 with the existing "fg_joystick.c" + * interspersed + */ + + /* + * We'll put these values in and that should + * allow the code to at least compile when there is + * no support. The JS open routine should error out + * and shut off all the code downstream anyway and if + * the application doesn't use a joystick we'll be fine. + */ + + struct JS_DATA_TYPE + { + int buttons; + int x; + int y; + }; + +# define JS_RETURN (sizeof(struct JS_DATA_TYPE)) +/* XXX It might be better to poll the operating system for the numbers of buttons and + * XXX axes and then dynamically allocate the arrays. + */ +# define _JS_MAX_AXES 16 +typedef struct tagSFG_PlatformJoystick SFG_PlatformJoystick; +struct tagSFG_PlatformJoystick +{ + struct JS_DATA_TYPE js; + + char fname [ 128 ]; + int fd; +}; +/* Window's state description. This structure should be kept portable. */ +typedef struct tagSFG_PlatformWindowState SFG_PlatformWindowState; +struct tagSFG_PlatformWindowState +{ + char unused; +}; +#define FREEGLUT_MENU_FONT NULL + +#define FREEGLUT_MENU_PEN_FORE_COLORS {0.0f, 0.0f, 0.0f, 1.0f} +#define FREEGLUT_MENU_PEN_BACK_COLORS {0.70f, 0.70f, 0.70f, 1.0f} +#define FREEGLUT_MENU_PEN_HFORE_COLORS {0.0f, 0.0f, 0.0f, 1.0f} +#define FREEGLUT_MENU_PEN_HBACK_COLORS {1.0f, 1.0f, 1.0f, 1.0f} \ No newline at end of file diff --git a/src/vita/fg_main_vita.c b/src/vita/fg_main_vita.c new file mode 100644 index 0000000..19d58ca --- /dev/null +++ b/src/vita/fg_main_vita.c @@ -0,0 +1,148 @@ +/***************************************************************************** + * + * Copyright (c) 2020 by Furkan Mudanyali + * + * This file is part of Freeglut-Vita + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + ****************************************************************************/ + +#include +#include "fg_internal.h" +#include "egl/fg_window_egl.h" +#include +#include + +extern void fghOnReshapeNotify(SFG_Window *window, int width, int height, GLboolean forceNotify); +extern void fghOnPositionNotify(SFG_Window *window, int x, int y, GLboolean forceNotify); +extern void fgPlatformFullScreenToggle( SFG_Window *win ); +extern void fgPlatformPositionWindow( SFG_Window *window, int x, int y ); +extern void fgPlatformReshapeWindow ( SFG_Window *window, int width, int height ); +extern void fgPlatformPushWindow( SFG_Window *window ); +extern void fgPlatformPopWindow( SFG_Window *window ); +extern void fgPlatformHideWindow( SFG_Window *window ); +extern void fgPlatformIconifyWindow( SFG_Window *window ); +extern void fgPlatformShowWindow( SFG_Window *window ); +/* Function to read key press, needs work so it can +detect multiple presses. */ +static unsigned char read_key() { + SceCtrlData ctrl; + sceCtrlPeekBufferPositive(0, &ctrl, 1); + switch(ctrl.buttons){ + case SCE_CTRL_CROSS: return GLUT_KEY_F1; + case SCE_CTRL_SQUARE: return GLUT_KEY_F2; + case SCE_CTRL_CIRCLE: return GLUT_KEY_F3; + case SCE_CTRL_TRIANGLE: return GLUT_KEY_F4; + case SCE_CTRL_L1: return GLUT_KEY_F5; + case SCE_CTRL_R1: return GLUT_KEY_F6; + case SCE_CTRL_L2: return GLUT_KEY_F7; + case SCE_CTRL_R2: return GLUT_KEY_F8; + case SCE_CTRL_L3: return GLUT_KEY_F9; + case SCE_CTRL_R3: return GLUT_KEY_F10; + case SCE_CTRL_SELECT: return GLUT_KEY_F11; + case SCE_CTRL_START: return GLUT_KEY_F12; + case SCE_CTRL_UP: return GLUT_KEY_UP; + case SCE_CTRL_DOWN: return GLUT_KEY_DOWN; + case SCE_CTRL_LEFT: return GLUT_KEY_LEFT; + case SCE_CTRL_RIGHT: return GLUT_KEY_RIGHT; + default: return 0; + } +} +/* This function is called every frame or something. */ +void fgPlatformProcessSingleEvent ( void ) +{ + SFG_Window* window = fgStructure.CurrentWindow; + if (window != NULL && window->Window.Handle != NULL) { + int32_t width = 960; + int32_t height = 544; + fghOnReshapeNotify(window,width,height,GL_FALSE); + } + unsigned char keypress = read_key(); + if (keypress!=0) + INVOKE_WCB(*window, Special, (keypress, window->State.MouseX, window->State.MouseY)); +} + +void fgPlatformMainLoopPreliminaryWork ( void ) +{ +// +} + +unsigned long fgPlatformSystemTime ( void ) +{ + struct timeval now; + gettimeofday( &now, NULL ); + return now.tv_usec/1000 + now.tv_sec*1000; +} + +void fgPlatformSleepForEvents( long msec ) +{ + sceKernelDelayThread(msec); +} + +void fgPlatformOpenWindow( SFG_Window* window, const char* title, + GLboolean positionUse, int x, int y, + GLboolean sizeUse, int w, int h, + GLboolean gameMode, GLboolean isSubWindow ); + +/* deal with work list items */ +void fgPlatformInitWork(SFG_Window* window) +{ + /* notify windowStatus/visibility */ + INVOKE_WCB( *window, WindowStatus, ( GLUT_FULLY_RETAINED ) ); + + /* Position callback, always at 0,0 */ + fghOnPositionNotify(window, 0, 0, GL_TRUE); +} + +void fgPlatformPosResZordWork(SFG_Window* window, unsigned int workMask) +{ + if (workMask & GLUT_FULL_SCREEN_WORK) + fgPlatformFullScreenToggle( window ); + if (workMask & GLUT_POSITION_WORK) + fgPlatformPositionWindow( window, window->State.DesiredXpos, window->State.DesiredYpos ); + if (workMask & GLUT_SIZE_WORK) + fgPlatformReshapeWindow ( window, window->State.DesiredWidth, window->State.DesiredHeight ); + if (workMask & GLUT_ZORDER_WORK) + { + if (window->State.DesiredZOrder < 0) + fgPlatformPushWindow( window ); + else + fgPlatformPopWindow( window ); + } +} + +void fgPlatformVisibilityWork(SFG_Window* window) +{ + /* Visibility status of window should get updated in the window message handlers + * For now, none of these functions called below do anything, so don't worry + * about it + */ + SFG_Window *win = window; + switch (window->State.DesiredVisibility) + { + case DesireHiddenState: + fgPlatformHideWindow( window ); + break; + case DesireIconicState: + /* Call on top-level window */ + while (win->Parent) + win = win->Parent; + fgPlatformIconifyWindow( win ); + break; + case DesireNormalState: + fgPlatformShowWindow( window ); + break; + } +} \ No newline at end of file diff --git a/src/vita/fg_main_vita.h b/src/vita/fg_main_vita.h new file mode 100644 index 0000000..7979ae5 --- /dev/null +++ b/src/vita/fg_main_vita.h @@ -0,0 +1,25 @@ +/***************************************************************************** + * + * Copyright (c) 2020 by Furkan Mudanyali + * + * This file is part of Freeglut-Vita + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + ****************************************************************************/ + +extern void fgPlatformProcessSingleEvent(void); +extern unsigned long fgPlatformSystemTime(void); +extern void fgPlatformSleepForEvents(long msec); +extern void fgPlatformMainLoopPreliminaryWork(void); \ No newline at end of file diff --git a/src/vita/fg_state_vita.c b/src/vita/fg_state_vita.c new file mode 100644 index 0000000..495625f --- /dev/null +++ b/src/vita/fg_state_vita.c @@ -0,0 +1,87 @@ +/***************************************************************************** + * + * Copyright (c) 2020 by Furkan Mudanyali + * + * This file is part of Freeglut-Vita + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + ****************************************************************************/ + +#include +#include "fg_internal.h" +#include "egl/fg_state_egl.h" +#include "egl/fg_structure_egl.h" + +int fgPlatformGlutDeviceGet ( GLenum eWhat ) +{ + switch( eWhat ) + { + case GLUT_HAS_KEYBOARD: + return 1; + + case GLUT_HAS_MOUSE: + return 1 ; + + case GLUT_NUM_MOUSE_BUTTONS: + return 1; + + default: + fgWarning( "glutDeviceGet(): missing enum handle %d", eWhat ); + break; + } + + /* And now -- the failure. */ + return -1; +} + +int fgPlatformGlutGet ( GLenum eWhat ) +{ + switch (eWhat) { + /* One full-screen window only */ + case GLUT_WINDOW_X: + case GLUT_WINDOW_Y: + case GLUT_WINDOW_BORDER_WIDTH: + case GLUT_WINDOW_HEADER_HEIGHT: + return 0; + + case GLUT_WINDOW_WIDTH: + case GLUT_WINDOW_HEIGHT: + { + if ( fgStructure.CurrentWindow == NULL ) + return 0; + int32_t width = 960; + int32_t height = 544; + switch ( eWhat ) + { + case GLUT_WINDOW_WIDTH: + return width; + case GLUT_WINDOW_HEIGHT: + return height; + } + } + + case GLUT_WINDOW_COLORMAP_SIZE: + return 0; + + default: + return fghPlatformGlutGetEGL(eWhat); + } + return -1; +} + +void fgPlatformCreateWindow ( SFG_Window *window ) +{ + fghPlatformCreateWindowEGL(window); +} \ No newline at end of file diff --git a/src/vita/fg_window_vita.c b/src/vita/fg_window_vita.c new file mode 100644 index 0000000..bb7b309 --- /dev/null +++ b/src/vita/fg_window_vita.c @@ -0,0 +1,141 @@ +/***************************************************************************** + * + * Copyright (c) 2020 by Furkan Mudanyali + * + * This file is part of Freeglut-Vita + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + ****************************************************************************/ + +#include +#include "fg_internal.h" +#include "egl/fg_window_egl.h" + +void fgPlatformOpenWindow( SFG_Window* window, const char* title, + GLboolean positionUse, int x, int y, + GLboolean sizeUse, int w, int h, + GLboolean gameMode, GLboolean isSubWindow ) +{ + /* TODO: only one full-screen window possible? */ + if (fgDisplay.pDisplay.single_native_window != NULL) { + fgWarning("You can't have more than one window on Vita"); + return; + } + fgDisplay.pDisplay.single_native_window = window; + window->Window.Handle = fgDisplay.pDisplay.single_native_window; + window->State.WorkMask |= GLUT_INIT_WORK; + + /* Create context */ + fghChooseConfig(&window->Window.pContext.egl.Config); + window->Window.Context = fghCreateNewContextEGL(window); + + EGLDisplay display = fgDisplay.pDisplay.egl.Display; + EGLint vid; + eglGetConfigAttrib(display, window->Window.pContext.egl.Config, EGL_NATIVE_VISUAL_ID, &vid); + fghPlatformOpenWindowEGL(window); + + /* Bind context to the current thread if it's lost */ + if (eglGetCurrentContext() == EGL_NO_CONTEXT && + eglMakeCurrent(fgDisplay.pDisplay.egl.Display, + window->Window.pContext.egl.Surface, + window->Window.pContext.egl.Surface, + window->Window.Context) == EGL_FALSE) + fgError("eglMakeCurrent: err=%x\n", eglGetError()); + window->State.Visible = GL_TRUE; +} + +void fgPlatformReshapeWindow ( SFG_Window *window, int width, int height ) +{ + fprintf(stderr, "fgPlatformReshapeWindow: STUB\n"); +} + +/* + * Closes a window, destroying the frame and OpenGL context + */ +void fgPlatformCloseWindow( SFG_Window* window ) +{ + fghPlatformCloseWindowEGL(window); +} + +/* + * This function makes the specified window visible + */ +void fgPlatformShowWindow( void ) +{ + fprintf(stderr, "fgPlatformShowWindow: STUB\n"); +} + +/* + * This function hides the specified window + */ +void fgPlatformHideWindow( SFG_Window *window ) +{ + fprintf(stderr, "fgPlatformHideWindow: STUB\n"); +} + +/* + * Iconify the specified window (top-level windows only) + */ +void fgPlatformIconifyWindow( SFG_Window *window ) +{ + fprintf(stderr, "fgPlatformGlutIconifyWindow: STUB\n"); +} + +/* + * Set the current window's title + */ +void fgPlatformGlutSetWindowTitle( const char* title ) +{ + fprintf(stderr, "fgPlatformGlutSetWindowTitle: STUB\n"); +} + +/* + * Set the current window's iconified title + */ +void fgPlatformGlutSetIconTitle( const char* title ) +{ + fprintf(stderr, "fgPlatformGlutSetIconTitle: STUB\n");} + +/* + * Change the specified window's position + */ +void fgPlatformPositionWindow( SFG_Window *window, int x, int y ) +{ + fprintf(stderr, "fgPlatformPositionWindow: STUB\n"); +} + +/* + * Lowers the specified window (by Z order change) + */ +void fgPlatformPushWindow( SFG_Window *window ) +{ + fprintf(stderr, "fgPlatformPushWindow: STUB\n"); +} + +/* + * Raises the specified window (by Z order change) + */ +void fgPlatformPopWindow( SFG_Window *window ) +{ + fprintf(stderr, "fgPlatformPopWindow: STUB\n"); +} + +/* + * Toggle the window's full screen state. + */ +void fgPlatformFullScreenToggle( SFG_Window *win ) +{ + fprintf(stderr, "fgPlatformFullScreenToggle: STUB\n"); +} \ No newline at end of file diff --git a/freeglut/freeglut/src/wayland/fg_cursor_wl.c b/src/wayland/fg_cursor_wl.c similarity index 100% rename from freeglut/freeglut/src/wayland/fg_cursor_wl.c rename to src/wayland/fg_cursor_wl.c diff --git a/freeglut/freeglut/src/wayland/fg_ext_wl.c b/src/wayland/fg_ext_wl.c similarity index 100% rename from freeglut/freeglut/src/wayland/fg_ext_wl.c rename to src/wayland/fg_ext_wl.c diff --git a/freeglut/freeglut/src/wayland/fg_gamemode_wl.c b/src/wayland/fg_gamemode_wl.c similarity index 100% rename from freeglut/freeglut/src/wayland/fg_gamemode_wl.c rename to src/wayland/fg_gamemode_wl.c diff --git a/freeglut/freeglut/src/wayland/fg_init_wl.c b/src/wayland/fg_init_wl.c similarity index 100% rename from freeglut/freeglut/src/wayland/fg_init_wl.c rename to src/wayland/fg_init_wl.c diff --git a/freeglut/freeglut/src/wayland/fg_input_devices_wl.c b/src/wayland/fg_input_devices_wl.c similarity index 100% rename from freeglut/freeglut/src/wayland/fg_input_devices_wl.c rename to src/wayland/fg_input_devices_wl.c diff --git a/freeglut/freeglut/src/wayland/fg_internal_wl.h b/src/wayland/fg_internal_wl.h similarity index 91% rename from freeglut/freeglut/src/wayland/fg_internal_wl.h rename to src/wayland/fg_internal_wl.h index 4672d4e..81bd5bc 100644 --- a/freeglut/freeglut/src/wayland/fg_internal_wl.h +++ b/src/wayland/fg_internal_wl.h @@ -102,9 +102,21 @@ struct tagSFG_PlatformWindowState #include # if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) +/* XXX The below hack is done until freeglut's autoconf is updated. */ # define HAVE_USB_JS 1 -# include +# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +# include +# else +/* + * XXX NetBSD/amd64 systems may find that they have to steal the + * XXX /usr/include/machine/joystick.h from a NetBSD/i386 system. + * XXX I cannot comment whether that works for the interface, but + * XXX it lets you compile...(^& I do not think that we can do away + * XXX with this header. + */ +# include /* For analog joysticks */ +# endif # define JS_DATA_TYPE joystick # define JS_RETURN (sizeof(struct JS_DATA_TYPE)) # endif diff --git a/freeglut/freeglut/src/wayland/fg_main_wl.c b/src/wayland/fg_main_wl.c similarity index 100% rename from freeglut/freeglut/src/wayland/fg_main_wl.c rename to src/wayland/fg_main_wl.c diff --git a/freeglut/freeglut/src/wayland/fg_state_wl.c b/src/wayland/fg_state_wl.c similarity index 100% rename from freeglut/freeglut/src/wayland/fg_state_wl.c rename to src/wayland/fg_state_wl.c diff --git a/freeglut/freeglut/src/wayland/fg_structure_wl.c b/src/wayland/fg_structure_wl.c similarity index 100% rename from freeglut/freeglut/src/wayland/fg_structure_wl.c rename to src/wayland/fg_structure_wl.c diff --git a/freeglut/freeglut/src/wayland/fg_window_wl.c b/src/wayland/fg_window_wl.c similarity index 100% rename from freeglut/freeglut/src/wayland/fg_window_wl.c rename to src/wayland/fg_window_wl.c diff --git a/freeglut/freeglut/src/x11/fg_cursor_x11.c b/src/x11/fg_cursor_x11.c similarity index 100% rename from freeglut/freeglut/src/x11/fg_cursor_x11.c rename to src/x11/fg_cursor_x11.c diff --git a/freeglut/freeglut/src/x11/fg_display_x11_glx.c b/src/x11/fg_display_x11_glx.c similarity index 100% rename from freeglut/freeglut/src/x11/fg_display_x11_glx.c rename to src/x11/fg_display_x11_glx.c diff --git a/freeglut/freeglut/src/x11/fg_ext_x11.c b/src/x11/fg_ext_x11.c similarity index 100% rename from freeglut/freeglut/src/x11/fg_ext_x11.c rename to src/x11/fg_ext_x11.c diff --git a/freeglut/freeglut/src/x11/fg_gamemode_x11.c b/src/x11/fg_gamemode_x11.c similarity index 100% rename from freeglut/freeglut/src/x11/fg_gamemode_x11.c rename to src/x11/fg_gamemode_x11.c diff --git a/freeglut/freeglut/src/x11/fg_glutfont_definitions_x11.c b/src/x11/fg_glutfont_definitions_x11.c similarity index 100% rename from freeglut/freeglut/src/x11/fg_glutfont_definitions_x11.c rename to src/x11/fg_glutfont_definitions_x11.c diff --git a/freeglut/freeglut/src/x11/fg_init_x11.c b/src/x11/fg_init_x11.c similarity index 100% rename from freeglut/freeglut/src/x11/fg_init_x11.c rename to src/x11/fg_init_x11.c diff --git a/freeglut/freeglut/src/x11/fg_input_devices_x11.c b/src/x11/fg_input_devices_x11.c similarity index 100% rename from freeglut/freeglut/src/x11/fg_input_devices_x11.c rename to src/x11/fg_input_devices_x11.c diff --git a/freeglut/freeglut/src/x11/fg_internal_x11.h b/src/x11/fg_internal_x11.h similarity index 93% rename from freeglut/freeglut/src/x11/fg_internal_x11.h rename to src/x11/fg_internal_x11.h index 330cb86..09a238a 100644 --- a/freeglut/freeglut/src/x11/fg_internal_x11.h +++ b/src/x11/fg_internal_x11.h @@ -136,8 +136,21 @@ struct tagSFG_PlatformWindowState #include # if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) +/* XXX The below hack is done until freeglut's autoconf is updated. */ # define HAVE_USB_JS 1 -# include + +# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +# include +# else +/* + * XXX NetBSD/amd64 systems may find that they have to steal the + * XXX /usr/include/machine/joystick.h from a NetBSD/i386 system. + * XXX I cannot comment whether that works for the interface, but + * XXX it lets you compile...(^& I do not think that we can do away + * XXX with this header. + */ +# include /* For analog joysticks */ +# endif # define JS_DATA_TYPE joystick # define JS_RETURN (sizeof(struct JS_DATA_TYPE)) # endif diff --git a/freeglut/freeglut/src/x11/fg_internal_x11_glx.h b/src/x11/fg_internal_x11_glx.h similarity index 100% rename from freeglut/freeglut/src/x11/fg_internal_x11_glx.h rename to src/x11/fg_internal_x11_glx.h diff --git a/freeglut/freeglut/src/x11/fg_joystick_x11.c b/src/x11/fg_joystick_x11.c similarity index 100% rename from freeglut/freeglut/src/x11/fg_joystick_x11.c rename to src/x11/fg_joystick_x11.c diff --git a/freeglut/freeglut/src/x11/fg_main_x11.c b/src/x11/fg_main_x11.c similarity index 100% rename from freeglut/freeglut/src/x11/fg_main_x11.c rename to src/x11/fg_main_x11.c diff --git a/freeglut/freeglut/src/x11/fg_menu_x11.c b/src/x11/fg_menu_x11.c similarity index 100% rename from freeglut/freeglut/src/x11/fg_menu_x11.c rename to src/x11/fg_menu_x11.c diff --git a/freeglut/freeglut/src/x11/fg_spaceball_x11.c b/src/x11/fg_spaceball_x11.c similarity index 100% rename from freeglut/freeglut/src/x11/fg_spaceball_x11.c rename to src/x11/fg_spaceball_x11.c diff --git a/freeglut/freeglut/src/x11/fg_state_x11.c b/src/x11/fg_state_x11.c similarity index 100% rename from freeglut/freeglut/src/x11/fg_state_x11.c rename to src/x11/fg_state_x11.c diff --git a/freeglut/freeglut/src/x11/fg_state_x11_glx.c b/src/x11/fg_state_x11_glx.c similarity index 100% rename from freeglut/freeglut/src/x11/fg_state_x11_glx.c rename to src/x11/fg_state_x11_glx.c diff --git a/freeglut/freeglut/src/x11/fg_state_x11_glx.h b/src/x11/fg_state_x11_glx.h similarity index 100% rename from freeglut/freeglut/src/x11/fg_state_x11_glx.h rename to src/x11/fg_state_x11_glx.h diff --git a/freeglut/freeglut/src/x11/fg_structure_x11.c b/src/x11/fg_structure_x11.c similarity index 100% rename from freeglut/freeglut/src/x11/fg_structure_x11.c rename to src/x11/fg_structure_x11.c diff --git a/freeglut/freeglut/src/x11/fg_window_x11.c b/src/x11/fg_window_x11.c similarity index 100% rename from freeglut/freeglut/src/x11/fg_window_x11.c rename to src/x11/fg_window_x11.c diff --git a/freeglut/freeglut/src/x11/fg_window_x11_glx.c b/src/x11/fg_window_x11_glx.c similarity index 100% rename from freeglut/freeglut/src/x11/fg_window_x11_glx.c rename to src/x11/fg_window_x11_glx.c diff --git a/freeglut/freeglut/src/x11/fg_window_x11_glx.h b/src/x11/fg_window_x11_glx.h similarity index 100% rename from freeglut/freeglut/src/x11/fg_window_x11_glx.h rename to src/x11/fg_window_x11_glx.h diff --git a/freeglut/freeglut/src/x11/fg_xinput_x11.c b/src/x11/fg_xinput_x11.c similarity index 100% rename from freeglut/freeglut/src/x11/fg_xinput_x11.c rename to src/x11/fg_xinput_x11.c