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

Author Topic: OpenGL bug? Nvidia driver bug? SFML bug? My fault?  (Read 55166 times)

0 Members and 2 Guests are viewing this topic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
OpenGL bug? Nvidia driver bug? SFML bug? My fault?
« Reply #75 on: October 10, 2009, 07:50:49 pm »
I know, this issue is very annoying. It's hard for me to fix it as I can't reproduce the error with my nVidia graphics card. I'll probably need help from you guys ;)
Laurent Gomila - SFML developer

K-Bal

  • Full Member
  • ***
  • Posts: 104
    • View Profile
    • pencilcase.bandcamp.com
    • Email
OpenGL bug? Nvidia driver bug? SFML bug? My fault?
« Reply #76 on: October 10, 2009, 08:34:48 pm »
Quote from: "Laurent"
I'll probably need help from you guys ;)


What do you want us to do, send you an ATI card? :D
Listen to my band: pencilcase.bandcamp.com

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
OpenGL bug? Nvidia driver bug? SFML bug? My fault?
« Reply #77 on: October 10, 2009, 10:25:10 pm »
Quote
What do you want us to do, send you an ATI card?

Testing my modifications and reporting success / failures should be enough :)
Laurent Gomila - SFML developer

sfPaul

  • Newbie
  • *
  • Posts: 6
    • View Profile
OpenGL bug? Nvidia driver bug? SFML bug? My fault?
« Reply #78 on: October 11, 2009, 10:39:26 am »
Quote from: "Laurent"
Quote
What do you want us to do, send you an ATI card?

Testing my modifications and reporting success / failures should be enough :)

Ok! I'm ready to help you if you want! ;)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
OpenGL bug? Nvidia driver bug? SFML bug? My fault?
« Reply #79 on: October 11, 2009, 11:45:37 am »
The first thing you can test is an empty program linked against sfml-window
Code: [Select]
#include <SFML/Window.hpp>

int main()
{
    return 0;
}


And one with a sf::Window declared
Code: [Select]
#include <SFML/Window.hpp>

int main()
{
    sf::Window window(sf::VideoMode(800, 600), "test");
    return 0;
}
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
OpenGL bug? Nvidia driver bug? SFML bug? My fault?
« Reply #80 on: October 11, 2009, 11:48:42 am »
Something else that you can test: someone reported me that the probem appeared at revision 1191; 1190 should work fine.
Laurent Gomila - SFML developer

sfPaul

  • Newbie
  • *
  • Posts: 6
    • View Profile
OpenGL bug? Nvidia driver bug? SFML bug? My fault?
« Reply #81 on: October 11, 2009, 12:26:35 pm »
Quote from: "Laurent"
The first thing you can test is an empty program linked against sfml-window
Code: [Select]
#include <SFML/Window.hpp>

int main()
{
    return 0;
}

This works fine. No problems.

Quote from: "Laurent"
And one with a sf::Window declared
Code: [Select]
#include <SFML/Window.hpp>

int main()
{
    sf::Window window(sf::VideoMode(800, 600), "test");
    return 0;
}

But here the error appeared again.

Quote from: "Laurent"
Something else that you can test: someone reported me that the probem appeared at revision 1191; 1190 should work fine.

Sorry, but what do you mean with this?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
OpenGL bug? Nvidia driver bug? SFML bug? My fault?
« Reply #82 on: October 11, 2009, 01:51:23 pm »
Thanks for your help.

Quote
Sorry, but what do you mean with this?

I'm talking about SVN revisions. The revision number 1191 is supposed to be the one where the problem appeared.
Laurent Gomila - SFML developer

K-Bal

  • Full Member
  • ***
  • Posts: 104
    • View Profile
    • pencilcase.bandcamp.com
    • Email
OpenGL bug? Nvidia driver bug? SFML bug? My fault?
« Reply #83 on: October 11, 2009, 02:39:48 pm »
Revision 1190 works fine for me.
Listen to my band: pencilcase.bandcamp.com

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
OpenGL bug? Nvidia driver bug? SFML bug? My fault?
« Reply #84 on: October 11, 2009, 02:53:46 pm »
Quote
Revision 1190 works fine for me.

And what about 1191?
Laurent Gomila - SFML developer

K-Bal

  • Full Member
  • ***
  • Posts: 104
    • View Profile
    • pencilcase.bandcamp.com
    • Email
