I write a program in C / C++ / OpenGL / GLUT under Windows. I want to add an icon to my program. I use MinGW and command prompt to compile my only one .cpp file. I wrote myself some .bat files, which I can compile to debug-mode, release-mode, and things like that.
I want to add an icon to my program. So, I made a new compile bat, that looks like this:
windres resource.rc object.o
set PATH=%PATH%;c:\mingw\bin
g++ program.cpp object.o >>>some other settings<<<
I have a .ico file, and a resource file in "resource script" language. Resource file looks like this:
#ifndef _resource_rc
#define _resource_rc
MAINICON ICON "icons\\icon1.ico"
#endif
Now, the problem: I compile these things, and I got a release .exe, if I looks it in a file-handler program, I can see the icon near the .exe file, and if I run it, there is an icon in the corner. But, my program starts with a console-mode menu. If you travel in the menu, and choose a given menu-point, after that, you can start a graphic window, which wrote in OpenGL / GLUT. The problem is, that the console-window has the icon, but the OpenGL / GLUT window don't. It has a basic .exe icon (blue border, white rectangle inside), and not my specific icon. This is not good :-(
How can I solve, that the OpenGL / GLUT window has my icon, and not the default?
Thank for answers, and sorry because of my grammar :-)