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.


Messages - fazeli

Pages: [1]
1
Graphics / sf::RenderWindow::Clear() causing Unhandled exception
« on: April 30, 2010, 06:52:57 pm »
Thanks for the info Laurent and the help and suggestions nulloid.  Just one further question Laurent, is it normal for those experiencing the problem to have it work out when using the -d.libs?

2
Graphics / sf::RenderWindow::Clear() causing Unhandled exception
« on: April 29, 2010, 12:27:20 am »
Didn't seem to add any information for me, although it could hit me in the face and I might still not know.  Here's the information that I received.

Message from application as it was running.

Quote
Unhandled exception at 0x0042f835 in SFML_GraphicsWindow.exe: 0xC0000005: Access violation reading location 0x43960010.


Code: [Select]

(circled yellow arrow) SFML_GraphicsWindow.exe!sf::RenderTarget::Clear()  + 0x5 bytes C++
(green arrow) SFML_GraphicsWindow.exe!main()  Line 41 C++
  SFML_GraphicsWindow.exe!__tmainCRTStartup()  Line 597 + 0x19 bytes C
  SFML_GraphicsWindow.exe!mainCRTStartup()  Line 414 C
  kernel32.dll!7c817077()
  [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]


Disassembly window reads
Code: [Select]

// Clear the screen with red color
        App.Clear(sf::Color(0, 255, 0));
(red arrow) 0042E6B6  push        0FFh
0042E6BB  push        0    
0042E6BD  push        0FFh
0042E6C2  push        0    
0042E6C4  lea         ecx,[ebp-458h]
0042E6CA  call        sf::Color::Color (42B12Ch)
0042E6CF  push        eax  
0042E6D0  lea         ecx,[ebp-84h]
0042E6D6  call        sf::RenderTarget::Clear (42B2D5h)

        // Display window contents on screen
App.Display();
(green arrow) 0042E6DB  lea         ecx,[ebp-314h]
0042E6E1  call        sf::Window::Display (42B762h)


Thanks for the help thusfar but it's not too important for me right now if this is an error that can't be reproduced, as I am content with using the -s-d.libs as I learn.

3
Graphics / sf::RenderWindow::Clear() causing Unhandled exception
« on: April 28, 2010, 11:49:48 pm »
Sounds like a plan to me and has the added benefit that I don't have to read on how the MS VS 2005 debugger works!

4
Graphics / sf::RenderWindow::Clear() causing Unhandled exception
« on: April 28, 2010, 11:12:57 pm »
I'm sure the code originally posted without proper formatting didn't help the matter.

I haven't leaned the proper use of the debugger yet but here's my Call Stack when the -s-d.lib were changed back to -s.lib

Code: [Select]

 (yellow arrow)   SFML_GraphicsWindow.exe!sf::RenderTarget::Clear()  + 0x5 bytes C++
 (green arrow)  > SFML_GraphicsWindow.exe!main()  Line 41 C++
SFML_GraphicsWindow.exe!__tmainCRTStartup()  Line 597 + 0x19 bytes C
                SFML_GraphicsWindow.exe!mainCRTStartup()  Line 414 C
                kernel32.dll!7c817077()
                [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]

5
Graphics / sf::RenderWindow::Clear() causing Unhandled exception
« on: April 27, 2010, 05:41:20 pm »
Code: [Select]
#include <SFML/Graphics.hpp>

int main() {

    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");

    while (App.IsOpened()) {
        sf::Event Event;
        while (App.GetEvent(Event)) {
            if (Event.Type == sf::Event::Closed)
                App.Close();
            if (Event.Type == sf::Event::KeyPressed) {
                if (Event.Key.Code == sf::Key::Escape)
                    App.Close();

                if (Event.Key.Code == sf::Key::F1) {
                    sf::Image Screen = App.Capture();
                    Screen.SaveToFile("screenshot.jpg");
                }
            }
        }

        App.Clear(sf::Color(200, 0, 0));
        App.Display();
    }

    return EXIT_SUCCESS;
}


