GithubHelp home page GithubHelp logo

freeglutproject / freeglut Goto Github PK

View Code? Open in Web Editor NEW
686.0 47.0 231.0 7.32 MB

Free implementation of the OpenGL Utility Toolkit (GLUT)

Home Page: http://freeglut.sourceforge.net

License: Other

CMake 2.13% Makefile 0.16% C 97.61% C++ 0.10%

freeglut's Introduction

freeglut

GNU/Linux (X11) build status FreeBSD (X11) build status Windows (MSVC) build status Windows (MSVC 6.0) build status Windows (MinGW) build status MacOS X (X11) build status

OVERVIEW

Freeglut, the Free OpenGL Utility Toolkit, is meant to be a free alternative to Mark Kilgard's GLUT library. Freeglut is free software, distributed under an MIT/X11 style license. You are free to use, modify, and redistribute freeglut with or without modifications (see COPYING for details).

In short, freeglut can be used by OpenGL programs to perform those tasks which would normally require platform-specific code. Tasks like creating a window, creating an OpenGL context and binding it to the window, and processing input events. Freeglut provides a concise and elegant API to handle those tasks, in a platform-independent manner, keeping the application simple and portable.

One of the main goals of freeglut, is maximum compatibility. Freeglut is both source and binary-compatible with the original GLUT, and can be used as a drop-in replacement for it. We take great care to maintain a stable API and ABI, and to introduce any new features and improvements in a way which does not compromise compatibility.

Freeglut can be used with a wide range of OpenGL implementations, from the very early OpenGL 1.0 on SGI computers, to the very latest modern OpenGL versions on current GPUs. It can be used to create a classic OpenGL context, or a versioned core profile or compatibility context. Freeglut can also be used with OpenGL ES, on desktop or mobile devices.

PORTS

Currently supported platforms:

  • UNIX systems with X11 or Wayland (such as GNU/Linux, FreeBSD, IRIX, etc)
  • MS Windows
  • macOS with XQuartz (no native Cocoa support yet)
  • Android (NDK)
  • BlackBerry
  • Nintendo GameCube and Wii

Consult the platform-specific readme files for details on the level of support and build instructions.

INSTALLATION

Freeglut relies on cmake (minimum 3.1.0) to generate build files for all the different supported platforms and toolchains.

See README.cmake as a starting point, as well as the other README files for further info.

For those cases where using cmake is inconvenient, we also provide a set of unofficial, unsupported, possibly unmaintained, but potentially useful, alternative build files. See altbuild/README.md for details.

CONTRIBUTING

Patches and pull requests for bugfixes and new features are certainly welcome. Please send patches to the freeglut-developer mailing list (see CONTACT below).

Feel free to report any bugs you encounter, using the github issues system.

Older bug reports and feature requests are still reachable on:

But you are encouraged to use github issues for new ones.

Alternatively you can also send bug reports and feature requests to the freeglut-developer mailing list if you prefer. Extended discussions about new features and design issues for large contributions, are best suited to the mailing list.

CONTACT

FreeGLUT website: http://freeglut.sourceforge.net

FreeGLUT mailing lists:

You need to subscribe before posting to any of our mailing lists. Make sure to avoid selecting "daily digest mode" if you intend to post, so that you can reply properly to specific messages. Also, please do not top-post, and try to send properly formated emails (text, hard-wrapped at 72 columns, no binary or large attachements).

freeglut's People

Contributors

0-wiz-0 avatar andi75 avatar beuc avatar brianpaul avatar chrispurnell avatar coypoop avatar dcnieho avatar deeice avatar hwhsu1231 avatar j0ng4b avatar jcjones avatar jtsiomb avatar jwillikers avatar jzarl avatar mardy avatar mizzrym1 avatar mxraw avatar nigels-com avatar rcmaniac25 avatar sandalle avatar schneegans avatar sebras avatar srombauts avatar stevebaker avatar stonexjr avatar tehnick avatar tormodvolden avatar traversaro avatar vlajos avatar y-guyon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

freeglut's Issues

-Wmaybe-uninitialized variable numEdgeIdxPerFace @ src/fg_geometry.c

During a normal build of Freeglut-3.2.2 on gentoo, we get a warning that could potentially result in an error.

src/fg_geometry.c:605:13: warning: 'numEdgeIdxPerFace' may be used uninitialized in this function [-Wmaybe-uninitialized]
https://github.com/FreeGLUTProject/freeglut/blob/master/src/fg_geometry.c#L613=
in the fghGenerateGeometryWithIndexArray() function.

Description of the bug:
It starts with an uninitialized variable,
Assigns the variable in a switch/case statement that has no default,
Then attempts to use it in a loop at the end of the function.

Analysis:
It may be a low priority, but I consider -Wmaybe-uninitialized to be worth the time to deal with.
The variable should be strictly initialized, not assumed to be initialized.
After some code review with another gentoo mentor, I have decided to submit an issue for this.

Build.log
Compiler used: GCC-11.2.1
related Compiler flags: -Wall -pedantic (comes from freeglut's build system)

On an unrelated note, you can see in the log, the only other warning is, there is a lot of spam from [-Wunused-const-variable=] coming from fg_font_data.c , if something could be done about this also, that would be great.

Thanks!

Ensure Vulkan works

With the release today of Vulkan, FreeGlut should try to ensure that as little system-specific work is necessary for Vulkan to be used.

FindGLUT.cmake doesn't work with static library

FindGLUT.cmake seems to be somewhere between underpowered and buggy. Its biggest bug is that it just doesn't work with static libraries, at least not on Windows. It can't find freeglut_static.lib.

I think if it were patterned after findGLEW.cmake it would be much more robust.

I'm happy to work on improving this if I can get some guidance and consensus on the direction to go in. I don't even know the process for getting fixes to findGLUT.cmake pushed back to the CMake distro.

[Sorry if this isn't the ideal forum to raise this issue, but the developers of some other projects support their respective find*.cmake files, so I thought I'd give it a shot.]

Feature requests

Hi,

I am the author of a 3D engine. Have a look here if interested:

I use FreeGLUT because if supports a lot of Operating Systems. So this is very nice.
But I have some kind of requests. Just telling first.

  • I need "DPI awareness" on MacOSX and Windows (GL window is scaled by 2 or something depending on Screen DPI settings, I just would prefer to have to pixels the window has on screen)
  • It would be nice to always have the ability to check for control, alt and command keys
  • Mousewheel support on FreeBSD does not seem to work, maybe its a problem on their side
  • Setting mouse position on MacOSX lacks (I have code that fixes it in my code)
  • I have a project cloned here (https://github.com/andreasdr/liquidfun) that has support for iOS, is it possible to merge it

If you would ask for my personal opinion FreeGLUT is nice, but I would drop the utility stuff from FreeGLUT and keep context management and windows creation and input events. Just my opinion in nowadays. Is there still some active development going on or is FreeGLUT dying?

Are you interessted on some kind of collaboration?

I can maybe even help.

Many thanx and

Best regards
Andreas

warning: variable ‘menuID’ set but not used

gcc warns:

freeglut/freeglut/progs/demos/CallbackMaker/CallbackMaker.c: In function ‘main’:
freeglut/freeglut/progs/demos/CallbackMaker/CallbackMaker.c:625:7: warning: variable ‘menuID’ set but not used [-Wunused-but-set-variable]
   int menuID, subMenuA, subMenuB;
       ^

I don't understand the code enough to fix this, but it looks strange:

  menuID = glutCreateMenu( MenuCallback );

is set but never used after that point, even though it's used by
glutAddMenuEntry() calls.

joypads, tablets, etc

is there any interest in modernising some parts of freeglut:-

[1] console style joypad controllers (twin analogue sticks: x1,y1, x2,y2, analogue triggers: z1,z2)
[1.1] even regular 'joysticks' have 4 axes; my current joystick has a twist axis which 'joystickfunc' doesn't pass back
[2] pressure-sensitive stylus (wacom, win8 tablets, various android devices)
[3] multitouch
[4] convenient glutGetKeyState(), glutGetJoystickAxis(int stickId, int axisId), glutGetCursorPos() APIs - its very common to just have an animation loop that polls everything at fixed time intervals with sufficient sampling rate to capture everything; you can layer this ontop of glut manually but everyone has to replicate this. If the library tracked this internally, you could combine both approaches more conveniently.
These would also allow using joypads/modern 4-axis joysticks without having to create a separate 'glutJoypadFunc()' .. just expose JoystickAxes for the sticks & triggers.

Perhaps I should just migrate to glfw, but I've got some cross platform code using glut already.. (although I've built another layer myself to handle android/ios anyway)

Any plans to make new release?

Since last release almost 1.5y ago have been added +2k commits.
I think that it would be good to flush currently committed changes and make new release :)

