Results 1 to 5 of 5

Thread: Trying to set the window icon

  1. #1

    Default Trying to set the window icon

    I'm currently using version 0.8.0

    I've been trying to set the window icon in the upper left corner of the display window on Windows (I don't know that Mac or Linux supports this, and I haven't heard feedback that it's expected there, so I'm only looking for it on Windows at this point) but to do that I need access to the HWND or HINSTANCE. Is there any way that ClanLib makes either of these available short of having to edit my version of it to gain access?

  2. #2
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    If you create an CL_OpenGLWindow (instead of CL_DisplayWindow), try using window.get_wnd();

    class CL_API_GL CL_OpenGLWindow : public CL_DisplayWindow

    #ifdef WIN32
    //: Returns the Win32 OpenGL resource context.
    HGLRC get_context();

    //: Returns the Win32 device context handle.
    HDC get_dc();

    //: Returns the Win32 window handle.
    HWND get_wnd();
    #else
    #ifndef __APPLE__
    //: Retuens the X11 display handle.
    Display *get_wnd();
    #endif

  3. #3

    Default

    Quote Originally Posted by sphair View Post
    If you create an CL_OpenGLWindow (instead of CL_DisplayWindow), try using window.get_wnd();
    Are there any drawbacks to doing this? The game currently uses a lot of sprite drawing, so if there are any efficiency penalties to using an OpenGL window or if it has more possible compatability flaws it might not be a good idea for my current needs.

  4. #4
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    OpenGL is the default unless you use the SDL target. So if you call SetupGL and just creates a CL_DisplayWindow, it does use OpenGL anyway.

  5. #5

    Default

    Quote Originally Posted by sphair View Post
    OpenGL is the default unless you use the SDL target. So if you call SetupGL and just creates a CL_DisplayWindow, it does use OpenGL anyway.
    That's very good to know.

    Thank you for the advice.

Similar Threads

  1. Threading: window busy
    By Caesar in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 08-06-2007, 02:07 PM
  2. how to create a window with picture background
    By gison in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 06-05-2007, 01:34 AM
  3. Feature request: sticky properties window
    By whisperstorm in forum Novashell Game Creation System
    Replies: 4
    Last Post: 01-13-2007, 06:24 AM
  4. Using Dink Smallwood icon in my editor
    By in forum Dink Smallwood HD
    Replies: 5
    Last Post: 10-29-2002, 11:43 PM

Bookmarks

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
  •