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

Pages: [1]
1
General / Trying to create texture array
« on: May 17, 2014, 03:52:35 pm »
Hello !

Im trying to store textures to array but somehow i cant figure out how. Could you guys give me a way to go ?

2
General / Text is flickering
« on: May 10, 2014, 09:58:50 am »
Hello !

Im drawing player position on top of screen and it's flickering, why ?

void RenderingThread(sf::RenderWindow* window)
{
    // Rendering loop
    cout << "Starting rendering loop"<< endl;
    while(window->isOpen())
    {
        // Clear window
        window->clear(sf::Color::White);

        // draw...
        window->draw(pSprite);
        window->draw(StaticText);

        // end current frame
        window->display();
    }
}

void InitSettings()
{
    if(font.loadFromFile("Prototype.ttf")){
     StaticText.setFont(font);
     StaticText.setCharacterSize(20);
     StaticText.setColor(sf::Color::Red);
     StaticText.setPosition(0,0);
     }

}

 

This line is inside my main loop
StaticText.setString("pPositionX: " + ToString(pPositionX) + " pPositionY: " + ToString(pPositionY) );

3
General / Problem with tutorial
« on: May 05, 2014, 01:42:03 pm »
Hello,

im trying to get http://www.sfml-dev.org/tutorials/2.1/graphics-draw.php  "Drawing from threads" part to work. Im not getting any compiler errors but renderwindow is freezing when i run program.

Whats wrong ?

#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
using namespace std;

void RenderingThread(sf::RenderWindow* window)
{
    // Rendering loop
    cout << "Starting rendering loop"<< endl;
    while(window->isOpen())
    {
        // draw...

        // end current frame
        window->display();
    }
}


int main()
{
    // Create window
    cout << "Init window"<< endl;
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");

    // deactivate its OpenGL context
    cout << "Deactivate its OpenGL context"<< endl;
    window.setActive(false);

    // launch the rendering thread
    cout << "Launch the rendering thread"<< endl;
    sf::Thread thread1(&RenderingThread, &window);
    thread1.launch();

    // Events
    sf::Event event;
    while(window.isOpen())
    {
        // Check window events
        if(event.type == sf::Event::Closed)
            window.close();
    }

    return 0;
}
 

Pages: [1]
anything