OpenGL bug? Nvidia driver bug? SFML bug? My fault?
« Reply #85 on: October 11, 2009, 03:10:54 pm »
Quote from: "Laurent"
Quote
Revision 1190 works fine for me.

And what about 1191?


GLX error ;)
Listen to my band: pencilcase.bandcamp.com

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
OpenGL bug? Nvidia driver bug? SFML bug? My fault?
« Reply #86 on: October 11, 2009, 03:20:12 pm »
Great :)

I have an idea, I'll try to submit a fix tomorrow.
Laurent Gomila - SFML developer

Lokk

  • Full Member
  • ***
  • Posts: 228
    • View Profile
    • http://betadineproject.wordpress.com/
OpenGL bug? Nvidia driver bug? SFML bug? My fault?
« Reply #87 on: October 11, 2009, 04:48:22 pm »
Ok, 1190 successed and 1191 failed for me too ;)

sfPaul

  • Newbie
  • *
  • Posts: 6
    • View Profile
OpenGL bug? Nvidia driver bug? SFML bug? My fault?
« Reply #88 on: October 11, 2009, 05:20:03 pm »
Quote from: "Lokk"
Ok, 1190 successed and 1191 failed for me too ;)

With me it was the same problem.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
OpenGL bug? Nvidia driver bug? SFML bug? My fault?
« Reply #89 on: October 12, 2009, 09:30:39 am »
New test:
Code: [Select]
// test.cpp
// --------

#include <X11/Xlib.h>
#include <GL/glx.h>
#include <GL/gl.h>
#include <GL/glxext.h>
#include <iostream>

class Context
{
public :

    Context(bool sameDisplay = true, const Context* shared = NULL)
    {
        if (shared && sameDisplay)
        {
            display = shared->display;
            sharedDisplay = true;
        }
        else
        {
            display = XOpenDisplay(NULL);
            sharedDisplay = false;
        }

        window = XCreateWindow(display,
                               RootWindow(display, DefaultScreen(display)),
                               0, 0,
                               1, 1,
                               0,
                               DefaultDepth(display, DefaultScreen(display)),
                               InputOutput,
                               DefaultVisual(display, DefaultScreen(display)),
                               0, NULL);

        XVisualInfo tpl;
        tpl.depth    = DefaultDepth(display, DefaultScreen(display));
        tpl.visualid = XVisualIDFromVisual(DefaultVisual(display, DefaultScreen(display)));
        tpl.screen   = DefaultScreen(display);

        int nbVisuals = 0;
        XVisualInfo* visuals = XGetVisualInfo(display, VisualDepthMask | VisualIDMask | VisualScreenMask, &tpl, &nbVisuals);
        if (!visuals || (nbVisuals == 0))
        {
            if (visuals)
                XFree(visuals);
            std::cout << "There is no valid visual for the selected screen" << std::endl;
            return;
        }

        context = glXCreateContext(display, &visuals[0], shared ? shared->context : NULL, true);
        if (!context)
        {
            std::cout << "Failed to create an OpenGL context for this window" << std::endl;
            return;
        }

        Window root = RootWindow(display, DefaultScreen(display));
        Colormap colorMap = XCreateColormap(display, root, visuals[0].visual, AllocNone);
        XSetWindowColormap(display, window, colorMap);

        XFree(visuals);

        glXMakeCurrent(display, window, context);

        std::cout << "Succeeded to create context!" << std::endl;
    }

    ~Context()
    {
        glXMakeCurrent(display, None, NULL);
        glXDestroyContext(display, context);
        XDestroyWindow(display, window);
       
        if (!sharedDisplay)
            XCloseDisplay(display);
    }

private :

    Display* display;
    Window window;
    GLXContext context;
    bool sharedDisplay;
};

int main()
{
    std::cout << "Creating the first context..." << std::endl;
    Context c1;

    std::cout << "Creating a shared context on the same display..." << std::endl;
    Context c2(true, &c1);

    std::cout << "Creating a shared context on a new display..." << std::endl;
    Context c3(false, &c1);

    return 0;
}


Quote
g++ test.cpp -o test -lX11 -lGL
./test


If I'm right, the two first contexts should succeed, and the last one should fail (with people having the GLX issue).
Laurent Gomila - SFML developer

 

anything