Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Recreating RenderImage crashes everything?  (Read 1795 times)

0 Members and 1 Guest are viewing this topic.

Lupinius

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Recreating RenderImage crashes everything?
« on: September 02, 2010, 08:59:41 pm »
I'm playing around with SFML2 currently and when I'm creating a RenderImage a second time while the RenderWindow is displayed, the programm crashes with the message
Code: [Select]
X Error of failed request:  GLXBadPbuffer
  Major opcode of failed request:  128 (GLX)
  Minor opcode of failed request:  28 (X_GLXDestroyPbuffer)
  Serial number of failed request:  45
  Current serial number in output stream:  46
Segmentation fault

Minimal code:
Code: [Select]
#include <SFML/Graphics.hpp>

int main() {

    sf::RenderWindow app;
    app.Create(sf::VideoMode(800, 600), "Playground");

    sf::RenderImage target;
    target.Create(800, 600);

    while (app.IsOpened()) {

        target.Create(app.GetWidth(), app.GetHeight()); // Second time this point is reached stuff crashes
        app.Display(); // Works when I leave out this though

    }

    return 0;

}


Bug or my mistake?

(SFML2, Ubuntu 10.4 with a GeForce 9500 GT)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Recreating RenderImage crashes everything?
« Reply #1 on: September 02, 2010, 10:27:44 pm »
Your code looks ok. I'll test it, thanks :)
Laurent Gomila - SFML developer