I searched a lot to find a method to set the icon of a window created using the glut framework (even if would be better to say that I use freeGLUT), but I could find only ways that use WinAPI, while I would use a cross-platform solution.
I tried to use GLUT_ICON, but that 's available for Windows only (I work on Linux) and I tried also glutSetIconTitle() function on both Windows and Linux without results (first passing to the function the file 's path, like glutSetIconTitle("icon.ico")
, and then passing the file data as an array, like glutSetIconTitle(file_data)
). Can someone help me?
Asked
Active
Viewed 313 times
1

OrHy3
- 11
- 2
-
`glutSetIconTitle` sets the title for the window in its "iconified" state (taskbar, system tray, etc.). The icon in the window's header bar is an OS-specific feature, so you must use the individual API for each OS's windowing system to change it. WinAPI is the only way if your app is using the default Win32 window frame. Likewise for whatever window API you're using on Mac or Linux. (Gtk, Qt, etc.) – Romen Jan 10 '20 at 22:31
-
Does this answer your question? [Console-window has icon, but OpenGL/GLUT window don't have. Why?](https://stackoverflow.com/questions/18064943/console-window-has-icon-but-opengl-glut-window-dont-have-why) – user26742873 Jul 28 '20 at 05:07