Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - kloffy

Pages: [1]
1
There was a thread about this a while ago (not sure where it went, forum search is kind of broken). Basically, it would be really useful to have the ability to change the window style without recreating the window (and with it the OpenGL context). In particular, this allows a very fast "lightweight" fullscreen mode by resizing the window and hiding the border. I posted a working implementation for Windows:

void setStyle(sf::Window& window, sf::Uint32 style)
{
    HWND handle = window.getSystemHandle();
    DWORD win32Style = WS_VISIBLE;

    if (style == sf::Style::None)
    {
        win32Style |= WS_POPUP;
    }
    else
    {
        if (style & sf::Style::Titlebar) win32Style |= WS_CAPTION | WS_MINIMIZEBOX;
        if (style & sf::Style::Resize)   win32Style |= WS_THICKFRAME | WS_MAXIMIZEBOX;
        if (style & sf::Style::Close)    win32Style |= WS_SYSMENU;
    }

    SetWindowLongPtr(handle, GWL_STYLE, win32Style);

    // Force changes to take effect
    SetWindowPos(handle, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_DRAWFRAME);
}

I realize it may be more difficult on other platforms (haven't tried it), but it would be worth looking into. Understandably, Laurent already said that it will not make it into 2.0, so I am crossing my fingers for future versions.

2
General discussions / SFML2 & OpenSceneGraph Examples
« on: March 08, 2013, 10:35:31 pm »
The old thread on this topic has not been updated in a while. Towards the end, it sounds like the original author had a couple of problems. Lately, I have decided to give this a try myself. So far, everything is working well, but there are a few things to look out for. I have decided to post a couple of examples that will hopefully make it easier for others to get started.

The examples are written and tested on Windows using Visual Studio 2012. However, the only platform specific feature are some of the preprocessor directives, which are used to conveniently configure project settings and link libraries.

There are no dependencies apart from SFML 2 and OpenSceneGraph 3.

Pages: [1]
anything