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 - ganondorf5

Pages: [1]
1
Graphics / Re: Load from file leads to buffer-overflow
« on: October 14, 2017, 04:19:33 pm »
Hi, have you the correct path for the texture? Also ".jpeg" may be is ".jpg"
Hi, I've tried those three extensions : png, jpg, jpeg and the result is the same, so I don't think it comes from here...

What does it mean RAM is displayed in the console? Can you show a screenshot?
It means that my console prints some values (in attachment) that must be in my RAM. After a little time, an exception is raised which says that there is a read access violation at the location 0x00BD2000.
So, I think that the function prints my RAM's content in the consol and when it exceed its memory space, there is a buffer overflow and the system raise an exception.

You're mixing release and debug modes, see also: https://www.sfml-dev.org/faq.php#tr-vs-crash
Following you're advice I've unlinked the release libs from my project and it works !

I was thinking that had to link the release and the debug libs in the same time ...
Thank you ! I hope that my mistake will be helpful !

2
Graphics / Load from file leads to buffer-overflow
« on: October 14, 2017, 02:10:26 pm »
Hi,

I just try to display a picture with Texture::loadFromFile, but every time I run the program it fails and it seems that my RAM's content is displayed in the consol just after "Failed to load image "". I have left the quotation mark cause the content is displayed just after a quotation mark ! But it's normally the error that is shown between the quotation marks isn't it ?
For the file, I've tried differents images and formats like PNG, JPG, JPEG ...

I'm on Visual Studio 2015 32bits, with the corresponding sfml version, in WINDOW mode and my image file is in the right place (with the .cpp files and in many other places).

Here is my code :
Quote
#include <iostream>
#include <SFML\Graphics.hpp>

using namespace std;
using namespace sf;

int main()
{

   RenderWindow app(VideoMode(800, 600, 32), "My window", Style::Titlebar | Style::Resize | Style::Close);
   app.setVerticalSyncEnabled(true);

   CircleShape shape(100.f);
   shape.setFillColor(Color::Green);

   Texture texture;
   if (!texture.loadFromFile("test.jpeg"))
   {
      cerr << "Error" << endl;
      return EXIT_FAILURE;
   }

   while (app.isOpen())
   {
      Event event;

      while (app.pollEvent(event))
      {
         if (event.type == Event::Closed)
            app.close();
      }

      app.clear();
      app.draw(shape);
      app.display();
   }

   return EXIT_SUCCESS;
}

What's wrong ??

Thanks !

Pages: [1]
anything