PDA

View Full Version : Trying to set the window icon



JonR
08-08-2007, 03:46 AM
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?

sphair
08-08-2007, 06:27 AM
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

JonR
08-08-2007, 08:26 PM
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.

sphair
08-09-2007, 07:01 AM
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.

JonR
08-09-2007, 08:14 AM
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.