GL_POINTS in glutStrokeCharacter()

I've been investigating why I get squares on the top of text labels drawn with glutStrokeCharacter():

coot

(it's not my program, I don't have much experience with OpenGL myself)

Finally I tracked it down to this commit: a5f5c71

The squares appear only when I zoom in in that program.
I don't know if GL_POINTS in glutStrokeCharacter() is a bug or a feature. GLUT (I just checked in glut-3.7/lib/glut/glut_stroke.c) uses only GL_LINE_STRIP. If it's intended, maybe mention it in docs in "Changes From GLUT".

failed to compile freeglut on macOS 10.14.2

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. 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.
  • 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: macOS 10.14.2
  • FreeGLUT version: git_master branch

Hi, I want to compile freeglut on my MBP. But it failed with the following message

WMBP:build lw$ cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/lw/Desktop/freeglut_github/freeglut/freeglut/build
WMBP:build lw$ make
[ 30%] Built target freeglut_static
[ 31%] Linking C executable bin/timer_callback_static
Undefined symbols for architecture x86_64:
  "_glXChooseFBConfig", referenced from:
      _fghChooseConfig in libglut.a(fg_window_x11_glx.c.o)
      _fgPlatformGlutGetModeValues in libglut.a(fg_state_x11_glx.c.o)
  "_glXCreateNewContext", referenced from:
      _fghCreateNewContext in libglut.a(fg_window_x11_glx.c.o)
  "_glXDestroyContext", referenced from:
      _fgPlatformDestroyContext in libglut.a(fg_init_x11.c.o)
      _fgPlatformCloseWindow in libglut.a(fg_window_x11.c.o)
  "_glXGetCurrentContext", referenced from:
      _fgPlatformOpenWindow in libglut.a(fg_window_x11.c.o)
  "_glXGetFBConfigAttrib", referenced from:
      _fghChooseConfig in libglut.a(fg_window_x11_glx.c.o)
      _fgPlatformGetConfig in libglut.a(fg_state_x11_glx.c.o)
      _fgPlatformGlutGetModeValues in libglut.a(fg_state_x11_glx.c.o)
  "_glXGetProcAddressARB", referenced from:
      _fgPlatformGetProcAddress in libglut.a(fg_ext_x11.c.o)
  "_glXGetVisualFromFBConfig", referenced from:
      _fgPlatformOpenWindow in libglut.a(fg_window_x11.c.o)
      _fgPlatformGlutGet in libglut.a(fg_state_x11.c.o)
  "_glXIsDirect", referenced from:
      _fgPlatformOpenWindow in libglut.a(fg_window_x11.c.o)
  "_glXMakeContextCurrent", referenced from:
      _fgPlatformOpenWindow in libglut.a(fg_window_x11.c.o)
      _fgPlatformSetWindow in libglut.a(fg_window_x11_glx.c.o)
  "_glXQueryExtension", referenced from:
      _fgPlatformInitialize in libglut.a(fg_init_x11.c.o)
  "_glXQueryExtensionsString", referenced from:
      _fgPlatformInitialize in libglut.a(fg_init_x11.c.o)
  "_glXSwapBuffers", referenced from:
      _fgPlatformGlutSwapBuffers in libglut.a(fg_display_x11_glx.c.o)
  "_glutBitmap8By13", referenced from:
      _fghFontByID in libglut.a(fg_font.c.o)
  "_glutBitmap9By15", referenced from:
      _fghFontByID in libglut.a(fg_font.c.o)
  "_glutBitmapHelvetica10", referenced from:
      _fghFontByID in libglut.a(fg_font.c.o)
  "_glutBitmapHelvetica12", referenced from:
      _fghFontByID in libglut.a(fg_font.c.o)
  "_glutBitmapHelvetica18", referenced from:
      _fgState in libglut.a(fg_init.c.o)
      _fghFontByID in libglut.a(fg_font.c.o)
  "_glutBitmapTimesRoman10", referenced from:
      _fghFontByID in libglut.a(fg_font.c.o)
  "_glutBitmapTimesRoman24", referenced from:
      _fghFontByID in libglut.a(fg_font.c.o)
  "_glutStrokeMonoRoman", referenced from:
      _fghStrokeByID in libglut.a(fg_font.c.o)
  "_glutStrokeRoman", referenced from:
      _fghStrokeByID in libglut.a(fg_font.c.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/timer_callback_static] Error 1
make[1]: *** [CMakeFiles/timer_callback_static.dir/all] Error 2
make: *** [all] Error 2
WMBP:build lw$ 

Is there any problem here? How to successfully compile this library?
Could anyone help me? Thanks a lot!

Why wayland build still need opengl glx?

  • OS = KISS linux
  • FreeGLUT version = 3.2.1

Logs:

CMake Error at /usr/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find OpenGL (missing: OPENGL_glx_LIBRARY)
Call Stack (most recent call first):
  /usr/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.21/Modules/FindOpenGL.cmake:443 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:262 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!

CMakeOutput.log

"Wayland" Linux build depends on libxkbcommon

cmake -G 'Unix Makefiles' -DFREEGLUT_WAYLAND=1

Building FreeGLUT with EGL support, I came across an undocumented package dependency, that appears to be specific to EGL:

[  4%] Building C object CMakeFiles/freeglut_static.dir/src/fg_ext.c.o
make[2]: *** [CMakeFiles/freeglut_static.dir/src/fg_callbacks.c.o] Error 1
In file included from /home/nigels/dev/FreeGLUT/freeglut/freeglut/src/fg_internal.h:200:0,
                 from /home/nigels/dev/FreeGLUT/freeglut/freeglut/src/fg_display.c:29:
/home/nigels/dev/FreeGLUT/freeglut/freeglut/src/wayland/fg_internal_wl.h:37:33: fatal error: xkbcommon/xkbcommon.h: No such file or directory
 #include <xkbcommon/xkbcommon.h>
                                 ^
compilation terminated.

Ought to be mentioned in documentation that libxkbcommon-dev is required. (Ubuntu 14.04 here)

Solution is:

 sudo apt-get install libxkbcommon-dev

glutTimerFunc can be invoked with a NULL callback

As discussed in email thread from 11/18/2015, subject "Possible Bugs"

"glutTimerFunc has the same issue as #43, but the segfault will happen when the timer is to be invoked. In this case I would think that the timer shouldn't be created if the callback is NULL, as what use would it have?"

Menu improvement request/idea

Typical 3-D applications of GLUT require rotating and dragging a 3-D model or scene. Usually all buttons are needed for this activity.

On the other hand, clicking the mouse is rarely needed. Therefore if the menu system opened the menu on a click instead of when the button goes down (i.e. with a timer or simple drag logic) then it would be possible to combine context menus with drag based interactions.

(Also it would be very good to have a text input system, for entering things like URLs into a location bar. If that's not asking too much. The menu request seems very sensible doesn't it? If click detection is too much, then how about an API for manually opening a menu under the cursor? That is without attaching it to a button... I don't know why it didn't work like that to begin with myself.)

Joystick input does not work on FreeBSD

The joystick code would break the build on recent versions of FreeBSD.

I followed the example of the FreeBSD freeglut port maintainers, and ifdef-ed out the contents of a whole function for FreeBSD >= 8, which apparently used an old, no longer available, API (commit eb622d9). That fixed the build, but joysticks no longer work on FreeBSD.

left shift count >= width of type in GCC 10.2.1

fg_main_mswin.c: In function 'fgPlatformSystemTime':
fg_main_mswin.c:480:35: warning: left shift count >= width of type [-Wshift-count-overflow]
  480 |     return currTime32 | timeEpoch << 32;
      |                                   ^~

Need help compiling with /MT option in MSVC

  • OS Windows 10
  • FreeGLUT version 3.0.0

I'm trying to compile the source as static library with /MT switch on (adding a few lines at the end of CMakeLists.txt as referenced here to replace all the command line /MDs with/MT).

