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

Pages: [1] 2
1
General discussions / Possible changes in the audio API
« on: February 26, 2012, 05:02:25 pm »
Quote from: "Laurent"
It's too high-level, and very specific. However I'll try to provide more tools so that writing such a class doesn't require hacking into SFML sources.

Well I think it does definitely make sense to have such a functionality, though not necessarily as part of the SFML base package. What I would love most is that Laurent finds a way so that Soundfile can be accessed from outside without having to modify SFML base sources and have Tex Killer's class available as an optional download (from the wiki for example) that simple can be dropped into the project, sort if like an extension.

2
General / VisualStudio and STL debug settings
« on: February 24, 2012, 10:52:36 am »
Ok, thanks!
I probably adapt my makefiles then, setting these flags to 0 in both debug and release mode, in order to use ASSIMP.

3
General / VisualStudio and STL debug settings
« on: February 24, 2012, 10:42:19 am »
While trying to install and integrate Assimp with SFML, I stumbled upon this post concerning STL in recent Microsoft compilers and that the debug checks are apparently also active in release mode:
http://assimp.sourceforge.net/lib_html/install.html

Quote
In VC8 and VC9 Microsoft has introduced some STL debugging features. A good example are improved iterator checks and various useful debug checks. Actually they are really helpful for debugging, but they're extremely slow. They're so extremely slow that they can make the STL up to 100 times slower (imagine a std::vector<T>::operator[] performing 3 or 4 single checks! scary ...).
These security enhancements are - thanks MS! - also active in release builds, rendering ASSIMP several times slower. However, it is possible to disable them by defining
_HAS_ITERATOR_DEBUGGING=0
_SECURE_SCL=0
in the preprocessor options (or alternatively in the source code, just before the STL is included for the first time).
If you're linking statically against ASSIMP: Make sure your applications uses the same STl settings! If you do not, there are two binary incompatible STL versions mangled together and you'll crash.


And here is some information from Microsoft about this:
http://connect.microsoft.com/VisualStudio/feedback/details/524141/serious-bug-when-using-secure-scl-0-c
Quote
When changing _SECURE_SCL from its default setting, certain rules need to be followed. These rules are logical consequences of the fact that _SECURE_SCL changes the representations (including the sizes) of STL objects.

The first rule is that _SECURE_SCL must be consistently set throughout each translation unit (a translation unit is a source file and all of its included header files, which is compiled into an object file). That is, _SECURE_SCL can't be changed in the middle of a translation unit. The easiest way to follow this rule is by defining _SECURE_SCL on the command line (or in your project settings) instead of in source files/header files. (This rule is being followed by your case; I mention it for completeness.)

The second rule is that _SECURE_SCL must be consistently set in all of the object files that are linked into a single binary (EXE or DLL). Mismatch will be not detected by the VC8/VC9 linker, and will cause incomprehensible crashes. (In technical terms, _SECURE_SCL mismatch is a One Definition Rule violation.)
The second rule applies to static libraries (which are simply packages of object files).


Question: does this affect SFML in any way? I suspect if I link the standard ASSIMP library (which was compiled with both flags set to 0), it will crash with the SFML libraries as they were compiled with these flags set to their default settings of 1. Anyone already has experience with this?

4
Graphics / Question: Current State of Graphics API
« on: February 24, 2012, 09:27:04 am »
Yes, as Laurent recommended, for a particle system, you are better off using a vertex array (if all particles use the same texture, or rather use a part of the same texture, as of course texture coordinates are still possible).

On a side note, I wrote a very simple sprite batcher, which is nothing but an extended vertex array drawable class that has the option of adding a sprite's vertices (using pre-transformation, so including the sprite's scale and rotation) to its internal buffer and only drawing it once after all sprites have been added. It works something like this:

Code: [Select]

sf::Sprite s;

// normal method, 1000 OpenGL draw calls
for (int i=0;i<1000;i++)
{
 s.SetPosition(i,i);
 window.draw(s);
}

// using sprite buffer, 1 OpenGL draw call
SpriteBuffer sb;
for (int i=0;i<1000;i++)
{
 s.SetPosition(i,i);
 sb.addSprite(s);
}
window.draw(sb);


This can also be extended to use any drawables, not only sprites, but
a little bit of code modification is necessary as most SFML classes don't allow accessing their vertices for reading (private member).
I also wrote a sprite batcher as a class derived from sf::RenderTarget, but did not really need that in my projects right now.

5
Window / SFML OpenGL lib glut.h problem
« on: February 15, 2012, 12:57:59 pm »
It seems you aren't linking to "glut32.lib" ?

