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.


Messages - Sherman

Pages: [1]
1
Never made a pull request before but I'm working on it, might take a while though.

2
I've managed to fix the problem for myself. The main problem lies within InputImp::getSFOpenGLViewFromSFMLWindow.

SFOpenGLView* getSFOpenGLViewFromSFMLWindow(const Window& window)
{
    id nsHandle = (id)window.getSystemHandle();

    // Get our SFOpenGLView from ...
    SFOpenGLView* view = nil;

    if ([nsHandle isKindOfClass:[NSWindow class]])
    {
        // If system handle is a window then from its content view.
        view = [nsHandle contentView];

        // Subview doesn't match ?
        if (![view isKindOfClass:[SFOpenGLView class]])
        {
            sf::err() << "The content view is not a valid SFOpenGLView"
                      << std::endl;
            view = nil;
        }

    }
    else if ([nsHandle isKindOfClass:[NSView class]])
    {
        // If system handle is a view then from a subview of kind SFOpenGLView.
        NSArray* subviews = [nsHandle subviews];
        for (NSView* subview in subviews)
        {
            if ([subview isKindOfClass:[SFOpenGLView class]])
            {
                view = (SFOpenGLView*)subview;
                break;
            }
        }

        // No matching subview ?
        if (view == nil)
            sf::err() << "Cannot find a valid SFOpenGLView subview." << std::endl;
    }
    else
    {
        if (nsHandle != 0)
            sf::err() << "The system handle is neither a <NSWindow*> nor <NSView*>"
                      << "object. This shouldn't happen."
                      << std::endl;
        // Else: this probably means the SFML window was previously closed.
    }

    return view;
}

When a window is created with fullscreen mode (see SFWindowController::setupFullscreenViewTithMode) a NSView called masterview is created with the SFLOpenGLView added as subview of this NSView. This NSView is then set as the window's contentview. This means that whenever InputImp::getSFOpenGLViewFromSFMLWindow is called during fulllscreen mode it'll try to get the SFOpenGLView from the contentview which fails because it's a regular NSView, not a SFOpenGLView. It should try to get the SFOpenGLView from the contentview's subviews instead of the contentview itself.

3
Graphics / Re: Conceptualizing "Ghosting" Sprite Movement
« on: August 31, 2014, 01:49:57 am »
This should be fairly easy to implement (I've already done it myself). I had a struct that would store the sf::Vector2f position of the character and a sf::IntRect that would store the current animation's frame. Every X frames I would create that struct, fill it with the necessary data and push it into a limited queue.

I could control the length of the trail by setting the size of the queue and I could tweak the interval at which I stored the information to control how fluid the ghost images move.

Every draw call I would draw the whole queue from back to front (because you want newer ghosts being drawn over older ghosts). Using the information from the struct I could put the ghost image at the same position and in the same animation state as the normal character that was drawn on the frame I stored the information. I could fade out the ghosts by using a fixed color value - the position of the ghost in the queue. 

I only ended up using one sf::Sprite that used the same texture as the sf::Sprite I used to draw the normal character. I've had no performance issues doing it this way.

4
SFML projects / Lethal League
« on: May 02, 2014, 04:32:30 pm »
Hello everyone,

We've been working on the "full" version of Lethal League for a while, and we are getting closer and closer to finishing the game. One of the major libraries we rely on is SFML (2.x), so I thought it would only be appropriate to share it with all of you.

I hope you like it!


Pages: [1]
anything