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

Pages: [1]
1
General / OS X: crash when resize window to minimal size
« on: January 30, 2015, 05:01:08 pm »
SFML from github (master).

When I try resize window to minimal size (i do it fast), program crashes.

UPD: I think is a bug of the OS, because with GLFW i've got same thing.

Code:

#include <SFML/Window.hpp>

int main()
{
    sf::Window window(sf::VideoMode(800, 600), "OpenGL");

    bool running = true;

    while (running) {
        sf::Event event;

        while (window.pollEvent(event)) {
            if (event.type == sf::Event::Closed) {
                running = false;
            }
        }
    }

    window.close();

    return 0;
}
 

Error:

(click to show/hide)

2
General / runtime error with code from graphics tutorial
« on: January 29, 2015, 03:29:02 pm »
code from http://www.sfml-dev.org/tutorials/2.1/graphics-draw.php:

#include <SFML/Graphics.hpp>

void renderingThread(sf::RenderWindow *window)
{
    while (window->isOpen()) {
        window->clear();
        window->display();
    }
}

int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "OpenGL");

    sf::Thread thread(&renderingThread, &window);
    thread.launch();

    while (window.isOpen()) {
        sf::Event event;

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

    return 0;
}

Error when close window: Pure virtual function called! because window is closed (and may be deleted), but pointer *window in second thread are still used

i change code, add mutex, and now it works fine, but i'm not sure is this right way to use mutex here?

// main thread
...
if (event.type == sf::Event::Closed) {
    mutex.lock();
    window.close();
    mutex.unlock();
}
...

// second thread
...
    mutex.lock();
    window->clear();
    window->display();
    mutex.unlock();
...
 

3
General / Can't build simple app on OS X (SFML from master)
« on: January 29, 2015, 02:19:54 pm »
Hi!

SFML compiled from sources (github master) using clang and libc++ (may be i do it wrong, but simple app with window compiles succefull).
When i try to compile anything with code:

sf::VertexArray triangle(sf::Triangles, 3);

ive get error:

Undefined symbols for architecture x86_64:
  "sf::VertexArray::VertexArray(sf::PrimitiveType, unsigned int)", referenced from:
      renderingThread(sf::RenderWindow*) in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Engine] Error 1
make[1]: *** [CMakeFiles/Engine.dir/all] Error 2
make: *** [all] Error 2

Compiled with CMake:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -stdlib=libc++")

It seems like some SFML parts compiled with 32bit arch instead of 64..

4
General / Window size on OS X & Retina display
« on: January 26, 2015, 05:02:26 pm »
Hi.

Tested on 2.2 (from sources) & github master.

Code below makes window with size 400x300:

sf::Window window(sf::VideoMode(800, 600), "My window");

Of course in real (hardware) pixels it have normal size (800x600 real pixels), but by default OS X scales resolution. Same problem with sprites & other.

So can the SFML detect that need to scale all sizes automatically when i run app on retina display and non-retina display?

Pages: [1]
anything