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

Pages: 1 2 3 [4]
46
Graphics / Draw on wxWidgets with double-Buffering
« on: March 26, 2008, 04:54:58 pm »
Hi
I want to draw on a control with SFML and wxWidgets(I need SFML there but I also have to draw primitives like lines, so I have to use the normal wxWidgets drawing, too).
It works fine as long as I use wxPaintDC, but when I use wxBufferedPaintDC I can't draw with sfml.
But I need double buffering? What shall I do?

47
Graphics / Delete sf::Image in destructor?
« on: March 26, 2008, 01:30:41 pm »
yes that's it. I found and simplified the problem.
The following Code works:
Code: [Select]

class A
  {
  public:
    sf::Image* test;
    A() : test(NULL)
      {
      test = new sf::Image();
      }
    ~A()
      {
      delete test;
      test = NULL;
      }
  };
int main()
  {
  boost::shared_ptr<A> a = boost::shared_ptr<A>(new A());
  }


This following does not!:
Code: [Select]

class A
  {
  public:
    sf::Image* test;
    A() : test(NULL)
      {
      test = new sf::Image();
      }
    ~A()
      {
      delete test;
      test = NULL;
      }
  };
boost::shared_ptr<A> a;
int main()
  {
  a = boost::shared_ptr<A>(new A());
  }


But it shouldn't be a problem because I only use global variables for testing so I have just to remove the test and implement the real code and it should work

48
Graphics / Delete sf::Image in destructor?
« on: March 26, 2008, 03:07:24 am »
It was just for testing purposes first I had a Smart Pointer.
The std::string was just to test if it is only with sf::Image or with every object and yes, it seems only to happen with sf::Images(I also added another image to test if I do any stuff with it)
But yes it doesn't happen in general, in another testing class I could delete it without problems.
But sf::image is still the only case, so it has to do something with it, I just don't know what.
So I asked if anybody knows one possible reason for this behaviour...
It's late, I'm tired please excuse my horrible english...

49
Graphics / Delete sf::Image in destructor?
« on: March 25, 2008, 11:04:53 pm »
Hi
I have an sf::image created with new in the constructorcode of my object.
For testing purposes I have created an std::string with new at the same location.
When I'm deleting the sf::image in the destructor I get an access violation(I'm not using this object in any place I just created and deleted it)
It's not a problem with my class, because I can delete the string without problems.
So how can I delete the sf::Image without an access violation?(I have the same problem with an Smart Pointer(boost::shared_ptr) or when not using a pointer at all.

50
Graphics / how do I use sf::Image::LoadFromMemory correctly?
« on: February 28, 2008, 07:01:31 pm »
I'm using LoadFromMemory, because I want to put more then one image in a file, this code was just a test, if I can get it working.
And your code works, but what's the keydifference between your code and mine?

51
Graphics / how do I use sf::Image::LoadFromMemory correctly?
« on: February 28, 2008, 05:35:14 pm »
I tried the following
Code: [Select]

  std::ifstream file("C:\\Main\\Tools\\RMXP\\RTP\\Graphics\\Tilesets\\001-Grassland01.png");
  int size = FileSize("C:\\Main\\Tools\\RMXP\\RTP\\Graphics\\Tilesets\\001-Grassland01.png");
  char* image = new char[size];
  file.get(image, size);
  sf::Image img;
  img.LoadFromMemory(image, size);

But it doesn't work (Image not of any known type or corrupt), the file is okay, so what do I have to do to load an image from Memory?

52
Graphics / Does the images need to have sizes, which are power of two
« on: February 26, 2008, 10:00:47 pm »
Hi
I think/hope the title is enough to understand my question.
And thanks :)

Pages: 1 2 3 [4]
anything