The problem was that when I try to link against the library, I get linker errors and it seems that certain CRT functions were not imported as they were supposed to be (LNK2001 unresolved external symbol __imp___strdup, etc).

Any help on setting things up for compile under /MT? Thanks a lot!

License Text

Hi, on your home page it says

FreeGLUT is released under the X-Consortium license

When I had a look at the COPYING file it appears have slightly incorrect text for the X-Consortium (AKA X11) license:

From COPYING

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies or substantial portions of the Software.

X11 License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

As a software developer I'm not what difference (if any) these line make legally speaking. I just wondered if it was a copying mistake in the COPYING license or the COPYING text does have the correct license - and it's intended to be different from the X11 license. I can't find find any other use of the license text used by FreeGLUT, so I would assume in that case it is a unique and license use by FreeGLUT only.

glutCreateMenu can be created with a NULL callback

As discussed in email thread from 11/18/2015, subject "Possible Bugs"

"glutCreateMenu could have a NULL callback passed into it. This won't cause any issues until the menu is invoked, in which case it will segfault. Should there be a check when the menu is created, or should the callback be ignored"

MacOS: GLUT_ACTIVE_ALT never fired

https://github.com/dcnieho/FreeGLUT/blob/349a23dcc1264a76deb79962d1c90462ad0c6f50/freeglut/freeglut/src/x11/fg_main_x11.c#L136

This will never react to these x11 events:

Command key:

