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

Pages: [1]
1
Graphics / strange and sharp object movement, due to SetFramerateLimit
« on: March 04, 2015, 06:08:41 pm »
Hello guys, I have a problem, as I know, SetFramerateLimit calls Sleep() to keep game framerate probably constant, but here's the problem, when I use
int main() {
RenderWindow Window(VideoMode(1024,768), "Window");
Window.setFramerateLimit(60);

RectangleShape rs;
rs.setSize(Vector2f(50,50));
rs.setPosition(0,0);

while(Window.isOpen()) {
rs.move(5,0);
Window.draw(rs);
Window.display();
Window.clear();
}
return 0;
}
 

that rectangle is moving very sharply every random frame and it can also move a bit back, or a bit forward, I don't know how to fix this :c

2
General / CPU core loaded to 100% when sfml app is launched
« on: February 08, 2015, 08:21:46 pm »
hello there guys, I have a problem, when I'm compiling that "test" code for sfml, I see that one of my core immediately become loaded from 1 - 3% to 80 - 100% and that's kinda strange, isn't that too much for an sfml or maybe that's my hardware issue ? Haven't tested this on other computers, here are screenshots :


3
General / NetBeans problem
« on: January 11, 2015, 04:06:12 am »
Hello guys, I have a problem with setting up SFML and NetBeans with minGW compiler. Looks like I connected all correctly, I'm using SFML 2.2 build for MinGW - 32bit





I'm trying to compile this simple code :
#include <SFML/Graphics.hpp>
 
int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);
 
    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }
 
        window.clear();
        window.draw(shape);
        window.display();
    }
 
    return 0;
}

and I get this error
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Release.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/d/NetBeansProj/SFML_ENGINE'
"/C/MinGW/msys/1.0/bin/make.exe"  -f nbproject/Makefile-Release.mk dist/Release/MinGW-Windows/sfml_engine.exe
make.exe[2]: Entering directory `/d/NetBeansProj/SFML_ENGINE'
mkdir -p build/Release/MinGW-Windows
rm -f "build/Release/MinGW-Windows/main.o.d"
g++    -c -O2 -DSFML_STATIC -I../../SFML-2.2/include -std=c++11 -MMD -MP -MF "build/Release/MinGW-Windows/main.o.d" -o build/Release/MinGW-Windows/main.o main.cpp
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\cmath:44:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\random:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
                 from ../../SFML-2.2/include/SFML/System/Utf.hpp:32,
                 from ../../SFML-2.2/include/SFML/System/String.hpp:32,
                 from ../../SFML-2.2/include/SFML/System.hpp:39,
                 from ../../SFML-2.2/include/SFML/Window.hpp:32,
                 from ../../SFML-2.2/include/SFML/Graphics.hpp:32,
                 from main.cpp:1:
c:\mingw\include\math.h: In function 'float hypotf(float, float)':
c:\mingw\include\math.h:635:30: error: '_hypot' was not declared in this scope
 { return (float)(_hypot (x, y)); }
                              ^
make.exe[2]: *** [build/Release/MinGW-Windows/main.o] Error 1
make.exe[2]: Leaving directory `/d/NetBeansProj/SFML_ENGINE'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/d/NetBeansProj/SFML_ENGINE'
make.exe": *** [.build-impl] Error 2
 
BUILD FAILED (exit value 2, total time: 1s)

tried reinstalling minGW twice and tried googling, but no result, that's why I'm here

4
Graphics / Problem with collision on Resizing
« on: December 23, 2014, 12:35:18 am »
Hello guys, I have a problem, I draw some squares in my window and they change their color, when I guide my cursor over them, but when I change manually the screen size, their collision is still on the last point, where it was, when those buttons haven't been resized, so, when I guide my cursor over them, there's nothing, but when I guide my cursor on that last place, squares change their color, any ideas what can I do ?

5
Graphics / GUI drawing
« on: December 11, 2014, 12:44:10 am »
hello guys, I have a question, how can I do something like glue GUI element to a current RenderWindow or current view ? I want that GUI to be a child of a view and I don't know how to do that, maybe you can guide me to the right path ?

6
Graphics / Problem with drawing text
« on: November 16, 2014, 07:47:47 pm »
Hello guys, I have a problem when I'm trying to draw more than one sf::Text, here's my source code
void GUI::CreateButton(sf::Vector2f position, sf::Vector2f size, sf::String text, sf::Vector2f textPos, sf::Texture buttonIMG, sf::Texture buttonGUIDANCE, sf::Texture buttonCLICK)
{
        std::unique_ptr<buttonSettings> rect (new buttonSettings()); // Creating a pointer to struct
 
                font.loadFromFile("D:\\visual studio 2012\\SFML_engine\\Project1\\Release\\Kingthings_Serifique.ttf");
        rect->btns.setPosition(position);

                rect->buttonIMG = buttonIMG;
                rect->buttonGUIDANCE = buttonGUIDANCE;
                rect->buttonCLICK = buttonCLICK;

               
        rect->btns.setSize(size);
                rect->btnText.setFont(font);
                rect->btnText.setCharacterSize(12);
                rect->btnText.setString(text);
                rect->btnText.setPosition(textPos);
        buttons.push_back(std::move(rect));
}

and then, after I've created a button with text, I'm drawing it :

for(unsigned int b = 0; b<buttons.size(); b++) { // draw buttons
                                _window.draw(buttons[b]->btns);
                                _window.draw(buttons[b]->btnText);
        }

and here, how my struct looks :

  typedef struct buttonSettings {
        sf::RectangleShape btns;
                sf::Text btnText;
                sf::Texture buttonIMG;
                sf::Texture buttonGUIDANCE;
                sf::Texture buttonCLICK;
        };

        std::vector<std::unique_ptr<ButtonListSettings>> buttonList;
 
all works fine, except one thing, when I'm creating more than one button with text, it's.. doing some strange things with one text.

7
General / Can't compile without debugging
« on: October 24, 2014, 02:30:33 pm »
Hello guys, I have a problem, I can't compile my program without debugging, with debugging it works perfectly, but without I have a crash, , when I start with debugging, it works : , here is my code : http://pastebin.com/tVBbdmHc, btw, it works, when I delete OnButtonListMove and CreateButtonList functions, I tried to replace that code, but still, no result, so, that's why I'm asking for a help, thanks.

Pages: [1]
anything