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

Author Topic: Window title / window creation, deletion  (Read 2254 times)

0 Members and 1 Guest are viewing this topic.

transient

  • Newbie
  • *
  • Posts: 2
    • View Profile
Window title / window creation, deletion
« on: August 21, 2009, 08:14:37 pm »
I have a few quick questions about windows:

I'm creating a window as such.
Code: [Select]

// Create the window settings
sf::WindowSettings settings;
settings.DepthBits = 32;
settings.StencilBits = 8;
settings.AntialiasingLevel = 2;

// Create the window
sf::Window* window = (new sf::Window(sf::VideoMode(dim.x, dim.y, 32), "abc", sf::Style::Close | sf::Style::Titlebar | sf::Style::Resize, settings));


Now, the title of the window ends up being something like this "LLLLabc" (a weird ascii L though.)

Also, when I call

Code: [Select]

delete window;


I get a memory error.

Any ideas why?  Thanks

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Window title / window creation, deletion
« Reply #1 on: August 22, 2009, 12:32:48 am »
Quote from: "transient"
I have a few quick questions about windows:

I'm creating a window as such.
Code: [Select]

// Create the window settings
sf::WindowSettings settings;
settings.DepthBits = 32;
settings.StencilBits = 8;
settings.AntialiasingLevel = 2;

// Create the window
sf::Window* window = (new sf::Window(sf::VideoMode(dim.x, dim.y, 32), "abc", sf::Style::Close | sf::Style::Titlebar | sf::Style::Resize, settings));


Now, the title of the window ends up being something like this "LLLLabc" (a weird ascii L though.)


 :arrow: http://www.sfml-dev.org/forum/viewtopic.php?t=1257&highlight=title

Quote from: "transient"
Also, when I call

Code: [Select]

delete window;


I get a memory error.

Any ideas why?  Thanks
Because you delete your window in the wrong way : I mean you use it afterwards.
But with a minimal code that reproduce the error we could say more than an hypothetical cause.
SFML / OS X developer

transient

  • Newbie
  • *
  • Posts: 2
    • View Profile
Window title / window creation, deletion
« Reply #2 on: August 22, 2009, 07:08:20 am »
Linking to release libraries while compiling in debug mode isn't always the smartest idea...

Thanks.

(Also, I was not using the window after I deleted it, but that is of minimal consequence now.  Also, I thought I gave just enough code to reproduce the issue.  To each their own.)

 

anything