Thank you for all the suggestions!  The code tags were most helpful.  I'll hunt down the statements about the order of the libs, but I had thought that the order likely wouldn't matter because of #ifdefs and#defines but I'll double check.

I had thought that sf::RenderWindow::isOpened() would check if the render window had been created successfully but I'll read about that in the documentation.  I was also confident that it was being created successfully (as well as opened and all that) because the "Unhandled Exception" problem did not occur when sf::RenderWindow::Clear() was commented out and the code executed as described.

6
Graphics / sf::RenderWindow::Clear() causing Unhandled exception
« on: April 27, 2010, 02:50:31 am »
Could you please elaborate on what you mean by "set your project for release"?  I'm very new to MSVS, so please overlook my ignorance.

7
Graphics / sf::RenderWindow::Clear() causing Unhandled exception
« on: April 27, 2010, 01:59:26 am »
-s = static, which as I understand it means the dlls do not have to be copied to current executable directory nor do they need to be renamed.  those libs without the -s mean dynamic in which case you have to copy the dll to the current directory (my understanding maybe incorrect) but I believe I read it in http://www.sfml-dev.org/tutorials/1.6/start-vc.php

yea the paste that I did resulted in poorly readable code, but I figured it was short enough that there was no need to repaste.

8
Graphics / sf::RenderWindow::Clear() causing Unhandled exception
« on: April 27, 2010, 12:17:49 am »
Sorry my bad.  The code that was being used is the same as the one in the tutorial in this file http://sfml-dev.org/tutorials/1.6/sources/graphics-window.cpp.  I have included a copy here below stripped of comments.

#include <SFML/Graphics.hpp>

int main() {
   sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");

   while (App.IsOpened()) {
      sf::Event Event;
      while (App.GetEvent(Event)) {
         if (Event.Type == sf::Event::Closed)
            App.Close();

         if (Event.Type == sf::Event::KeyPressed) {
            if (Event.Key.Code == sf::Key::Escape)
               App.Close();

            if (Event.Key.Code == sf::Key::F1) {
               sf::Image Screen = App.Capture();
               Screen.SaveToFile("screenshot.jpg");
            }
         }
      }

      App.Clear(sf::Color(200, 0, 0));

      App.Display();
   }

   return EXIT_SUCCESS;
}

Additional Information.
I've linked the following files: sfml-system-s.lib  sfml-graphics-s.lib sfml-window-s.lib

There are no additional .dll in the directory that the file is being executed in as I don't believe I need as I am using the static libraries.

Newly discovered.  Oddly enough when I link to sfml the static-debug versions of the libraries files, the code runs properly.  However, compiling results in many warnings similar to the following.

1>sfml-system-s-d.lib(Platform.obj) : warning LNK4099: PDB 'vc80.pdb' was not found with 'C:\SFML-1.6\lib\sfml-system-s-d.lib' or at 'c:\Documents and Settings\user\My Documents\Visual Studio 2005\Projects\SFML_GraphicsWindow\debug\vc80.pdb'; linking object as if no debug info

9
Graphics / sf::RenderWindow::Clear() causing Unhandled exception
« on: April 26, 2010, 10:44:06 pm »
(Complete beginner)

Trying to go through the tutorials, stuck on "Graphics - Using render windows" (http://sfml-dev.org/tutorials/1.6/graphics-window.php).  It seems the App.Clear() and App.Clear(sf::Color(200, 0, 0)) are both causing

First-chance exception at 0x00434155 in SFML_GraphicsWindow.exe: 0xC0000005: Access violation reading location 0x43960010.
Unhandled exception at 0x00434155 in SFML_GraphicsWindow.exe: 0xC0000005: Access violation reading location 0x43960010.

After commenting out the App.Clear sections, the code runs without exception.

I've tried going through the source with the debugger but as I mentioned I am a beginner.

Any suggestions would be greatly appreciated.  Thank you.

Pages: [1]