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

Author Topic: OpenGL not Working  (Read 10055 times)

0 Members and 1 Guest are viewing this topic.

foofel

  • Newbie
  • *
  • Posts: 4
    • View Profile
OpenGL not Working
« Reply #15 on: December 18, 2010, 03:04:26 pm »
Quote from: "Laurent"
Ok ok, I get it. You'll have to wait until the global exit crash is fixed (this is the same kind of problem).


Damn, is there a workaround or something? :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
OpenGL not Working
« Reply #16 on: December 18, 2010, 03:40:12 pm »
Quote
Damn, is there a workaround or something?

Using static libraries ;)
Laurent Gomila - SFML developer

foofel

  • Newbie
  • *
  • Posts: 4
    • View Profile
OpenGL not Working
« Reply #17 on: December 18, 2010, 03:56:11 pm »
Quote from: "Laurent"
Quote
Damn, is there a workaround or something?

Using static libraries ;)


Works, thanks :)

[edit] But could you try to explain what happens, so the dll version doesn't work?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
OpenGL not Working
« Reply #18 on: December 18, 2010, 04:23:27 pm »
Quote
But could you try to explain what happens, so the dll version doesn't work?

I have a global OpenGL context in SFML, which is created at global startup (before main()) and destroyed at global exit (after main()). This is not very clean programming practice, but it's so convenient.
For an unknown reason, when I do this from a DLL it causes a crash in the ATI OpenGL driver. So there's no easy bug, I need to remove this global context but this means adding a manual SFML init() and cleanup(), and I really don't like it.
Laurent Gomila - SFML developer

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
OpenGL not Working
« Reply #19 on: December 18, 2010, 04:28:16 pm »
Quote from: "Laurent"
Quote
But could you try to explain what happens, so the dll version doesn't work?

I have a global OpenGL context in SFML, which is created at global startup (before main()) and destroyed at global exit (after main()). This is not very clean programming practice, but it's so convenient.
For an unknown reason, when I do this from a DLL it causes a crash in the ATI OpenGL driver. So there's no easy bug, I need to remove this global context but this means adding a manual SFML init() and cleanup(), and I really don't like it.


Could have been the problem I experienced before?
Anyway you could have support for both? And then let us have a SFML object se we can write something like:
Code: [Select]
#define SFML_NO_GLOBAL
#include <SFML/System.hpp>

int main()
{
    sf::SFML *sfml = new sf::SFML(/* Maybe settings here if wanted? */);
    delete sfml;
    return 0;
}


I just used new and delete to show that we manually decide when we initiate and when we cleanup.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
OpenGL not Working
« Reply #20 on: December 18, 2010, 05:31:55 pm »
Quote
Anyway you could have support for both?

No. Why should I do that?

Quote
And then let us have a SFML object

Don't know yet.
Laurent Gomila - SFML developer

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
OpenGL not Working
« Reply #21 on: December 18, 2010, 06:43:50 pm »
Quote from: "Laurent"
Quote
Anyway you could have support for both?

No. Why should I do that?


Don't know just spewing out ideas :P
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
OpenGL not Working
« Reply #22 on: December 18, 2010, 07:40:29 pm »
If this case should ever become relevant, I think the most appropriate version would be a RAII wrapper around Init() and Cleanup(), so that there is at least only one line.
Code: [Select]
int main()
{
    sf::GlobalContext context; // Automatic Init()
    ... // Do SFML stuff here
    ...
} // Automatic Cleanup() at end of scope
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
OpenGL not Working
« Reply #23 on: December 18, 2010, 07:43:42 pm »
Of course :)
Laurent Gomila - SFML developer

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
OpenGL not Working
« Reply #24 on: December 18, 2010, 07:47:56 pm »
Quote from: "Nexus"
If this case should ever become relevant, I think the most appropriate version would be a RAII wrapper around Init() and Cleanup(), so that there is at least only one line.
Code: [Select]
int main()
{
    sf::GlobalContext context; // Automatic Init()
    ... // Do SFML stuff here
    ...
} // Automatic Cleanup() at end of scope


That's what I meant but I used new and delete to show I meant the constructor and destructor, maybe it wasn't as apparent as I thought.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

angelmxc

  • Newbie
  • *
  • Posts: 1
    • View Profile
OpenGL not Working
« Reply #25 on: December 19, 2010, 11:42:24 am »
Same problem, ati driver 10.09 works, fail with 10.10, 10.11, 10.12, works fine on Ubuntu 10.10 using HD5850, I'm using temporarily MesaGL using software processing on Windows 7-64, i compiled MesaGL version 7.8.2, you can download libs from  HERE, just copy the libraries in .exe's directory and run your exe.

foofel

  • Newbie
  • *
  • Posts: 4
    • View Profile
OpenGL not Working
« Reply #26 on: December 20, 2010, 05:50:02 pm »
Nice :)

 

anything