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

Author Topic: SFML2 bugs  (Read 3469 times)

0 Members and 1 Guest are viewing this topic.

stubler

  • Newbie
  • *
  • Posts: 17
    • View Profile
SFML2 bugs
« on: March 29, 2010, 05:39:54 pm »
I have been using SFML2 to implement an interactive slide show as part of an image management prototype. I have encountered a few difficulties. I plan back down to SFML 1.5 and defer some of my planned visual effects in hopes of gaining stability and portability across Windows versions. However, as I do so, I would like to document my problems.

My environment:
OS: XP SP2
IDE: Visual Studio 2005 SP2
The main application GUI is C#. My image analysis and management library is in unmanaged C++. The managed<->unmanaged transition is made via a thin wrapper that creates a DLL used by the C# GUI. SFML is used within the unmanaged C++ domain, contained by the wrapper. To avoid naming collisions (my project is pretty big and has a lot of stuff in it), I link with the DLL versions of SFML. Because the slide show is just a feature, it may not be called and SFML functions may not be executed every time the program runs.

The Issues:
(1) I found that I had to put the following line in my main constructor within the C++, otherwise the SFML destructors would crash on exit if I did not call any other SFML functions.

Code: [Select]

  // HACK - This following line is to avoid a crash when the SFML dll exits
  sf::Context context;


(2) When using a RenderImage, sometimes the images are drawn vertically inverted. This is particularly odd because I cannot seem to anticipate whether it will be flipped. However, the behavior is repeatable to the extent that I can set the "FlipY" parameter to compensate once I have seen it flip in a given usage.

(3) In some cases, the first time I use a RenderImage, it is drawn onto my RenderWindow as all black. I am using the RenderImage to accomplish a clipping path on a rotated sprite. I clear() the RenderImage with a transparent color, draw the rotated sprite into the RenderImage, Display() the RenderImage, create a Sprite using the RenderImage, draw the RenderImage Sprite into the RenderWindow. After the first such use, it appears to behave normally.

(4) RenderImages appear to behave differently on different versions of Windows (or at least on different machines I have at my disposal). When it fails, most commonly it displays as black, however I have seen it display as the Sprite color.

(5) I played around with sounds and music and encountered a crash when I tried to LoadFromFile. However, I have not spent any time determining the details of this failure.

I suspect that many of these problems originate from my use of SFML within a DLL, combined with the fact that SFML is not always called upon.

I like SFML and find it pretty easy to use. I hope that these comments are not taken as overt criticism of the library, rather I am just trying to document behaviors that appear to be bugs.

Thanks

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML2 bugs
« Reply #1 on: March 29, 2010, 06:47:51 pm »
Hi

Thanks for your feedback, this is very appreciated :)

I need to know a few things:
- which revision of SFML 2 did you use?
- are your problems related to the usage of C#? (if you don't know, you should first test that)
- can you provide complete and minimal examples that would help me to reproduce your problems? :mrgreen:
Laurent Gomila - SFML developer

stubler

  • Newbie
  • *
  • Posts: 17
    • View Profile
SFML2 bugs
« Reply #2 on: March 29, 2010, 08:44:50 pm »
I will try to do so as soon as I can.

stubler

  • Newbie
  • *
  • Posts: 17
    • View Profile
SFML2 bugs
« Reply #3 on: March 30, 2010, 10:04:49 pm »
I have a minimum build in a zip file that I can send to you. However, I have encountered problems trying to sent them to the email address listed: laurent@sfml-dev.org (and the gmail account to which it appears to forward).

Is there another address you would like me to send it to?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML2 bugs
« Reply #4 on: March 30, 2010, 10:57:41 pm »
Quote
Is there another address you would like me to send it to?

I have no other address, but this one should work, I receive a lot of e-mails everyday. What error do you get? Is it a problem with the maximum file size (10 MB)? If so, then your "minimal" example is probably still too big ;)
Laurent Gomila - SFML developer

stubler

  • Newbie
  • *
  • Posts: 17
    • View Profile
SFML2 bugs
« Reply #5 on: March 31, 2010, 01:51:19 am »
Its been about 15 minutes since my last try and it still hasn't bounced yet. Its about as small as I could make it, but its still a solution with three projects (GUI, Wrapper DLL, and static library).  As such it adds up to about 430K. Sorry. At least I tried to document it as fully as possible.  :wink:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML2 bugs
« Reply #6 on: March 31, 2010, 08:45:04 am »
You can upload it on megaupload or similar websites. If you don't want other people to see it, you can send me the link by PM.
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML2 bugs
« Reply #7 on: April 05, 2010, 02:53:49 pm »
Hi

Sorry for the late reply.

I can't test your application, when I click on "Slide Show ..." I get a FileNotFoundException on the following line
Code: [Select]
Application.Run(new Form1());
It's probably just a path to setup, but I don't know which file is not found. The call stack stops on this line
Quote
System.Windows.Forms.dll!System.Windows.Forms.ToolStripItem.RaiseEvent(object key, System.EventArgs e) + 0x41 bytes   
Laurent Gomila - SFML developer