6
General / Make collision detection run more frequently than drawing
« on: February 13, 2012, 07:00:53 pm »
This page should have all information you need:
http://www.koonsolo.com/news/dewitters-gameloop/

7
General / 3 keys ok, but 4 halts the input. Why? (Solved)
« on: January 31, 2012, 11:56:39 am »
Yes, this is a well known hardware based problem, depending on your keyboard. Some keyboards allow no more than 2 keys to be pressed at once, some even more than 4.
But also the allowed keys to be pressed simultaneously differ, like it could be that "A" and "S" are detected, but not "A" and "D".

I think there was a nice explanation for it on the FretsOnFire open source game, can't find the link at the moment though...

8
General / Creating an ImageManager class
« on: January 26, 2012, 10:36:58 pm »
there are also several resource and image managers on the wiki/projects section of this site that you might check for reference .

9
Graphics / Dragging Sprite outside original position
« on: January 26, 2012, 07:37:26 pm »
Quote from: "LucasShadow"
Thanks man. That fixed it :)

Edit:  So how would I do the following as well?
Quote
Another problem I am having is figuring out how to make it so that, if the mouse button is down and then the cursor is rolled over the sprite, it moves it. Is there a way to make it so that that doesnt happen? So that if Sprite1 is being dragged over Sprite2, then Sprite2 is also not dragged along with Sprite1.

I don't know what you mean exactly. Your example only contains one sprite and since you change the position of a specific sprite, others shouldn't be affected.

10
General / SFML Asteroids help
« on: January 26, 2012, 02:36:47 pm »
You might check these links/sourcecodes for some *ideas*:

http://code.google.com/p/speedprogramming/downloads/list
http://www.hobbygamedev.com/articles/vol9/programming-asteroids/
http://www.codeproject.com/Articles/2086/Grausteroids-an-Asteroids-game-using-DirectX-and-C
It is not that hard, but you probably need a bit more programming experience first.

11
Graphics / Dragging Sprite outside original position
« on: January 26, 2012, 10:36:06 am »
Code: [Select]

     float XPosSprite = SpriteObj.GetPosition().x;//the x position of the panel
     float YPosSprite = SpriteObj.GetPosition().y;//the y position of the panel
     float XSizeSprite = SpriteObj.GetSize().x;//the width of the panel
     float YSizeSprite = SpriteObj.GetSize().y;//the height of the panel

You have to put those in your main loop as you are constantly changing the position of SpriteObj!

12
General discussions / New naming convention
« on: January 23, 2012, 02:00:25 pm »
Quote from: "BMB"
Quote from: "Laurent"

Quote
Maybe you should commit the changes, update the documentation, and wait a little while? Or you could even think about a beta release, which would look like the real release, except it would have the beta tag attached to it, along with a warning that things might still change. I really think it is important to get this one right.

I don't think people need a release to know which naming convention they prefer. They can write a sample code themselves if they really need to see it in action.
And I don't want to commit this modification until I'm 100% sure that it's the final one. Imagine people who start to convert all their code, and suddenly I go back to the original naming convention... ;)

Myself, I have not tested any changes committed since this discussion started, since I feel it is silly to check out and use a new version, just to have my code break. I am waiting for this naming change to be committed before I do another pull and use the latest source. I assume I am not alone in this. This seems to me to be a good reson to do a commit, even if you are only 95% sure.

Yeah, right. Go, Laurent, go! We want SFML2! :-)

13
General / SFML 2.0 - CPU/GPU utilization behavior
« on: January 23, 2012, 01:19:07 pm »
Very strange!
Could be that something is not cached in the GPU or driver, so that the CPU has to send the data again and again. And maybe after some misses the driver decides to activate/increase the cache. Just guessing though :)

As Laurent said, I hardly think this is SFMLs fault, but probably the driver from the graphic card or something else on your system. Have you updated to the latest driver version?

14
Feature requests / sf::XML
« on: January 23, 2012, 01:10:50 pm »
Quote from: "TheEnigmist"
What is the best for C++? :D

As already said above: tinyxml and pugixml both work really well for C++ and are easy to integrate in a project, but pugixml is a bit more forgiving conerning malformed xml syntax.

15
Graphics / Manage dynamic sprites on screen
« on: January 21, 2012, 07:26:18 pm »
Quote from: "TheEnigmist"

PS: i've just compiled new SFML 2.0 and now i don't know how can i manage FPS, i see that GetFrameTime is no more a Window member function.

Check here:
http://sfml-dev.org/forum/viewtopic.php?t=6831

Pages: [1] 2
anything