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

Pages: 1 ... 5 6 [7] 8 9
Graphics / sf::Image complains about "pure virtual function call&a
« on: March 01, 2009, 06:37:20 am »
I had that problem once, it's usually when an Image is invalid or something.  (for me it happened when I moved from loading an Image directly and then through a reference returned by a resource manager).  

Are you sure the LoadFromFile does not return false? (IE the image exists)?
Maybe its a directory issue? (what IDE are you using?)

General / How does SFML link to the CRT (in Visual Studio)?
« on: February 28, 2009, 02:05:50 am »
Well I'm trying to limit the use of DLLs.  At first it wasn't an issue with just the MSVC++ DLL files, but now that I am trying to use frifron's Spark Particle lib, I can't link the library statically for some reason.  I think its because of this dynamic over static linking thing (when I try to link it statically it expects everything to be linked statically and vice versa).  At least that's my take on the issue (I've spent a good week or two trying to get it set up; I thought it would be as simple as the SFML set up.  It wasn't.  Boost seemed to have a slightly different way of linking as well). Either way I only got SPARK working when linked dynamically and when I linked SPARK dynamically it expected SFML to also be linked dynamically.  So it seems that if I want to continue using Visual Studio I have to make everything dynamic.  Now I don't know the specifics of dynamic vs static (all I know is dynamic splits it into dlls while static puts everything into the exe thus making the exe larger) but I seem to like static linking better (as I'm only dealing with one exe file).  

The reason I mentioned code::blocks is code::blocks doesn't require any DLLs to be added...does it?  Could I statically link everything more easily with Code::Blocks (or dev C++, etc, just not Visual Studio)? Or how do I make my program not dependent on MSVC++ dlls?  

My ultimate plan is once I get my project working on Windows to move it over to linux.

EDIT:  Phew, after writing this post, it got me thinking.  Instead of recompiling SFML could I recompile SPARK?  Sure enough one of the static libs linked to the CRT statically.  The rest of the static libs seemed to link dynamically.  So that solves my problem finally.  

My question about code::blocks and/or removing the dll dependency using visual studio still stands, for curiosity's sake.

General / How does SFML link to the CRT (in Visual Studio)?
« on: February 28, 2009, 12:16:32 am »

would manually building SFML (under MT and not MD settings fix this?)

General / How does SFML link to the CRT (in Visual Studio)?
« on: February 27, 2009, 04:33:40 am »
Ok, so I'm trying to limit the number of dlls my exe uses (I for some reason prefer static linking over dynamic linking).  Also I want to use the SPARK particle library thing and it won't link statically.  If I link the SPARK library dynamically, it asks for SFML to also be linked dynamically.  I then realized that maybe the problem was a /MT vs /MD thing.  However, when I compile with the /MT I get a bunch of "already defined" linker errors.  I now use /nodefaultlib and then I get over 9000 linker errors (well like 81).  They all say stuff like:
Code: [Select]

Error 1 error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Mutex::_Lock(void)" (__imp_?_Lock@_Mutex@std@@QAEXXZ) sfml-window-s.lib blank

now my question is, in Visual Studio, does SFML link against the dynamic CRT, even as a static library?  How can I fix this error?  What libraries do I need when I use /nodefault lib?  I know this is more of a visual studio question, but any help would be greatly appreciated.  

On another note, how is Code::Blocks?  If I cannot remedy this situation, I wouldn't mind using Code::Blocks, I just have a few questions:
What are Code::Blocks' dependencies?
If it's not like VC++ (as it has the "visual" part removed) does it create leaner, faster programs?
I'm sure that if I use Code::Blocks it would make my project more easily cross platform.  

Anyway I've been struggling with this static CRT vs Dynamic thing forever and just want to get to work on my game...

Window / Problem with IsKeyDown() allthough IsMouseButtonDown() works
« on: February 27, 2009, 02:52:04 am »
It's all good, that's what the forums are for ^_^.  I'm fairly new to SFML and C++ too so I know what its like to be frustrated.  

Anyway, glad the problem is fixed and good luck on your project!

Window / Problem with IsKeyDown() allthough IsMouseButtonDown() works
« on: February 27, 2009, 02:27:37 am »
Now I'm new to SFML too, but I'm having trouble understanding your code...

what are you trying to do? (not trying to sound mean), it seems the code will only fire if the left or right mouse button are pressed; if the mouse buttons (not middle) are not pressed, the function returns false.  are you trying to click and press a button?

Code: [Select]

   if(!Win->GetInput().IsMouseButtonDown(sf::Mouse::Left) && !Win->GetInput().IsMouseButtonDown(sf::Mouse::Right))
      mx0 = mx;
      my0 = my;
      return false;//will return if left and right mouse keys are not pressed

Code: [Select]

if(Win->GetInput().IsKeyDown(sf::Key::Left))                          //HERE IS THE PROBLEM
      Feld.roh[Feld.IX(i, j)] = -DICHTESTAERKE;

   return true;//won't get here unless mouse buttons are pressed

Window / Problem with IsKeyDown() allthough IsMouseButtonDown() works
« on: February 27, 2009, 01:48:51 am »
could you maybe show more code around the if statements?  also what system/os are you using?

Audio / Looping a music from a certain point
« on: February 25, 2009, 11:13:11 pm »
darn...so i'm back to my either split files or use a different library approach.  I really do not want to use a different library (one reason why I chose SFML was because it did the graphics, audio, (joystick if I wanted to do that) and networking all together.  

If possible it would be really cool if this feature could be added to SFML in the future, though I do realize your limitations on this issue with stb_vorbis.  Are ogg files the only problem? Could a different ogg library be used? I do not know what is required of a library to be added to the framework; I realize you chose sdb_vorbis over other libs.  

On another note, this issue isn't too big of a deal, as I'm more worried about getting gameplay working first.  But I'll definitely have to come back to this later.

SFML website / SFML Audiostream tutorial links to french site
« on: February 25, 2009, 11:05:46 pm »
the (english) site for audiostreams (from the SF::Music page) links to the french site.  Just wanted to let you guys know.

Audio / Looping a music from a certain point
« on: February 25, 2009, 10:54:59 pm »
hmm, can this be implemented for sound streams later? (like in sfml 2)? I don't know about other people, but I find this feature useful.

Audio / Looping a music from a certain point
« on: February 25, 2009, 08:53:23 pm »
Would a way to loop the music from a certain point work by waiting until the song finishes (or gets to a certain point) then restarting from the desired part? (seeking with the GetPlayingOffset )?
This would use threads a lot woudn't it; could the sleep function be used to sleep until the music is over (time it) and then restart from a point? how much of a lag would there be?

General / Some SFML programming issues
« on: February 25, 2009, 08:43:50 pm »
wait, so you can set the sound's time position (make it play from a certain spot)?

EDIT: found it, SetPlayingOffset yay.

Graphics / LoadFromFile() hates me.
« on: February 18, 2009, 07:47:59 pm »
have you tried running the exe on its own with the image in the same dir as the exe? sometimes, if its a path problem, it'll work.  I also recommend using slashes instead of backslashes.  

Also, if you're using SFML_DYNAMIC, then you dont need to link to the static libs right?  (so sfml-window-s.lib should just be sfml-window.lib).

Graphics / Rounded Rectangles
« on: February 15, 2009, 07:48:10 pm »
Awesome, this is why I ask for help in my code ^_^.  I'll change that right away.  
I guess the reason why I did that is I don't like making copies of objects (always thought that it wasted more memory), but I guess it is deleted after I exit the function (and a memory leak is waaaay worse).

EDIT: ok, changed the function to:
Code: [Select]

sf::Shape RoundedRectangle(float x, float y, float rectWidth, float rectHeight, float radius, const sf::Color& Col, float Outline = 0.f, const sf::Color& OutlineCol = sf::Color(0, 0, 0), int POINTS=10);

the rest of the function is the same, just does not use a pointer.  
Thanks for the help!

Audio / Looping a music from a certain point
« on: February 15, 2009, 07:01:46 am »
I think the problem might just be with the Music files themselves.  (two files seemed to lag though one started right away).  I guess I'll just have to look into that some more.

Pages: 1 ... 5 6 [7] 8 9