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

Pages: 1 ... 390 391 [392] 393 394
5866
Graphics / sf::WindowSettings access violation
« on: September 10, 2008, 07:26:03 pm »
I use a NVIDIA GeForce 6100 nForce 405. I updated its driver, but the result remains the same.

Some weeks ago, i had to reinstall windows on this computer. Before everything went perfectly, it's really strange... :roll:

5867
Graphics / sf::WindowSettings access violation
« on: September 10, 2008, 03:24:07 pm »
Now I reinstalled MSVC++ and downloaded the newest SFML svn version. Unfortunately, the problem further exists. I really don't know what I can do...

Isn't there anyone having similar problems? Is there certainly no bug or something in sf::WindowSettings or sf::RenderWindow?

P.S.: The error occurs both in static and dynamic link against SFML.

5868
Graphics / sf::WindowSettings access violation
« on: September 02, 2008, 10:38:58 pm »
Yes, in debug mode I link to:
sfml-window-s-d.lib sfml-system-s-d.lib sfml-graphics-s-d.lib

And in release to:
sfml-window-s.lib sfml-system-s.lib sfml-graphics-s.lib

The access violation occurs in both release and debug build. At debug only I get to the file where the error occurs...

But as I said, it's really strange, I'm not sure at all if it's a SFML problem because I haven't ever had this yet.

5869
Graphics / sf::WindowSettings access violation
« on: September 02, 2008, 08:59:57 pm »
Hi,
when I use the following code:
Code: [Select]
sf::WindowSettings Settings(24, 8, 4);
sf::RenderWindow App(sf::VideoMode(500, 300), "app", sf::Style::Close, Settings);
or
Code: [Select]
sf::RenderWindow App(sf::VideoMode(500, 300), "app", sf::Style::Close, sf::WindowSettings(24, 8, 4));, I get the following error:
Quote
Uncaught exception at 0x00000000 in Project.exe: 0xC0000005: Access violation.   (translated)

If I set the AntiAliasing value to zero, it works just fine. Every other value leads to crash.
When running in debug mode, it stops in file "WindowImplWin32.cpp" at line 450 (function WindowImplWin32::CreateContext()). The code in this line is:
Code: [Select]
bool  IsValid = wglChoosePixelFormatARB(myDeviceContext, IntAttributes, FloatAttributes, sizeof(Formats) / sizeof(*Formats), Formats, &NbFormats) != 0;The variable myDeviceContext seems to be corrupted, myHandle too. wglChoosePixelFormatARB shows the value 0 (0x00000000), IsValid is true...

The problem is, I reinstalled MSVC++ and redownloaded SFML some days ago - before everything worked fine. I also recompiled the SFML libraries, and I think I am linking to the correct version.

Maybe it's not SFML's fault, since it always worked in past... But I can't really imagine how this can happen...?

5870
Feature requests / C++ (And others too) aliases for functions
« on: August 22, 2008, 04:20:11 pm »
The current SFML naming convention pleases me. In my own code, I use exactly the same system. I hope you'll keep it forever, Laurent ;)

BTW: Those who want standard naming convention shall write a header with hundreds of #defines :D

5871
Feature requests / sf::String append function
« on: August 14, 2008, 06:18:40 pm »
Just use std::stringstream and its operator<< to append values of any elementar type.

5872
General / sf::Vector2i overloading operator <
« on: August 13, 2008, 05:39:35 pm »
Okay, thanks. Now I wrote an own functor, like this I don't have to intrude into namespace sf, either ;)

5873
General / sf::Vector2i overloading operator <
« on: August 13, 2008, 01:46:45 am »
"Meaningless" because normally, you don't compare mathematical vectors? So "meaningful" operations are more common (or defined), or what do you exactely mean?

5874
General / sf::Vector2i overloading operator <
« on: August 12, 2008, 01:10:48 pm »
But actually, I do not want to write own vector classes which derive from sf::Vector2i... I mean the sf::Vector is okay, I just need to overload operator <.

And about modding SFML: My intention is not to change the code in the SFML source or header files; if I needed something in namespace sf, I would write it in my own project (inside a local namespace sf block).

Quote from: "Laurent"
It should work without putting the operator in sf namespace. What exactly are the "many errors" ?

I get errors because std::map is trying to use std::operator < instead of my version:
Quote
1>c:\program files\microsoft visual studio 9.0\vc\include\functional(143) : error C2784: "bool std::operator <(const std::basic_string<_Elem,_Traits,_Alloc> &,const _Elem *)": template-Argument für "const std::basic_string<_Elem,_Traits,_Alloc> &" konnte nicht von "const sf::Vector2i" hergeleitet werden.
1>        c:\program files\microsoft visual studio 9.0\vc\include\string(150): Siehe Deklaration von 'std::operator <'
1>        c:\program files\microsoft visual studio 9.0\vc\include\functional(142): Bei der Kompilierung der  Klassen-template der bool std::less<_Ty>::operator ()(const _Ty &,const _Ty &) const-Memberfunktion
1>        with
1>        [
1>            _Ty=sf::Vector2i
1>        ]


Quote from: "Laurent"
Plus, you don't really need to define a < operator, you can instead provide a functor as an extra parameter of your std::map. In this case I think it would be more appropriate, as your definition of operator < for vectors is not obvious (actually, vectors are not comparable in pure maths). It's just something that works.

I thought about creating an own functor, too, but if there is already the std::less criterion which has the same function, why shouldn't I use it and create an overloaded operator?
But yes, you're right, comparing too vectors doesn't make too much sense. In don't really need to compare them except for the automatic sort inside std::map.

5875
General / sf::Vector2i overloading operator <
« on: August 11, 2008, 02:04:04 pm »
Hi,
I need to overload operator < for the sf::Vector2i struct because I use a std::map with it as a key value, and for the intern sort criterion I use std::less which requires operator <. Now I tried the following:
Code: [Select]
bool operator <(sf::Vector2i Left, sf::Vector2i Right)
{

if (Left.x != Right.x)
return (Left.x < Right.x);
else
return (Left.y < Right.y);
}


There are many errors. So I placed it into namespace sf:
Code: [Select]
namespace sf
{
bool operator <(sf::Vector2i Left, sf::Vector2i Right)
{

if (Left.x != Right.x)
return (Left.x < Right.x);
else
return (Left.y < Right.y);
}
}

which works.

Now I have doubts if this is the good way to solve it. Doesn't it matter if I expand the sf-namespace myself?

5876
General / New SVN Version
« on: August 01, 2008, 06:05:02 pm »
Yes, I can completely understand that. I think it's quite normal to write working code first, and care about things like name consistency later.
I just didnt know, maybe there could have been a special reason for those identifiers. :)

5877
Feature requests / sf::Clock Improvement
« on: August 01, 2008, 06:00:44 pm »
Quote from: "MadMartin"
BTW: Bist du der Nexus, der im Forum von c-plusplus.de unterwegs ist?

Genau der ;)

5878
General / New SVN Version
« on: August 01, 2008, 03:07:16 pm »
Quote from: "Laurent"
Cleaning all this stuff is my next task, actually ;)

Oh, so there wasn't any intention behind those names? :P

5879
General / New SVN Version
« on: August 01, 2008, 02:47:10 pm »
Concerning the inconsistences, I found some points:

sf::Sprite:
- the method to get the size on the screen is GetSize().

sf::String:
- the method to get the rectangle (and the size about it) is GetRect().
- but GetSize() returns the font size.

I think this is a little bit confusing. For me, both classes are quite similar, so why once using a Rectangle and once a 2D-Vector?
And another thing is the base class sf::Drawable. I think, there is no GetSize() method because of inherited sf::Shape and sf::PostFX, right? I don't use those 2 classes often, but don't they require a size? If yes, would make polymorphism easier (for example you don't have to overload specific functions for sf::Sprite and sf::String)...

And what I is also not really consistent, is GetSize() vs. GetWidth() or GetHeight() methods. For example Sprites use GetSize().x or GetSize().y, and the "greater" classes like sf::Image or sf::RenderWindow use GetWidth() or GetHeight(). And why did you implement sf::View::GetHalfSize()? Is that for people who don't want to write sf::View::GetRect()::GetWidth()/2? :)  Or because of 2D-Vector (now there's again the question why a Rectangle with 2 specific size methods).

What's the reason for these things? They might follow a simple logic, but at the moment I don't really see it ;)

5880
Feature requests / sf::Clock Improvement
« on: August 01, 2008, 02:09:59 pm »
The standard header <ctime> provides some useful time functions, too.

Pages: 1 ... 390 391 [392] 393 394
anything