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

Pages: [1]
1
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?

2
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

3
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?

4
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

5
Let's say we have the event handler with the

sf::Event event

and we are looking for

event.type == Event::MouseButtonPressed

and only if that is true, we are trying to find out which button is actually being pressed,

does it make a difference if we do

event.mouseButton.button == Mouse::Left

or

Mouse::isButtonPressed(Mouse::Left)

or are those identical in that situation?

6
Hi,

I am trying to understand std::functions, so I tried the following:

auto bp = sf::Mouse::isButtonPressed;

and that works fine.

I tried the something similar:

auto gp = sf::Mouse::getPosition;

and it gave me the error
unable to deduce 'auto' from 'sf::Mouse::getPosition'

when I switched
auto
to
std::function<sf::Vector2i(const sf::Window&)>

I got
error: conversion from '<unresolved overloaded function type>' to non-scalar type 'std::function<sf::Vector2<int>(const sf::Window&)>' requested

What am I doing wrong? I am sure, I am misunderstanding this whole concept, but I find it wierd, that the first one worked without a problem and the other one didn't. Is it because of the overload?

7
General / Where do I get MinGW 6.1.0?
« on: October 05, 2016, 06:04:35 pm »
Hi,

since I got an error yesterday which resulted from the incompatablillity of my G++ version in MinGW (5.3.0) and the version SFML was made for (6.1.0), I updated my MinGW suite. I still have 5.3.0, though and I can't find the download for 6.1.0, so I wanted to ask where you got it from, to compile it for that version.

Thanks,
Kim

8
Hi!

I have installed cygwin with GCC. I have successfully compiled a few programs, so it works. But niw I wanted to compile my first SFML project. Which version do I have to download? And do I have to follow thesehttp://www.sfml-dev.org/tutorials/2.0/start-linux.php instructions or are there specific ones?

Thanks for your help!

9
General discussions / Where can I find the changelog for new SFML versions?
« on: December 27, 2014, 10:00:10 pm »
There is just a download for SFML 2.2, but no changelog. Where is it?

10
General / How to avoid "the white square problem"?
« on: December 27, 2014, 09:47:22 pm »
I am experiencing  "the white square problem" (http://www.sfml-dev.org/tutorials/2.0/graphics-sprite.php#the-white-square-problem). I have 2 std::vectors, one sf::Texture and one sf::Sprite, using that Texture. Both are being declared, the texture is being loaded from a file and the Sprite is using the texture, all in a while loop. So how am I supposed to make the texture last outside the while loop. what about
sf::Texture *tex = new sf::Texture
or something like that? I have never used that before and I don't really know what it does and how to use it. What is very strange, is that some Sprites work! the first 2 don't, but the third for example does. And some of the other sprites have wrong textures. But the vectors are being declared outside the loop, so I am able to draw and compile everything just fine.

Thank you for your help!

11
Feature requests / sf::Texture::Texture(std::string file)
« on: December 23, 2014, 02:13:23 pm »
Please make a constructor, that has sf::Texture::loadFromFile(string file) built in.

Thank, you, SFML is great!  ;)

12
General / sf::font::loadFromFile is spamming the console (Video)
« on: September 03, 2014, 11:24:50 am »
I have recorded a video

about what is happening, when I use font.loadFromFile. Code is in the video.
I am sure, that it's the font.loadFromFile, because I tried deleting everything else, and it still didn't work.
It doesn't even work in other projects.
I am using VS 2013.

Am I doing something wrong?

13
General / How do I get the RenderWindow in another Class?
« on: January 09, 2014, 04:04:02 pm »
Hello, I wanted to ask how I get the RenderWindow to another Class, do i have to make getter-Functions or how can I sove it with Pointers?

14
General / Whats the difference between vector2f, vector2i, etc.
« on: January 08, 2014, 08:19:13 pm »
Hello, I just wanted to know if there's any difference between all verctor2's.

15
Graphics / Test if any object is on a location
« on: December 03, 2013, 04:28:12 pm »
Hello!

I have 2 Integers. one for x Location and one for y. And i want a boolean to be true whenever any object is on those coordinates.



Sorry for my bad english

Pages: [1]
anything