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

Pages: [1]
1
General / Re: Trying to create texture array
« on: May 17, 2014, 04:34:55 pm »
Thank you both of you, working on my code now !

2
General / Re: Trying to create texture array
« on: May 17, 2014, 04:05:55 pm »
Thank you for reply, i have read 2 books of c++ and done some projects and workd whit array and classes. I also know java and others language and i have been programming 5 years.

What im asking is HOW i should construct texture array RIGHT and efficient way. Im not asking code, just logic behind all.

Sorry if i sound rude, you did too ;)

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

4
General / Re: Text is flickering
« on: May 11, 2014, 04:34:13 pm »
Thank you for multiple responds, this forum is very helpfull when needed !

Indeed i use other thread to draw stuff on screen, i tought it is good to separate tasks on own threads. Im now clearing renderthread and implenting rendering in main loop. I also made decision to use VSYNC , not frame limiter.

I will update here if more problems occurs on text flickering!


5
General / Re: Text is flickering
« on: May 10, 2014, 10:40:54 am »
Hi Jesper Juhl, it's still flickering ! i also limited my fps to 60.

6
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) );

7
General / Re: Problem with tutorial
« on: May 05, 2014, 02:33:04 pm »
Nice forums :) I edited code and its working now, thank you both ! Here is edited code if someone else is having problem with it.

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();

    while (window.isOpen())
    {

    // Events
    sf::Event event;
    while(window.pollEvent(event))
    {
        // Close request event
        if(event.type == sf::Event::Closed)
            window.close();
    }

    }
    return 0;
}

8
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]