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

Pages: 1 ... 9 10 [11]
151
thx, it works  :)

152
Hello, i'm trying to load resources in background :
Code: [Select]
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>

void LoadResources()
{
sf::Context context;
for (int i = 0; i < 100; i++)
{
sf::Texture * texture = new sf::Texture();
texture->loadFromFile("D:/2.png");
}
}

int main()
{
sf::RenderWindow m_window(sf::VideoMode(1024, 768, 32), "Test", sf::Style::Close);
sf::Text m_text("test");
sf::Clock clock;
while (m_window.isOpen())
{
m_text.setPosition(clock.getElapsedTime().asMilliseconds() / 100, 100  );
sf::Event event;
while(m_window.pollEvent(event))
{
if (event.type == sf::Event::Closed) {
m_window.close();
}
if (event.type == sf::Event::KeyPressed) {
// key down
if (event.key.code == sf::Keyboard::Space) {
sf::Thread thread(LoadResources);
thread.launch();
}
}
}
m_window.clear();
m_window.draw(m_text);
m_window.display();
}
return 0;
}

The problem is that the main thread stops rendering while the second thread is working.
Also tried to use mutex to sync (acording to example on wiki), no changes. Am i missing something ?
Win7 64

153
Graphics / Just wondering, Intel GPU
« on: March 27, 2012, 08:07:50 pm »
Despite the problems with Intel graphics cards, was wondering if writing project without  using render to texture, will the program work on integrated video cards ?
I created a render texture, render all the graphics there, and than simply display RT texture in other sprite in window, and noticed some texture flicker (inside render texture). Is there any way to fix this, or just try to avoid using them until this problem being solved ?
Greetings from Ukraine  ::)

Pages: 1 ... 9 10 [11]
anything