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

Pages: [1] 2
1
General / Re: Strange Movement with Fixed Timestep
« on: August 12, 2016, 06:20:58 pm »
Quote
Using std::to_string every frame is absolutely fine. How else are you expected to display the latest scores, times etc.?

I'm not sure

may be sprintf (considered unsafe) function instead of to_string.

2
Window / Re: Android and Keys
« on: February 29, 2016, 01:31:46 am »
Hi

I'm not expert at Android environment.
I also examine and try to learn SFML&Android nowadays.

May be it is usefull for you  ... there is a list in androidKeyToSF function
SFML\src\SFML\Window\Android\WindowImplAndroid.cpp

3
SFML wiki / Re: Android example can not close on Escape
« on: February 11, 2016, 11:45:09 am »
Quote
Make sure to leave your main() after you've closed the window. Any chance you forgot doing that?

I hope it gives you an idea to find close problem.
as I can see
std::exit(0);
can close completely.

1. I tried to control via isClosed boolean var. does not work
                if (event.key.code == sf::Keyboard::Escape)
                {
                    isClose = true;
                    window.close();
                }
 

2. I tried to return 0 does not work
window.close();
return 0;
 


4
SFML wiki / Re: Android example can not close on Escape
« on: February 06, 2016, 03:49:34 pm »
Returning key code is 36 it is Escape in "Keyboard::Key" enum.

On Escape It closes the example applicatin but after that .... the example app can not work again only black screen appears.

5
SFML wiki / Android example can not close on Escape
« on: February 06, 2016, 03:08:46 pm »
Hello,

I try to run android example through wiki "Tutorial: Building SFML for Android".
As was expected it worked.

I added Escape key release checking to close via Back button on the tablet.
if (event.type == sf::Event::KeyReleased)
{
  if (event.key.code == sf::Keyboard::Escape)
  window.close();
}
 
It can not close properly.
Any idea ? What can I do ?

Thanks

Edit:
I noticed same question at this link :(
http://en.sfml-dev.org/forums/index.php?PHPSESSID=ot7h2v1oj9hmn1qop9q78i4s03&topic=19145.msg141108#msg141108

6
General discussions / Re: Unofficial Nightly Builds
« on: January 17, 2015, 02:08:07 pm »
Hello

I tried SFGUI-MinGW-builds-491r1-32 libs.


No such file ... compile error...
Renderer.hpp
#include <SFGUI/RendererTextureNode.hpp>

Table.hpp
#include <SFGUI/TableOptions.hpp>
#include <SFGUI/TableCell.hpp>

I think it is easy to understand for you.

My elementary solution is  taking that files from your ver..492 then  it seems worked.

7
Network / Re: FTP Status 1002
« on: January 04, 2015, 09:33:09 pm »
I'm not good at networking.
I try to follow what's new in the current version of SFML.


I worked with sf::Ftp a bit.

As I can see getaddrinfo() function doesn't like ftp:// prefix.

8
Graphics / Re: how to use RenderTexture properly (off-screen drawing) ?
« on: February 17, 2014, 11:16:25 am »
Thank you for the generic answer  :)

and I am sorry for not reading carefully...

I missed to call RenderTexture::display().
That's my fault.

9
Graphics / how to use RenderTexture properly (off-screen drawing) ?
« on: February 17, 2014, 10:46:03 am »
Hello,

I'm trying to use off-screen drawing (in tutorial section "Drawing 2D stuff")

if i don't use set origin and scale it doesn't display properly.

What am I doing wrong?

   
sprite.setOrigin(0, 400);
sprite.scale(1, -1);
 


#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(300, 400), "Render Texture");

    sf::RenderTexture rt;
    sf::Sprite sprite;

    rt.create(300, 400);
    //sprite.setOrigin(0, 400);
    //sprite.scale(1, -1);

    sf::RectangleShape rect;
    rect.setPosition(10, 20);
    rect.setSize(sf::Vector2f(50, 100));
    rect.setFillColor(sf::Color(0, 255, 0));
    rt.draw(rect);

    sprite.setTexture(rt.getTexture());
    sprite.setPosition(0, 0);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }
        window.clear(sf::Color::Black);
        window.draw(sprite);
        window.display();
    }

    return 0;
}
 

10
Hello

I think it should be "width, height" instead of "x + width, y+height)

void Movie::resizeToFrame(int x, int y, int width, int height, bool preserveRatio)
{
        resizeToFrame(sf::IntRect(x, y, x + width, y + height), preserveRatio);
}

11
Window / Re: Window does not activate if you click inside it
« on: September 17, 2013, 09:23:56 am »
I think "On-Screen Keyboard" programs need this property (bug) . :)

can it be useful for this purpose?

12
SFML website / Re: Where are new version changes..."What's new"
« on: August 01, 2013, 12:58:39 pm »
Thanks

13
SFML website / Where are new version changes..."What's new"
« on: August 01, 2013, 12:28:24 pm »
Hello,

I can not see updates , changes info about 2.1. new version.

14
Graphics / Re: ConvexShape and its getPosition
« on: May 28, 2013, 12:03:01 pm »
I think this way is right ... :-\

    rect.setPosition(
                     sf::Vector2f(
                                  shape.getGlobalBounds().left,
                                  shape.getGlobalBounds().top
//                                  shape.getPosition().x + shape.getLocalBounds().left,
//                                  shape.getPosition().y + shape.getLocalBounds().top
                                  )
                     );
 

15
Graphics / ConvexShape and its getPosition
« on: May 28, 2013, 10:23:05 am »
Hello

I'm trying to make this:

draw(convexshape with 4 points)
getBounds
getPosition
draw(rectangle) //frame arround convex sahpe
 

If convexshape's first coordinate is different from "0" then getPosition returns (pos - firstCoord).

is it normal behaviour ?

rect.setPosition(shape.getPosition());


[/code]


#include <SFML/Graphics.hpp>

int main ()
{
    sf::ConvexShape shape(4);
    shape.setFillColor(sf::Color::Red);

    sf::RectangleShape rect;
    rect.setFillColor(sf::Color::Green);

    shape.setPoint(0, sf::Vector2f(40,50));
    //shape.setPoint(0, sf::Vector2f(0,0));
    shape.setPoint(1, sf::Vector2f(140,60));
    shape.setPoint(2, sf::Vector2f(150,250));
    shape.setPoint(3, sf::Vector2f(30,240));

    shape.setPosition(200, 200);

    rect.setSize(sf::Vector2f(shape.getGlobalBounds().width, shape.getGlobalBounds().height));
    rect.setPosition(shape.getPosition());

    sf::RenderWindow window(sf::VideoMode(800, 600), "ConvexShape");
    sf::Event event;

    while (window.isOpen()) {
        while (window.pollEvent(event)) {
            switch (event.type) {
            case sf::Event::Closed:
                window.close();
                break;
            case sf::Event::KeyPressed:
                window.close();
                break;
            }
        }

        window.clear();
        window.draw(rect);
        window.draw(shape);
        window.display();
    }
}

Pages: [1] 2