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 - kim366

Pages: [1] 2 3
1
General discussions / Re: How to use SFML on git
« on: January 25, 2017, 04:13:11 pm »
Okay, thanks!

PS: Even more off-topic: What is the word that includes both mouse buttons and keyboard keys? I need it for my inputManager class

2
General discussions / Re: How to use SFML on git
« on: January 23, 2017, 05:34:31 pm »
Thank you so much for the elaborate answer!

I asked a friend of mine today the same question and he too replied that external libraries should not be in git.

When it comes to large files, couldn't you just use git LFS, though?

Oh right! On linux you install SFML globally! Well, I am now definately switching.

Would you put the name of the library into .gitignore or .git/info/exclude on other operating systems?

3
General discussions / Re: IRC chat (70+ users)
« on: January 22, 2017, 07:40:05 pm »
IRC Chat is a RAS Syndrome

4
General discussions / How to use SFML on git
« on: January 22, 2017, 06:20:06 pm »
Hi,

this topic may be a bit SFML-unrelated, so please forgive me.

How should I use git in a cross-platform git project?

My 3 ideas
  • Copy the download for the specific compiler into the repository
    Problems: The graph shows 22k additions on the first commit, which are not mine. The library is OS/Compiler-specific
  • Create a separate repository for SFML and put the download in there and use it as a submodule in your actual repo
    This fixes Problem 1, but the second one still remains
  • Use the official SFML repo as a submodule
    Problem: How do you use SFML in it's raw state? Do you have to add all necessary cpp files to the makefile?

5
Graphics / Re: Is the Outline Inside or Outside the Object?
« on: November 25, 2016, 05:23:40 pm »
It's outside, so 15 for anyone looking for the answer.

6
Graphics / Is the Outline Inside or Outside the Object?
« on: November 25, 2016, 05:22:32 pm »
Let's say we have an
sf::CircleShape c(10)
If we now set
c.setOutlineThickness(5)
is the Radius of the Circle 10 or 15?

Thanks, Kim

7
Thanks! Makes sense

8
General / Re: Converting sf::Event::MouseMoveEvent to sf::Vector2i
« on: November 14, 2016, 03:39:26 pm »
Okay, thanks, but it is not possible to cast it all at once, you do have to make a new vector from the x and y values?

9
General / Converting sf::Event::MouseMoveEvent to sf::Vector2i
« on: November 14, 2016, 02:42:43 pm »
Let's say we have
sf::Vector2i v;

We get
error: conversion from 'sf::Event::MouseMoveEvent' to non-scalar type 'sf::Vector2i {aka sf::Vector2<int>}' requested

when doing
v = event.mouseMove;

The following works fine, but is ugly
v = sf::Vector2i(event.mouseMove.x, event.mouseMove.y)

There also is no explicit conversion.

Is there a nicer way of doing this?

Thanks,
Kim

PS: A bit off-topic, but why does Vector2 have no parenthesis overload?

10
Do the following code snippets do the exact same thing?

while (window.isOpen)
{
        sf::Event event;
        while (window.pollEvent(event))
        {
                if (event.type == sf::Event::mouseButtonPressed)
                {
                        // Do something here
                }
       
        } // Poll Events

} // Game Loop
 

bool bolean;

while (window.isOpen)
{
        bolean = false;

        sf::Event event;
        while (window.pollEvent(event))
        {
                if (event.type == sf::Event::mouseButtonPressed)
                {
                        boolean = true;
                }
       
        } // Poll Events

        if (boolean)
        {
                // Do the same thing here
        }

} // Gameloop
 

I am asking this, because you mentioned some sort of delay and timing in my last question and I want to know, if I am understanding this right, so sorry if this question seems stupid.

Thanks,
Kim

11
Sure it would:

std::optional<sf::Mouse::Button> button;
if (event.type == sf::Event::KeyReleased) button.reset();
if (event.type == sf::Event::KeyPressed) button = event.mouseButton.button

(Or whatever the button identifier is).

12
std::optional
would really help with this, but MinGW doesn't support it yet...

13
Oh, right. Sorry it is late :P

14
How do you get the state of the key, when no KeyPressed event is triggered, though? As I said, I need both options and I want to make them work the same way.

15
Okay, very interesting. But, so you would completely avoid events and just check if last frame the mouse button was pressed and if the state changed? Since I need both in my application and it needs to be consistent, in the sense that I have a handleInput function and I pass it whether it was called from inside the event handler or from the isButtonPressed Testing.

Pages: [1] 2 3