Results 1 to 6 of 6

Thread: OpenGL application icon

  1. #1

    OpenGL application icon

    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?
    Huhuhu

  2. #2
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    OpenGL application icon

    Look under the articles. I have posted an article on how to do it

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

    (Edit - the link was wrong)
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  3. #3

    OpenGL application icon

    [quote="cairnswm"]Look under the articles. I have posted an article on how to do it

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

    (Edit - the ]

    please use this link as the old one may not work for much longer...
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  4. #4

    OpenGL application icon

    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.
    Huhuhu

  5. #5
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    OpenGL application icon

    The adding of a resource to an executable is not SDL related but standard windows functionality.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  6. #6

    OpenGL application icon

    If you're using c++ style template, you can try this on your glCreateWnd procedure:

    Code:
      with wndClass do                    // Set up the window class
      begin
        style         &#58;= 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   &#58;= @WndProc;        // Set the window procedure to our func WndProc
        hInstance     &#58;= h_Instance;
        hCursor       &#58;= LoadCursor&#40;0, IDC_ARROW&#41;;
        hIcon         &#58;= LoadIcon&#40;h_Instance,'MAINICON'&#41;;
        lpszClassName &#58;= '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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •