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

Pages: 1 2 [3] 4
Feature requests / Manually setting Z-order
« on: October 06, 2010, 08:29:53 pm »
My code is not fully optimize because as you say, using dichotomy is faster. However, my solution should be optimal enough and is very easy to code. Furthermore, when using dichotomie, you may not want to use a list anymore because accessing elements without an iterator is much slower.
With list, I don't know which one is quickest.
However, if you use vector, it migth be worse because of moving all the elements.
There might be a better container and it depends on the uses but it would be best if you could compare performance.
I'm using this method in my game and I have No problems since I insert/change z-order quite rarely.

General / Better way of enemy-list
« on: October 05, 2010, 08:50:38 pm »
if you are going to delete/add enemies very often and you almost never get them through there index (0,1,2,3,...), use a std::list. However, I do not think it should improve performance so much.

Feature requests / Manually setting Z-order
« on: October 05, 2010, 08:47:04 pm »
Personnaly, I don't use std::sort or std:::lists::sort.
Since elements are always inserted/changed z-order/... less than once per frame, the best performance solution is :
-each_time you add an element, you put it in the right place (insertion).
-each time you change an element's Z-order, you put it in the right place.

=>Your elements are always sorted even if you never sort them all

=> you can delete a Drawable without sorting anything.
=>You only use a bit of performance when you add/change a element.
=> to draw, just create an iterator and draw them all.

Pseudo code :

Code: [Select]
Class::inset_new(Drawable*d, unsigned plan)
    std::list<std::pair<Drawable*, unsigned int> >::iterator it;

I let you guess the slution for changing Z-order.
This code is Pseudo code because I will not assure it will work (didn't check nor reread myself).

General discussions / Retro compatibility
« on: October 05, 2010, 06:19:41 pm »
You may also use the SVN version of SFML 2, such that you are able to keep the code constantly up-to-date.

I'm having enough trouble finishing my project with 1.6 to keep another version up to date with 2.0
I just wanted to have an idea to know where I might have problems and try to find a solution that wouldn't be to diffulcut to adapt for 2.0.
I've heard that rendering might be different in respect of OPENGL functions when displaying drwables. How much ? would it effect basic functions like GlClipPlane ?

I do not have any problems with naming changes, minor changes that just take a bit of search/replace to adapt.
However, I would like not to have to change a major part just because some things like threads don't exist (which would be quite unlickly : this is just an example).

Window / SFML interferes with SETCursor(win32 func)
« on: October 04, 2010, 08:05:54 pm »
extract from : msdn

Your application can change the design of the cursor by using the SetCursor function and specifying a different cursor handle. However, when the cursor moves, the system redraws the class cursor at the new location. To prevent the class cursor from being redrawn, you must process the WM_SETCURSOR message. Each time the cursor moves and mouse input is not captured, the system sends this message to the window in which the cursor is moving.

And when the crusor is redrawn, it is the arrow that is redrawn (found that somewhere else on msdn but having trouble finding it).

this link explains what I was saying.

Furthermore, I couldn't find a similar function for linux. Has someone got any Idea ?

Window / SFML interferes with SETCursor(win32 func)
« on: October 04, 2010, 07:26:46 pm »
Found a solution but i'm not completely satisfied.
So, here is the solution :
Code: [Select]

window_handle=FindWindow(NULL,TEXT("SFML Window"));


Code: [Select]
     case Cursor::WAIT :
           c=LoadCursor(NULL, IDC_WAIT);
     case Cursor::HAND :
           c=LoadCursor(NULL, IDC_HAND);
     case Cursor::NORMAL :
            c=LoadCursor(NULL, IDC_ARROW);
      case Cursor::TEXT_EDIT :
            c=LoadCursor(NULL, IDC_IBEAM);
   std::cout<<"no cursor";
   SetClassLong(window_handle, GCL_HCURSOR, (LONG)c);

However, I do not like the way a get the window handle. Is there a better way ?
Can I do something similar with linux (if so, please lead me in the right direction)?

General discussions / Dealing with English and French languages
« on: October 03, 2010, 05:01:06 pm »
Should I translate the different topics I've posted in the english forum into french ?

Graphics / sf::String and size errors
« on: October 03, 2010, 04:59:17 pm »
How can I get the characters included in the Font file ?
Is there an option for charset=AllAvailableCharacters ?

Will there be a solution in 2.0 (it would be nice)?

Yes Smile

I'm very glad to here that. Nice (futur ?) job !

In fact it should be ok with GetSize(), I'll do some tests to see what's wrong.

Ok. Perfect.

I must say, you are doing a great job answering all those questions. Wouldn't think you would answer so much with CAMP and SFML as projects...

[EDIT] Does it take more memory to Load the whole charset (I guess the answer is yes). More time printing (accessing to the Sprties is longer) ?

Graphics / sf::String and size errors
« on: October 03, 2010, 04:43:30 pm »
This information depends on the font's metrics, and I don't think that you can retrieve the relevant values in SFML 1.

Will there be a solution in 2.0 (it would be nice)?

I don't really understand the idea of font metric's. Could you give me a clue of how to calculate the cursor's position ?

You need to check its Unicode code, and if it's not in range [0, 255] then you won't be able to display it with the default font.

Thanks, i'm dealing with Unicode strings, however i was using default font...
How can I know which font supports which characters ?

I'm using sf::String::GetSize() (i'm in 1.6 so no sf::Text::GetSize()).

General discussions / Dealing with English and French languages
« on: October 03, 2010, 04:39:34 pm »
Hi, personaly, I can speak english sufficiently well to write/understand what happens on the french and english forums. However, each time I write a new topic, I wonder if a should post it on the french, english or both forums.
Would it be possible to have an option saying "link these two subjects" which would say to any user who went on it :

"There is an equivalent subject on the French forum, please visit it if you want to see all the arguments." with a link to the French subject.

This would make it possible to know wether we are missing arguments.
Furthermore, for the project and source-code part of the wiki, I think they should be shown in both wikis because projects and source-code can be understood even if the language isn't the right one.

Thank you, please give me your opinions.

General discussions / Retro compatibility
« on: October 03, 2010, 04:29:25 pm »
Ok, thanks its just i'm doing a project on 1.6 and I want to be sure not to have to much problems when going to 2.0.

Graphics / sf::String and size errors
« on: October 03, 2010, 04:27:46 pm »
I can assure you (for I've just tried with Block note) that the cursor goes under the base line. The question is, by how much ?
Does somebody know why I can't display a € symbol with the default font ?
Thank you.

General discussions / Retro compatibility
« on: October 03, 2010, 03:49:44 pm »
Thanks for this little summary, I wonder why Rect changed, I always hated width/height Rects... If anybody has more information, please add...

Graphics / sf::String and size errors
« on: October 03, 2010, 03:47:15 pm »
If you look at the following Image, you will notice that the | seems to high compared to the j.

Window / SFML interferes with SETCursor(win32 func)
« on: October 03, 2010, 02:48:50 pm »
Hi, I've decided to use directly windows to deal with Cursors by doing this :

Code: [Select]
      std::cout<<"no cursor";

However, it works fine until an event (Keypress and Textentered don't cause any problem) is emitted. My question : How can I keep my cursor the way it is without having SFML changing it back just after ?

Thank you.

[EDIT] Found the problem : when a WM_SETCURSOR event is emitted, I must return true. However, this can't work because SFML hides the window events. Is there a way to make it so that SFML return true ?.

Pages: 1 2 [3] 4