PDA

View Full Version : OpenGL application icon



Smotsholle
11-10-2006, 07:54 AM
As many of you know I'm working on an OpenGL game.
I want to add an icon to the .exe file.
Since it doesn't use forms or anything I can't use delphi settings to add an icon.

I've been searching using google and I've been doing a search on this forum, but I can't find anything on this.
I've tried several programs which were supposed to change the EXE icon, but it doesn't seem to work.

The standard icon (that white window box thingy) is ugly and I'd be happy if I could change it.

Do you know of a way to change the icon? Where is it stored?

cairnswm
11-10-2006, 08:05 AM
Look under the articles. I have posted an article on how to do it :)

Here it is: http://www.pascalgamedevelopment.com/viewarticle.php?a=58&p=1

(Edit - the link was wrong)

savage
11-10-2006, 08:25 AM
[quote="cairnswm"]Look under the articles. I have posted an article on how to do it :)

Here it is: http://www.pascalgamedevelopment.com/viewarticle.php?a=58&p=1

(Edit - the ]

please use this link (http://www.pascalgamedevelopment.com/forums/viewarticle.php?a=58&p=1) as the old one may not work for much longer...

Smotsholle
11-10-2006, 09:24 AM
I've read it and I wonder.... does this work with a non-SDL application too?

I'm using OpenGL and I'm trying to avoid using SDL stuff for as much as possible.

My previous school assignment was in SDL and I don't want to make the ones at school think I'm using the same techniques.

If there's no other way, then so be it, but if there is, please let me know.

cairnswm
11-10-2006, 10:55 AM
The adding of a resource to an executable is not SDL related but standard windows functionality.

Lowercase
25-10-2006, 07:41 PM
If you're using c++ style template, you can try this on your glCreateWnd procedure:



with wndClass do // Set up the window class
begin
style := CS_HREDRAW or // Redraws entire window if length changes
CS_VREDRAW or // Redraws entire window if height changes
CS_OWNDC; // Unique device context for the window
lpfnWndProc := @WndProc; // Set the window procedure to our func WndProc
hInstance := h_Instance;
hCursor := LoadCursor(0, IDC_ARROW);
hIcon := LoadIcon(h_Instance,'MAINICON');
lpszClassName := 'OpenGL';
end;


All you have to do is to add an icon by the project menu and goto options, or you can replace MAINICON in the code by the name of your icon in your res file