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

Pages: [1]
1
System / [2.0] sf::Thread and sf::RenderWindow::pollEvent()
« on: January 08, 2013, 06:47:03 am »
Is it possible to utilize a thread mainly for handling the close button of the application window? My current code doesn't seem to work. The window just freezes as if I wasn't checking for events, although the thread is running.

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

sf::RenderWindow appWindow( sf::VideoMode( 800,600 ),"Fox" );

void AppEvents()
{
    while( appWindow.isOpen() )
    {
        sf::Event event;
        while( appWindow.pollEvent( event ) )
        {
            if ( event.type == sf::Event::Closed )
                appWindow.close();
        }
    }
}

int main(int argc, char* argv[])
{
    //Player player;
    //Room room("res/rooms/MainMenu/room.xml");
    sf::Thread appEvents(&AppEvents);
    appEvents.launch();
    appEvents.wait();
    return EXIT_SUCCESS;
}

Any body have an idea why that might be?

2
General / Trouble at Runtime
« on: December 23, 2012, 09:42:53 pm »
Hi. I've followed your tutorial for SFML-2.0 RC with Code::Blocks. I get this segmentation fault:
#0 6E182B85     sf::VideoMode::VideoMode(this=0xc8, modeWidth=200, modeHeight=32, modeBitsPerPixel=2) (D:\developpement\sfml-master\src\SFML\Window\VideoMode.cpp:50)
#1 00401418     main(argc=1, argv=0x372d80) (C:\Users\Nicolas\Documents\Projects\Fox 3\main.cpp:5)
 

I found that this issue was already reported here (http://en.sfml-dev.org/forums/index.php?topic=9598.0) with no answer. Does anybody have any idea on how to fix this?

I'm on an AMD Radeon HD 6850 if that helps.

3
Graphics / Extra pixels drawn
« on: December 06, 2012, 03:43:57 am »
When I try drawing anything (SFML-1.6) via sf::RenderWindow::Draw() it semi-randomly comes up with extra pixels over the image that I loaded.

Example:


This occurs for most images I try. I have a feeling SFML adds some sort of effect or blur to images when they are drawn. Else, what should I do to fix it?

4
Graphics / Incompatibility with sf::Image and stl::list??
« on: October 14, 2012, 06:40:00 am »
Does anyone know if there is an incompatibility here? My animation class runs smoothly every time, but when I try to automate the process of reading several animations by queuing them in an stl::list, they don't show on-screen.

I'm positive the issue is something like this. The function I'm calling to draw it returns the sf::Sprite of the current frame, but it isn't showing anything. The program doesn't crash or anything either, so I'm thinking the Image doesn't stay in memory when it's in a list.

Anybody know anything about this?

5
Graphics / Crash when Setting Sprite Values
« on: July 28, 2012, 10:54:03 pm »
void sursprite::Add()
{
    main.SetSubRect( sf::IntRect( aX[aIndex], aY[aIndex], ( w + aX[aIndex] ), ( h + aY[aIndex] ) ) );
    sprite_queue.push_back( *this );
}
At line 3 in the above function, my program crashes. aX & aY are equal to zero. w & h are equal to 32.

Pages: [1]
anything