KeyRelease event, serial 34, synthetic NO, window 0xa00001,
    root 0x111, subw 0x0, time 1552464343, (95,98), root:(95,121),
    state 0x10, keycode 63 (keysym 0xffe7, Meta_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

Option (and Fn+Option - or Alt):

KeyRelease event, serial 34, synthetic NO, window 0xa00001,
    root 0x111, subw 0x0, time 1552464903, (95,98), root:(95,121),
    state 0x2000, keycode 66 (keysym 0xff7e, Mode_switch), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

It seems that following next steps are possible:

  • Do nothing if it's considered by-design behaviour
  • On MacOS, map 0x2000 (which is not even in X11?) to GLUT_ACTIVE_ALT
  • On MacOS, use Command (Mod3Mask) as Alt
  • On MacOS, expose Command otherwise?

Build error at fg_spaceball_mswin.c.obj

  • OS: Windows 10
  • FreeGLUT version: 3.2.1
  • Compiler: gcc version 9.2.0 (MinGW.org GCC Build-2)
...
[ 26%] Building C object CMakeFiles/freeglut.dir/src/mswin/fg_spaceball_mswin.c.
obj
C:\MinGW\freeglut-3.2.1\src\mswin\fg_spaceball_mswin.c: In function 'fgSpaceball
HandleWinEvent':
C:\MinGW\freeglut-3.2.1\src\mswin\fg_spaceball_mswin.c:155:45: error: subscripte
d value is neither array nor pointer nor vector
  155 |             if (pRawInput->data.hid.bRawData[0] ==
      |                                             ^
C:\MinGW\freeglut-3.2.1\src\mswin\fg_spaceball_mswin.c:158:71: error: subscripte
d value is neither array nor pointer nor vector
  158 |                 short* pnData = (short*)(&pRawInput->data.hid.bRawData[1
]);
      |                                                                       ^
C:\MinGW\freeglut-3.2.1\src\mswin\fg_spaceball_mswin.c:164:50: error: subscripte
d value is neither array nor pointer nor vector
  164 |             else if (pRawInput->data.hid.bRawData[0] ==
      |                                                  ^
C:\MinGW\freeglut-3.2.1\src\mswin\fg_spaceball_mswin.c:167:71: error: subscripte
d value is neither array nor pointer nor vector
  167 |                 short* pnData = (short*)(&pRawInput->data.hid.bRawData[1
]);
      |
C:\MinGW\freeglut-3.2.1\src\mswin\fg_spaceball_mswin.c:173:50: error: subscripte
d value is neither array nor pointer nor vector
  173 |             else if (pRawInput->data.hid.bRawData[0] ==
      |                                                  ^
C:\MinGW\freeglut-3.2.1\src\mswin\fg_spaceball_mswin.c:176:91: error: subscripte
d value is neither array nor pointer nor vector
  176 |                 unsigned long dwKeystate = *(unsigned long*)(&pRawInput-
>data.hid.bRawData[1]);
      |
                  ^
C:\MinGW\freeglut-3.2.1\src\mswin\fg_spaceball_mswin.c:177:30: warning: unused v
ariable 'state' [-Wunused-variable]
  177 |                 unsigned int state = GLUT_UP;
      |                              ^~~~~
C:\MinGW\freeglut-3.2.1\src\mswin\fg_spaceball_mswin.c:109:10: warning: unused v
ariable 'inputCode' [-Wunused-variable]
  109 |     UINT inputCode = (UINT)wParam;
      |          ^~~~~~~~~
make[2]: *** [CMakeFiles/freeglut.dir/src/mswin/fg_spaceball_mswin.c.obj] Error
1
make[1]: *** [CMakeFiles/freeglut.dir/all] Error 2
make: *** [all] Error 2

Hmm... how can i fix it.

3.2.2: compile time warnings

  • OS: Linux x86/64
  • FreeGLUT version
  • gcc 12.0.1

freeglut compiled with LTO.
Summary stats:

[tkloczko@devel-g2v SPECS]$ rpmbuild -ba --with check --with failing_tests freeglut.spec --quiet 2>&1 | grep -- -W | sed 's/.*\[//; s/\]//' | sort | uniq -c | sort -nr
    391 -Wunused-const-variable=
      9 -Wlto-type-mismatch
      2 -Wunused-result
      1 -Wunused-but-set-variable

Most important are -Wlto-type-mismatch because those warnings are trashing LTO.

Extracted stderr with warnings: freeglut.txt

IMO it would be good as well merge openglut documentation from openglut from https://downloads.sf.net/openglut/

duplicate symbols with clang ldd

I'm using AMD's version of clang to compile, and I'm getting quite a few errors during the link. The section below shows the errors, all of them relating to the same thing. Any advice? Building with gcc works as expected.

CMake options:

-DCMAKE_CXX_STANDARD=11
-DOPT_DOUBLE_PRECISION=OFF
-DBoost_USE_STATIC_LIBS=OFF
-DBUILD_SHARED_LIBS=ON

Using AOCC 3.2 from here https://developer.amd.com/amd-aocc/

/usr/bin/cmake -E cmake_link_script CMakeFiles/Lorenz_static.dir/link.txt --verbose=1
/opt/AMD/aocc-compiler-3.2.0/bin/clang -O3 -DNDEBUG -rdynamic CMakeFiles/Lorenz_static.dir/progs/demos/Lorenz/lorenz.c.o -o bin/Lorenz_static  -lGLU -lGL -lm -lX11 -lXi -lm lib/libglut.a -lGL -lm -lX11 -lXi 
ld.lld: error: duplicate symbol: fghGenBuffers
>>> defined at fg_window.c
>>>            fg_window.c.o:(fghGenBuffers) in archive lib/libglut.a
>>> defined at fg_gl2.c
>>>            fg_gl2.c.o:(.bss+0x0) in archive lib/libglut.a

ld.lld: error: duplicate symbol: fghDeleteBuffers
>>> defined at fg_window.c
>>>            fg_window.c.o:(fghDeleteBuffers) in archive lib/libglut.a
>>> defined at fg_gl2.c
>>>            fg_gl2.c.o:(.bss+0x8) in archive lib/libglut.a

ld.lld: error: duplicate symbol: fghBindBuffer
>>> defined at fg_window.c
>>>            fg_window.c.o:(fghBindBuffer) in archive lib/libglut.a
>>> defined at fg_gl2.c
>>>            fg_gl2.c.o:(.bss+0x10) in archive lib/libglut.a

ld.lld: error: duplicate symbol: fghBufferData
>>> defined at fg_window.c
>>>            fg_window.c.o:(fghBufferData) in archive lib/libglut.a
>>> defined at fg_gl2.c
>>>            fg_gl2.c.o:(.bss+0x18) in archive lib/libglut.a

ld.lld: error: duplicate symbol: fghVertexAttribPointer
>>> defined at fg_window.c
>>>            fg_window.c.o:(fghVertexAttribPointer) in archive lib/libglut.a
>>> defined at fg_gl2.c
>>>            fg_gl2.c.o:(.bss+0x20) in archive lib/libglut.a

ld.lld: error: duplicate symbol: fghEnableVertexAttribArray
>>> defined at fg_window.c
>>>            fg_window.c.o:(fghEnableVertexAttribArray) in archive lib/libglut.a
>>> defined at fg_gl2.c
>>>            fg_gl2.c.o:(.bss+0x28) in archive lib/libglut.a

ld.lld: error: duplicate symbol: fghDisableVertexAttribArray
>>> defined at fg_window.c
>>>            fg_window.c.o:(fghDisableVertexAttribArray) in archive lib/libglut.a
>>> defined at fg_gl2.c
>>>            fg_gl2.c.o:(.bss+0x30) in archive lib/libglut.a

ld.lld: error: duplicate symbol: fghGenBuffers
>>> defined at fg_window.c
>>>            fg_window.c.o:(fghGenBuffers) in archive lib/libglut.a
>>> defined at fg_geometry.c
>>>            fg_geometry.c.o:(.bss+0x0) in archive lib/libglut.a

ld.lld: error: duplicate symbol: fghBindBuffer
>>> defined at fg_window.c
>>>            fg_window.c.o:(fghBindBuffer) in archive lib/libglut.a
>>> defined at fg_geometry.c
>>>            fg_geometry.c.o:(.bss+0x10) in archive lib/libglut.a

ld.lld: error: duplicate symbol: fghBufferData
>>> defined at fg_window.c
>>>            fg_window.c.o:(fghBufferData) in archive lib/libglut.a
>>> defined at fg_geometry.c
>>>            fg_geometry.c.o:(.bss+0x18) in archive lib/libglut.a

ld.lld: error: duplicate symbol: fghEnableVertexAttribArray
>>> defined at fg_window.c
>>>            fg_window.c.o:(fghEnableVertexAttribArray) in archive lib/libglut.a
>>> defined at fg_geometry.c
>>>            fg_geometry.c.o:(.bss+0x20) in archive lib/libglut.a

ld.lld: error: duplicate symbol: fghVertexAttribPointer
>>> defined at fg_window.c
>>>            fg_window.c.o:(fghVertexAttribPointer) in archive lib/libglut.a
>>> defined at fg_geometry.c
>>>            fg_geometry.c.o:(.bss+0x30) in archive lib/libglut.a

ld.lld: error: duplicate symbol: fghDisableVertexAttribArray
>>> defined at fg_window.c
>>>            fg_window.c.o:(fghDisableVertexAttribArray) in archive lib/libglut.a
>>> defined at fg_geometry.c
>>>            fg_geometry.c.o:(.bss+0x28) in archive lib/libglut.a

ld.lld: error: duplicate symbol: fghDeleteBuffers
>>> defined at fg_window.c
>>>            fg_window.c.o:(fghDeleteBuffers) in archive lib/libglut.a
>>> defined at fg_geometry.c
>>>            fg_geometry.c.o:(.bss+0x8) in archive lib/libglut.a
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [CMakeFiles/Lorenz_static.dir/build.make:111: bin/Lorenz_static] Error 1
make[2]: Leaving directory '/scratch/SupportPackages.AMD/build/fglut/src/freeglut-build'
make[1]: *** [CMakeFiles/Makefile2:149: CMakeFiles/Lorenz_static.dir/all] Error 2
make[1]: Leaving directory '/scratch/SupportPackages.AMD/build/fglut/src/freeglut-build'
make: *** [Makefile:149: all] Error 2

Windows: incorrect colors for RGB contexts on 256 color display

On GNU/Linux or IRIX (X11/GLX), when running on 256 color mode (assuming OpenGL on such a mode is supported by hardware or mesa), the colors are approximately correct, with a dither pattern to hide the reduced color resolution. Under windows the colors are completely wrong. Presumably we need to set up a default 332 palette for RGB visuals when running on 256 color modes.

Windows build fails to install with FREEGLUT_BUILD_STATIC_LIBS and INSTALL_PDB enabled

If you try to install a Windows build of FreeGLUT (as of 3.0.0), it fails to find freeglut_static[d].pdb. This happens because static libs don't generate *.pdb files.

I can't get to it right now (though it's easy to fix), but the fix is to change:

IF(FREEGLUT_BUILD_STATIC_LIBS)
    INSTALL(TARGETS freeglut_static EXPORT FreeGLUTTargets
            RUNTIME DESTINATION bin
            LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
            ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
            INCLUDES DESTINATION include
    )
    IF(INSTALL_PDB)
        INSTALL(FILES ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/Debug/freeglut_static${CMAKE_DEBUG_POSTFIX}.pdb
            DESTINATION lib
            CONFIGURATIONS Debug
            COMPONENT Devel)
    ENDIF()
ENDIF()

to

IF(FREEGLUT_BUILD_STATIC_LIBS)
    INSTALL(TARGETS freeglut_static EXPORT FreeGLUTTargets
            RUNTIME DESTINATION bin
            LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
            ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
            INCLUDES DESTINATION include
    )
ENDIF()

Undefined symbols for architecture arm64: "_glXChooseFBConfig", referenced fro

Undefined symbols for architecture arm64:
  "_glXChooseFBConfig", referenced from:
      _fghChooseConfig in libglut.a(fg_window_x11_glx.c.o)
      _fgPlatformGlutGetModeValues in libglut.a(fg_state_x11_glx.c.o)
  "_glXCreateNewContext", referenced from:
      _fghCreateNewContext in libglut.a(fg_window_x11_glx.c.o)
  "_glXDestroyContext", referenced from:
      _fgPlatformDestroyContext in libglut.a(fg_init_x11.c.o)
      _fgPlatformCloseWindow in libglut.a(fg_window_x11.c.o)
  "_glXGetCurrentContext", referenced from:
      _fgPlatformOpenWindow in libglut.a(fg_window_x11.c.o)
  "_glXGetFBConfigAttrib", referenced from:
      _fghChooseConfig in libglut.a(fg_window_x11_glx.c.o)
      _fgPlatformGetConfig in libglut.a(fg_state_x11_glx.c.o)
      _fgPlatformGlutGetModeValues in libglut.a(fg_state_x11_glx.c.o)
  "_glXGetProcAddressARB", referenced from:
      _fgPlatformGetProcAddress in libglut.a(fg_ext_x11.c.o)
  "_glXGetVisualFromFBConfig", referenced from:
      _fgPlatformOpenWindow in libglut.a(fg_window_x11.c.o)
      _fgPlatformGlutGet in libglut.a(fg_state_x11.c.o)
  "_glXIsDirect", referenced from:
      _fgPlatformOpenWindow in libglut.a(fg_window_x11.c.o)
  "_glXMakeContextCurrent", referenced from:
      _fgPlatformOpenWindow in libglut.a(fg_window_x11.c.o)
      _fgPlatformSetWindow in libglut.a(fg_window_x11_glx.c.o)
  "_glXQueryExtension", referenced from:
      _fgPlatformInitialize in libglut.a(fg_init_x11.c.o)
  "_glXQueryExtensionsString", referenced from:
      _fgPlatformInitialize in libglut.a(fg_init_x11.c.o)
Undefined symbols for architecture arm64:
  "_glXChooseFBConfig", referenced from:
  "_glXSwapBuffers", referenced from:
      _fgPlatformGlutGetModeValues in libglut.a(fg_state_x11_glx.c.o)
      _fghChooseConfig in libglut.a(fg_window_x11_glx.c.o)
      _fgPlatformGlutSwapBuffers in libglut.a(fg_display_x11_glx.c.o)
  "_glutBitmap8By13", referenced from:
      _fghFontByID in libglut.a(fg_font.c.o)
  "_glXCreateNewContext", referenced from:
      _fghCreateNewContext in libglut.a(fg_window_x11_glx.c.o)
  "_glXDestroyContext", referenced from:
  "_glutBitmap9By15", referenced from:
      _fghFontByID in libglut.a(fg_font.c.o)
      _fgPlatformDestroyContext in libglut.a(fg_init_x11.c.o)
      _fgPlatformCloseWindow in libglut.a(fg_window_x11.c.o)
  "_glutBitmapHelvetica10", referenced from:
      _fghFontByID in libglut.a(fg_font.c.o)
  "_glXGetCurrentContext", referenced from:
  "_glutBitmapHelvetica12", referenced from:
      _bitmapPrintf in lorenz.c.o
      _fghFontByID in libglut.a(fg_font.c.o)
      _fgPlatformOpenWindow in libglut.a(fg_window_x11.c.o)
  "_glXGetFBConfigAttrib", referenced from:
  "_glutBitmapHelvetica18", referenced from:
      _fghFontByID in libglut.a(fg_font.c.o)
      _fgPlatformGetConfig in libglut.a(fg_state_x11_glx.c.o)
      _fgPlatformGlutGetModeValues in libglut.a(fg_state_x11_glx.c.o)
      _fgState in libglut.a(fg_init.c.o)
      _fghChooseConfig in libglut.a(fg_window_x11_glx.c.o)
  "_glXGetProcAddressARB", referenced from:
      _fgPlatformGetProcAddress in libglut.a(fg_ext_x11.c.o)
  "_glutBitmapTimesRoman10", referenced from:
      _fghFontByID in libglut.a(fg_font.c.o)
  "_glXGetVisualFromFBConfig", referenced from:
      _fgPlatformOpenWindow in libglut.a(fg_window_x11.c.o)
      _fgPlatformGlutGet in libglut.a(fg_state_x11.c.o)
  "_glutBitmapTimesRoman24", referenced from:
      _fghFontByID in libglut.a(fg_font.c.o)
  "_glXIsDirect", referenced from:
      _fgPlatformOpenWindow in libglut.a(fg_window_x11.c.o)
  "_glutStrokeMonoRoman", referenced from:
      _fghStrokeByID in libglut.a(fg_font.c.o)
  "_glXMakeContextCurrent", referenced from:
      _fgPlatformOpenWindow in libglut.a(fg_window_x11.c.o)
      _fgPlatformSetWindow in libglut.a(fg_window_x11_glx.c.o)
  "_glutStrokeRoman", referenced from:
      _fghStrokeByID in libglut.a(fg_font.c.o)
  "_glXQueryExtension", referenced from:
      _fgPlatformInitialize in libglut.a(fg_init_x11.c.o)
  "_glXQueryExtensionsString", referenced from:
      _fgPlatformInitialize in libglut.a(fg_init_x11.c.o)
  "_glXSwapBuffers", referenced from:
      _fgPlatformGlutSwapBuffers in libglut.a(fg_display_x11_glx.c.o)
  "_glutBitmap8By13", referenced from:
      _fghFontByID in libglut.a(fg_font.c.o)
  "_glutBitmap9By15", referenced from:
      _fghFontByID in libglut.a(fg_font.c.o)
ld: symbol(s) not found for architecture arm64
  "_glutBitmapHelvetica10", referenced from:
      _fghFontByID in libglut.a(fg_font.c.o)
  "_glutBitmapHelvetica12", referenced from:
      _fghFontByID in libglut.a(fg_font.c.o)
Undefined symbols for architecture arm64:
  "_glXChooseFBConfig", referenced from:

Need help with glutPostRedisplay with a given framerate

I'm trying to do an update on an array of 3d objects with a given framerate, say 60fps.

It works nicely if I just manually list the array of objects inside a function with the translation/movement update.. 
MoveObject(cube[0],x,y,z,)
MoveObject(cube[1],x,y,z,)
...

but not so much (crashes) when doing a for loop or other iteration..

for(i = 0; i<=3, i++)
  MoveObject(cube[i],x,yz,)
loop

How do I set it up so that the loop movement is completed or a function is called once before doing a postredisplay while at a certain frame rate?

Different declarations / definitions for font data

In the process of implementing state-aware callbacks I have discovered something that prevents compiling by a C++ compiler. In fg_font.c there are:

extern SFG_Font fgFontFixed8x13;
extern SFG_Font fgFontFixed9x15;
extern SFG_Font fgFontHelvetica10;
extern SFG_Font fgFontHelvetica12;
extern SFG_Font fgFontHelvetica18;
extern SFG_Font fgFontTimesRoman10;
extern SFG_Font fgFontTimesRoman24;
extern SFG_StrokeFont fgStrokeRoman;
extern SFG_StrokeFont fgStrokeMonoRoman;

But their literal definition in fg_font_mswin.c for example:

const SFG_Font fgFontFixed8x13 = {...}

so the extern declaration is non-const but the definition is const, was this intentional?

glutCopyColormap not implemented

The colormap management functions of GLUT are not implemented. This includes glutSetColor, glutGetColor, and glutCopyColormap. I intend to implement the X11 side of this soon.

Windows: WM_SYSKEY* makes it impossible to use F10 key

I'm using the current master branch (d8f5c1e) of FreeGLUT on Windows (8.1 and 2012R2 if that's important). When pressing the F10 key, the application program using FreeGLUT gets the appropriate key down/key up events, but Windows also reacts with the default action (wait for the next key, then e.g. display the popup menu of the window with move/resize/close/…; as if you type the ALT key). This happens because FreeGLUT calls the DefWindowProc function for WM_SYSKEYDOWN and WM_SYSKEYUP events (as recommended here). Unfortunately, this makes it impossible to use the F10 key in the application program without performing that system command.

There should be an option to disable this Windows specific behavior (or maybe disable it by default).

I'm using this temporary workaround/fix for now:

diff --git a/freeglut/freeglut/src/mswin/fg_main_mswin.c b/freeglut/freeglut/src/mswin/fg_main_mswin.c
index 6d286e7..2e7bed6 100644
--- a/freeglut/freeglut/src/mswin/fg_main_mswin.c
+++ b/freeglut/freeglut/src/mswin/fg_main_mswin.c
@@ -731,7 +731,7 @@ static LRESULT fghWindowProcKeyPress(SFG_Window *window, UINT uMsg, GLboolean ke
     fgState.Modifiers = INVALID_MODIFIERS;

     /* SYSKEY events should be sent to default window proc for system to handle them */
-    if (uMsg==WM_SYSKEYDOWN || uMsg==WM_SYSKEYUP)
+    if ((uMsg==WM_SYSKEYDOWN || uMsg==WM_SYSKEYUP) && wParam!=VK_F10)
         return DefWindowProc( window->Window.Handle, uMsg, wParam, lParam );
     else
         return 1;

Note that completely removing the call to DefWindowProc is not a good solution, because then various ALT+key combinations won't perform the expected system command.

multiple definition error with gcc v10.2.0

Windows 10 with msys2

[ 31%] Linking C shared library bin\libfreeglut.dll
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\freeglut.dir/objects.a(fg_gl2.c.obj):fg_gl2.c:(.bss+0x0): multiple definition of `fghGenBuffers'; CMakeFiles\freeglut.dir/objects.a(fg_geometry.c.obj):fg_geometry.c:(.bss+0x0): first defined here
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\freeglut.dir/objects.a(fg_gl2.c.obj):fg_gl2.c:(.bss+0x8): multiple definition of `fghDeleteBuffers'; CMakeFiles\freeglut.dir/objects.a(fg_geometry.c.obj):fg_geometry.c:(.bss+0x8): first defined here
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\freeglut.dir/objects.a(fg_gl2.c.obj):fg_gl2.c:(.bss+0x10): multiple definition of `fghBindBuffer'; CMakeFiles\freeglut.dir/objects.a(fg_geometry.c.obj):fg_geometry.c:(.bss+0x10): first defined here
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\freeglut.dir/objects.a(fg_gl2.c.obj):fg_gl2.c:(.bss+0x18): multiple definition of `fghBufferData'; CMakeFiles\freeglut.dir/objects.a(fg_geometry.c.obj):fg_geometry.c:(.bss+0x18): first defined here
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\freeglut.dir/objects.a(fg_gl2.c.obj):fg_gl2.c:(.bss+0x20): multiple definition of `fghEnableVertexAttribArray'; CMakeFiles\freeglut.dir/objects.a(fg_geometry.c.obj):fg_geometry.c:(.bss+0x20): first defined here
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\freeglut.dir/objects.a(fg_gl2.c.obj):fg_gl2.c:(.bss+0x28): multiple definition of `fghDisableVertexAttribArray'; CMakeFiles\freeglut.dir/objects.a(fg_geometry.c.obj):fg_geometry.c:(.bss+0x28): first defined here
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\freeglut.dir/objects.a(fg_gl2.c.obj):fg_gl2.c:(.bss+0x30): multiple definition of `fghVertexAttribPointer'; CMakeFiles\freeglut.dir/objects.a(fg_geometry.c.obj):fg_geometry.c:(.bss+0x30): first defined here
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\freeglut.dir/objects.a(fg_window.c.obj):fg_window.c:(.bss+0x0): multiple definition of `fghGenBuffers'; CMakeFiles\freeglut.dir/objects.a(fg_geometry.c.obj):fg_geometry.c:(.bss+0x0): first defined here
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\freeglut.dir/objects.a(fg_window.c.obj):fg_window.c:(.bss+0x8): multiple definition of `fghDeleteBuffers'; CMakeFiles\freeglut.dir/objects.a(fg_geometry.c.obj):fg_geometry.c:(.bss+0x8): first defined here
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\freeglut.dir/objects.a(fg_window.c.obj):fg_window.c:(.bss+0x10): multiple definition of `fghBindBuffer'; CMakeFiles\freeglut.dir/objects.a(fg_geometry.c.obj):fg_geometry.c:(.bss+0x10): first defined here
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\freeglut.dir/objects.a(fg_window.c.obj):fg_window.c:(.bss+0x18): multiple definition of `fghBufferData'; CMakeFiles\freeglut.dir/objects.a(fg_geometry.c.obj):fg_geometry.c:(.bss+0x18): first defined here
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\freeglut.dir/objects.a(fg_window.c.obj):fg_window.c:(.bss+0x20): multiple definition of `fghEnableVertexAttribArray'; CMakeFiles\freeglut.dir/objects.a(fg_geometry.c.obj):fg_geometry.c:(.bss+0x20): first defined here
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\freeglut.dir/objects.a(fg_window.c.obj):fg_window.c:(.bss+0x28): multiple definition of `fghDisableVertexAttribArray'; CMakeFiles\freeglut.dir/objects.a(fg_geometry.c.obj):fg_geometry.c:(.bss+0x28): first defined here
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\freeglut.dir/objects.a(fg_window.c.obj):fg_window.c:(.bss+0x30): multiple definition of `fghVertexAttribPointer'; CMakeFiles\freeglut.dir/objects.a(fg_geometry.c.obj):fg_geometry.c:(.bss+0x30): first defined here
collect2.exe: error: ld returned 1 exit status
make[2]: *** [CMakeFiles\freeglut.dir\build.make:704: bin/libfreeglut.dll] Error 1
make[1]: *** [CMakeFiles\Makefile2:171: CMakeFiles/freeglut.dir/all] Error 2
make: *** [Makefile:148: all] Error 2

mingw64 version

$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-10.2.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++ --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --disable-plugin --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev1, Built by MSYS2 project' --with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (Rev1, Built by MSYS2 project)

cmake

The C compiler identification is GNU 10.2.0
The CXX compiler identification is GNU 10.2.0
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: C:/mingw64/bin/gcc.exe - skipped
Detecting C compile features
Detecting C compile features - done
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Check for working CXX compiler: C:/mingw64/bin/g++.exe - skipped
Detecting CXX compile features
Detecting CXX compile features - done
Found OpenGL: opengl32   
Looking for include file sys/types.h
Looking for include file sys/types.h - found
Looking for include file unistd.h
Looking for include file unistd.h - found
Looking for include file sys/time.h
Looking for include file sys/time.h - found
Looking for include file stdbool.h
Looking for include file stdbool.h - found
Looking for include file sys/param.h
Looking for include file sys/param.h - found
Looking for include file sys/ioctl.h
Looking for include file sys/ioctl.h - not found
Looking for include file fcntl.h
Looking for include file fcntl.h - found
Looking for include file usbhid.h
Looking for include file usbhid.h - not found
Looking for gettimeofday
Looking for gettimeofday - found
Looking for XParseGeometry
Looking for XParseGeometry - not found
Looking for include file stdint.h
Looking for include file stdint.h - found
Looking for include file inttypes.h
Looking for include file inttypes.h - found
Configuring done
Generating done

Install Error: file INSTALL cannot find `freeglutd.pdb` with `Ninja Multi-Config` generator.

Descriptions

I tried to compile the source code. It turns out that errors occurred in INSTALL stages with freeglutd.pdb. However, there indeed exists freeglutd.pdb inside the build folder.

D:\.ccxxpkgs\source\freeglut-3.2.2\build-msvc16-x64>cmake --install . --config Debug
-- Installing: D:/.ccxxpkgs/install/msvc16-x64/freeglut-3.2.2/lib/freeglutd.lib
-- Installing: D:/.ccxxpkgs/install/msvc16-x64/freeglut-3.2.2/bin/freeglutd.dll
CMake Error at cmake_install.cmake:57 (file):
  file INSTALL cannot find
  "D:/.ccxxpkgs/source/freeglut-3.2.2/build-msvc16-x64/bin/freeglutd.pdb":
  File exists.

Steps of Installation

Click to expand
  1. Download and unzip the source code.

    freeglut-3.2.2.zip

  2. Open Windows Terminal (cmd.exe) and change to the project folder.

    cd freeglut-3.2.2
    
  3. call vcvarsall.bat x64 to preload the MSVC environment.

    vcvarsall x64
    
  4. Create the build folder and change into it.

    md build-msvc16-x64
    cd build-msvc16-x64
    
  5. Configure the project with the generator Ninja Multi-Config.

    cmake .. -G"Ninja Multi-Config"
    
  6. Open cmake-gui to edit some Cache Variables. After editing, press Configure and Generate buttons. Then, close it.

    cmake-gui .
    
    CMAKE_INSTALL_PREFIX=D:/.ccxxpkgs/install/msvc16-x64/freeglut-3.2.2
    
  7. Build the project with Debug configuration.

    cmake --build . --config Debug
    
  8. Install the project with Debug configuration.

    cmake --install . --config Debug
    

Logs

Click to expand
D:\.ccxxpkgs\source\freeglut-3.2.2>md build-msvc16-x64

D:\.ccxxpkgs\source\freeglut-3.2.2>cd build-msvc16-x64

D:\.ccxxpkgs\source\freeglut-3.2.2\build-msvc16-x64>vcvarsall x64
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.11.16
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

D:\.ccxxpkgs\source\freeglut-3.2.2\build-msvc16-x64>cmake .. -G"Ninja Multi-Config"
-- The C compiler identification is MSVC 19.29.30145.0
-- The CXX compiler identification is MSVC 19.29.30145.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: opengl32
-- Looking for include file sys/types.h
-- Looking for include file sys/types.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - not found
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - not found
-- Looking for include file stdbool.h
-- Looking for include file stdbool.h - found
-- Looking for include file sys/param.h
-- Looking for include file sys/param.h - not found
-- Looking for include file sys/ioctl.h
-- Looking for include file sys/ioctl.h - not found
-- Looking for include file fcntl.h
-- Looking for include file fcntl.h - found
-- Looking for include file usbhid.h
-- Looking for include file usbhid.h - not found
-- Looking for gettimeofday
-- Looking for gettimeofday - not found
-- Looking for XParseGeometry
-- Looking for XParseGeometry - not found
-- Looking for include file stdint.h
-- Looking for include file stdint.h - found
-- Looking for include file inttypes.h
-- Looking for include file inttypes.h - found
-- Configuring done
-- Generating done
-- Build files have been written to: D:/.ccxxpkgs/source/freeglut-3.2.2/build-msvc16-x64

D:\.ccxxpkgs\source\freeglut-3.2.2\build-msvc16-x64>cmake-gui .

D:\.ccxxpkgs\source\freeglut-3.2.2\build-msvc16-x64>cmake --build . --config Debug
[16/132] Building C object CMakeFiles\freeglut.dir\Debug\src\fg_teapot.c.obj
D:\.ccxxpkgs\source\freeglut-3.2.2\src\fg_teapot.c(1): warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
[29/132] Building C object CMakeFiles\freeglut.dir\Debug\src\mswin\fg_main_mswin.c.obj
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_main_mswin.c(47): warning C4312: 'type cast': conversion from 'unsigned int' to 'pGetTouchInputInfo' of greater size
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_main_mswin.c(48): warning C4312: 'type cast': conversion from 'unsigned int' to 'pCloseTouchInputHandle' of greater size
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_main_mswin.c(1508): warning C4312: 'type cast': conversion from 'unsigned int' to 'pGetTouchInputInfo' of greater size
[32/132] Building RC object CMakeFiles\freeglut.dir\Debug\freeglut.rc.res
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Copyright (C) Microsoft Corporation.  All rights reserved.

[40/132] Building C object CMakeFiles\freeglut.dir\Debug\src\mswin\fg_window_mswin.c.obj
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_window_mswin.c(85): warning C4312: 'type cast': conversion from 'unsigned int' to 'pRegisterTouchWindow' of greater size
fgSetupPixelFormat(): there is still some work to do here!
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_window_mswin.c(730): warning C4312: 'type cast': conversion from 'unsigned int' to 'pRegisterTouchWindow' of greater size
[72/132] Building C object CMakeFiles\freeglut_static.dir\Debug\src\fg_teapot.c.obj
D:\.ccxxpkgs\source\freeglut-3.2.2\src\fg_teapot.c(1): warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
[76/132] Building RC object CMakeFiles\freeglut_static.dir\Debug\freeglut.rc.res
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Copyright (C) Microsoft Corporation.  All rights reserved.

[82/132] Building C object CMakeFiles\freeglut_static.dir\Debug\src\mswin\fg_window_mswin.c.obj
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_window_mswin.c(85): warning C4312: 'type cast': conversion from 'unsigned int' to 'pRegisterTouchWindow' of greater size
fgSetupPixelFormat(): there is still some work to do here!
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_window_mswin.c(730): warning C4312: 'type cast': conversion from 'unsigned int' to 'pRegisterTouchWindow' of greater size
[84/132] Building RC object CMakeFiles\One.dir\Debug\progs\demos\One\one.rc.res
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Copyright (C) Microsoft Corporation.  All rights reserved.

[86/132] Building C object CMakeFiles\freeglut_static.dir\Debug\src\mswin\fg_main_mswin.c.obj
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_main_mswin.c(47): warning C4312: 'type cast': conversion from 'unsigned int' to 'pGetTouchInputInfo' of greater size
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_main_mswin.c(48): warning C4312: 'type cast': conversion from 'unsigned int' to 'pCloseTouchInputHandle' of greater size
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_main_mswin.c(1508): warning C4312: 'type cast': conversion from 'unsigned int' to 'pGetTouchInputInfo' of greater size
[115/132] Building RC object CMakeFiles\One_static.dir\Debug\progs\demos\One\one.rc.res
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Copyright (C) Microsoft Corporation.  All rights reserved.

[132/132] Linking C executable bin\Debug\multi-touch_staticd.exe

D:\.ccxxpkgs\source\freeglut-3.2.2\build-msvc16-x64>cmake --build . --config Release
[22/132] Building C object CMakeFiles\freeglut.dir\Release\src\fg_teapot.c.obj
D:\.ccxxpkgs\source\freeglut-3.2.2\src\fg_teapot.c(1): warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
[29/132] Building RC object CMakeFiles\freeglut.dir\Release\freeglut.rc.res
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Copyright (C) Microsoft Corporation.  All rights reserved.

[39/132] Building C object CMakeFiles\freeglut.dir\Release\src\mswin\fg_main_mswin.c.obj
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_main_mswin.c(47): warning C4312: 'type cast': conversion from 'unsigned int' to 'pGetTouchInputInfo' of greater size
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_main_mswin.c(48): warning C4312: 'type cast': conversion from 'unsigned int' to 'pCloseTouchInputHandle' of greater size
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_main_mswin.c(1508): warning C4312: 'type cast': conversion from 'unsigned int' to 'pGetTouchInputInfo' of greater size
[42/132] Building C object CMakeFiles\freeglut.dir\Release\src\mswin\fg_window_mswin.c.obj
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_window_mswin.c(85): warning C4312: 'type cast': conversion from 'unsigned int' to 'pRegisterTouchWindow' of greater size
fgSetupPixelFormat(): there is still some work to do here!
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_window_mswin.c(730): warning C4312: 'type cast': conversion from 'unsigned int' to 'pRegisterTouchWindow' of greater size
[70/132] Building C object CMakeFiles\freeglut_static.dir\Release\src\fg_teapot.c.obj
D:\.ccxxpkgs\source\freeglut-3.2.2\src\fg_teapot.c(1): warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
[76/132] Building RC object CMakeFiles\freeglut_static.dir\Release\freeglut.rc.res
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Copyright (C) Microsoft Corporation.  All rights reserved.

[79/132] Building C object CMakeFiles\freeglut_static.dir\Release\src\mswin\fg_window_mswin.c.obj
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_window_mswin.c(85): warning C4312: 'type cast': conversion from 'unsigned int' to 'pRegisterTouchWindow' of greater size
fgSetupPixelFormat(): there is still some work to do here!
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_window_mswin.c(730): warning C4312: 'type cast': conversion from 'unsigned int' to 'pRegisterTouchWindow' of greater size
[84/132] Building RC object CMakeFiles\One.dir\Release\progs\demos\One\one.rc.res
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Copyright (C) Microsoft Corporation.  All rights reserved.

[89/132] Building C object CMakeFiles\freeglut_static.dir\Release\src\mswin\fg_main_mswin.c.obj
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_main_mswin.c(47): warning C4312: 'type cast': conversion from 'unsigned int' to 'pGetTouchInputInfo' of greater size
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_main_mswin.c(48): warning C4312: 'type cast': conversion from 'unsigned int' to 'pCloseTouchInputHandle' of greater size
D:\.ccxxpkgs\source\freeglut-3.2.2\src\mswin\fg_main_mswin.c(1508): warning C4312: 'type cast': conversion from 'unsigned int' to 'pGetTouchInputInfo' of greater size
[99/132] Building RC object CMakeFiles\One_static.dir\Release\progs\demos\One\one.rc.res
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Copyright (C) Microsoft Corporation.  All rights reserved.

[132/132] Linking C executable bin\Release\timer_static.exe

D:\.ccxxpkgs\source\freeglut-3.2.2\build-msvc16-x64>cmake --install . --config Debug
-- Installing: D:/.ccxxpkgs/install/msvc16-x64/freeglut-3.2.2/lib/freeglutd.lib
-- Installing: D:/.ccxxpkgs/install/msvc16-x64/freeglut-3.2.2/bin/freeglutd.dll
CMake Error at cmake_install.cmake:57 (file):
  file INSTALL cannot find
  "D:/.ccxxpkgs/source/freeglut-3.2.2/build-msvc16-x64/bin/freeglutd.pdb":
  File exists.

screen flickering resolution in non-glut applications

how does GLUT internally handle screen flickering?

for example, when quickly resizing an X11 window, its screen will flicker black as it is resized, this DOES NOT happen when using GLUT

what does GLUT do to fix this?

glutKeyboardUpFunc conflating key and character events.

Okay, so I've run into an issue with handling dead keys and unicode text input.

The way FreeGLUT handles keyboard up events in windows by calling ToAscii in the WM_KEYDOWN event stops the normal system processing of dead keys to generate the appropriate WM_CHAR event.

In fact, the big mistake is adding glutKeyboardUpFunc as currently designed -- it conflates key press events with character events. As it is currently implemented, if you press shift, press the 'a' key, release shift, then release the 'a' key, the events passed from glut are: key down 'A', key up 'a'. That's not really useful behavior is it?

I would suggest removing glutKeyboardUpFunc, glutSpecialUpFunc and adding a new pair of glutKeyDownFunc and glutKeyUpFunc callbacks that send scan codes. I'd use the normal US ASCII layout for convenience (so the 'a' key would be 'A' and the '1' key would send '1' regardless of shift state and system keyboard mapping) and the current glut special key codes for insert, home, end, etc.

git_master build failed under Ubuntu 15.04

sun@sun:~/FreeGLUT/freeglut/freeglut$ cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sun/FreeGLUT/freeglut/freeglut
sun@sun:~/FreeGLUT/freeglut/freeglut$ make
Scanning dependencies of target freeglut
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_callbacks.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_cursor.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_display.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_ext.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_font_data.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_gamemode.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_geometry.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_gl2.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_init.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_input_devices.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_joystick.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_main.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_misc.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_overlay.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_spaceball.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_state.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_stroke_mono_roman.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_stroke_roman.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_structure.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_teapot.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_videoresize.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_window.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_font.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/fg_menu.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/x11/fg_cursor_x11.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/x11/fg_ext_x11.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/x11/fg_gamemode_x11.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/x11/fg_glutfont_definitions_x11.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/x11/fg_init_x11.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/x11/fg_input_devices_x11.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/x11/fg_joystick_x11.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/x11/fg_main_x11.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/x11/fg_menu_x11.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/x11/fg_spaceball_x11.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/x11/fg_state_x11.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/x11/fg_structure_x11.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/x11/fg_window_x11.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/x11/fg_xinput_x11.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/x11/fg_display_x11_glx.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/x11/fg_state_x11_glx.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/x11/fg_window_x11_glx.c.o
[ 38%] Building C object CMakeFiles/freeglut.dir/src/util/xparsegeometry_repl.c.o
Linking C shared library lib/libglut.so
[ 38%] Built target freeglut
Scanning dependencies of target CallbackMaker
[ 38%] Building C object CMakeFiles/CallbackMaker.dir/progs/demos/CallbackMaker/CallbackMaker.c.o
/home/sun/FreeGLUT/freeglut/freeglut/progs/demos/CallbackMaker/CallbackMaker.c: In function ‘main’:
/home/sun/FreeGLUT/freeglut/freeglut/progs/demos/CallbackMaker/CallbackMaker.c:625:7: warning: variable ‘menuID’ set but not used [-Wunused-but-set-variable]
   int menuID, subMenuA, subMenuB;
       ^
/home/sun/FreeGLUT/freeglut/freeglut/progs/demos/CallbackMaker/CallbackMaker.c:733:3: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
   fgets ( dummy_string, STRING_LENGTH, stdin );
   ^
/home/sun/FreeGLUT/freeglut/freeglut/progs/demos/CallbackMaker/CallbackMaker.c: In function ‘Error’:
/home/sun/FreeGLUT/freeglut/freeglut/progs/demos/CallbackMaker/CallbackMaker.c:239:5: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
     fgets ( dummy_string, STRING_LENGTH, stdin );
     ^
Linking C executable bin/CallbackMaker
lib/libglut.so.3.10.0: undefined reference to `sball_initialized'
collect2: error: ld returned 1 exit status
CMakeFiles/CallbackMaker.dir/build.make:103: recipe for target 'bin/CallbackMaker' failed
make[2]: *** [bin/CallbackMaker] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/CallbackMaker.dir/all' failed
make[1]: *** [CMakeFiles/CallbackMaker.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2

-bash: ./configure: No such file or directory

http://freeglut.sourceforge.net/docs/install.php

Download tarball, unpack, cd into resultant directory, then run 'configure'. Issue: there is no 'configure' file. This is true for any of 3.0.0, 3.2.0, 3.2.1. Is the expectation that we build it ourselves or get it elsewhere??

How to install freeglut...

It's not that hard...

If you're going to include such a smug phrase at the start of the installation instructions, you better make sure they're correct...

freeglut-3.0.0-rc2 does not compile on Mac OS X Yosemite

Or am I doing something wrong. Here is what I did:

$ /Applications/CMake.app/Contents/bin/cmake .

~/Downloads/freeglut-3.0.0-rc2
650 iMac: $ /Applications/CMake.app/Contents/bin/cmake .
-- The C compiler identification is AppleClang 6.0.0.6000056
-- The CXX compiler identification is AppleClang 6.0.0.6000056
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/OpenGL.framework
-- Looking for XOpenDisplay in /usr/X11R6/lib/libX11.dylib;/usr/X11R6/lib/libXext.dylib
-- Looking for XOpenDisplay in /usr/X11R6/lib/libX11.dylib;/usr/X11R6/lib/libXext.dylib - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/X11R6/lib/libX11.dylib
-- Looking for include file /usr/X11R6/include/X11/extensions/XInput2.h
-- Looking for include file /usr/X11R6/include/X11/extensions/XInput2.h - not found
-- Looking for include file sys/types.h
-- Looking for include file sys/types.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - found
-- Looking for include file stdbool.h
-- Looking for include file stdbool.h - found
-- Looking for include file sys/param.h
-- Looking for include file sys/param.h - found
-- Looking for include file sys/ioctl.h
-- Looking for include file sys/ioctl.h - found
-- Looking for include file fcntl.h
-- Looking for include file fcntl.h - found
-- Looking for include file usbhid.h
-- Looking for include file usbhid.h - not found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for XParseGeometry
-- Looking for XParseGeometry - not found
-- Looking for include file stdint.h
-- Looking for include file stdint.h - found
-- Looking for include file inttypes.h
-- Looking for include file inttypes.h - found
-- Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

MACOSX_RPATH is not specified for the following targets:

freeglut

This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/dreed/Downloads/freeglut-3.0.0-rc2

~/Downloads/freeglut-3.0.0-rc2
651 iMac: $ make
Scanning dependencies of target freeglut
[ 1%] Building C object CMakeFiles/freeglut.dir/src/fg_callbacks.c.o
In file included from /Users/dreed/Downloads/freeglut-3.0.0-rc2/src/fg_callbacks.c:29:
In file included from /Users/dreed/Downloads/freeglut-3.0.0-rc2/src/fg_internal.h:192:
/Users/dreed/Downloads/freeglut-3.0.0-rc2/src/x11/fg_internal_x11.h:36:10: fatal error:
'GL/glx.h' file not found

include <GL/glx.h>

     ^

1 error generated.
make[2]: *** [CMakeFiles/freeglut.dir/src/fg_callbacks.c.o] Error 1
make[1]: *** [CMakeFiles/freeglut.dir/all] Error 2
make: *** [all] Error 2


The file is on my computer:
$ ls /usr/X11R6/include/GL
freeglut.h glext.h glx_mangle.h glxtokens.h wmesa.h
freeglut_ext.h glu.h glxext.h internal/
freeglut_std.h glu_mangle.h glxint.h osmesa.h
gl.h glut.h glxmd.h vms_x_fix.h
gl_mangle.h glx.h glxproto.h wglext.h

how, cmake how to find free glut?

find_package(GLUT)
seems only found GLUT (which I don't know here it come from, I didn't installed that old junk)
how to found free glut?

I can do this way on my macOS;

find_library(glut NAMES glut HINTS /opt/homebrew/opt/freeglut/lib)

but, it doesn't quite cross platform and elegant, I don't like fixed path. How to do it more properly?

Wayland integration broken with Wlroots/Sway compositor

FreeGLUT version: 2019/06/07 012936e
OS: Arch Linux 5.2.6-arch1-1-ARCH
Compositor Sway version 1.1-rc1-87-g8ee054b1 (Aug 1 2019, branch 'master')

I compiled freeglut from the git_master branch using the -DFREEGLUT_WAYLAND=ON option.

I then wanted to build the mupdf-gl program which depends on freeglut to draw the window, but when I ran mupdf after installation the freeglut library returned an error: failed to discover all needed compositor interfaces.

Looking at the related wayland code, it returns an error when either compositor, shell, seat or shm are NULL, but I'm not sure why it fails to initialize: https://github.com/dcnieho/FreeGLUT/blob/git_master/freeglut/freeglut/src/wayland/fg_init_wl.c#L96

multi-touch demo doesn't work, Windows

I just tested the multi-touch demo on Windows 21H2 (19044.1889), it does not work. Only the normal clicks, not the touches are registered. E.g. when dragging two fingers on the window area, the console outputs:

cursor_id (23308) >= NUM_CURSORS (64), out of slots
cursor_id (23310) >= NUM_CURSORS (64), out of slots

Which is generated by the code in multi-touch.c

When i release and touch again the next time, these cursor ids are incremented again. So apparently each new touch has a new ID, and the logic currently there doesn't know how to handle that. I guess this work differently on different platforms?

Building on Windows and freeglut_std.h

I might be wrong but since FREEGLUT_LIB_PRAGMAS == 1 always is true on Windows, a library build links with itself. Maybe innocuous until you rename the output to something more descriptive like including the VS version. Not all VS2010 libs build with VS2015. So maybe define FREEGLUT_BUILD when you are building and wrap define FREEGLUT_LIB_PRAGMAS with that.
This all came to light while trying to go through the examples that come with OpenGL Programming Guide 8th Edition. The code there uses freeglut_static_vs2010_d.lib for example, so if you build a new lib I get freeglut_staticd.lib not found.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.