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

Pages: [1]
1
Graphics / Re: How to go about creating a bullet class in SFML 2.0
« on: May 30, 2013, 04:53:53 am »
I agree with MattY's idea; you'd be better served to create a bullet and check for collision with it. You might do something like:

FireMusket(float elapsedTime){
          if(elapsedTime >= 2.0f) //or however fast you want to be able to fire
                     bullet_manager.Add(currentDirection); //currentDirection being the unit vector for your character's facing
}

Then create a bullet class, and a manager container for it (could use a list or map to store bullets). When you call the .Add function like above, you'd multiply the currentDirection vector by the bullet's speed to get the bullets velocity vector. Move the bullet by the vector, and check for collision in each step.

2
Just to be sure I'm not missing anything in config, there should only be 3 changes (add SFML\include to Additional Include Directories under C++, Add SFML\lib to Additional Library Directories, and add sfml-main/system/window/graphics/network/audio-d.lib to Additional Dependencies under Linker) correct? I'm linking dynamically. I tried this in Release mode (with the non -d .libs linked) and got the same thing as well.

I do have 2010 C++ runtimes (x86 and x64) on it. Everything that I cannot run on this machine will run on my home tower (Win 7 based), but I have been rebuilding each project before trying to run it on both machines.

I've been compiling/running console and Win 32 based apps for my coursework (I'm currently in some C++ programming courses) without issue on this tablet for a few months now.

I just moved that test app over to my tower and ran it straight from the debug folder without issue.

3
Fresh copy of SFML 32-bit, VS2010. Same error, different address. Same code as the last test.

Unhandled exception at 0x5c19b60e in Test2.exe: 0xC0000005: Access violation reading location 0x0000002c.

What else can I check?

4
I made sure I had the correct libs (I used the wrong ones once; makes a much more annoying mess). I'm pretty sure I have the correct SFML files, but I'm going to grab a fresh copy of SFML VS2010 just to be sure.

5
I tried to run the executable as admin as well. Same result.

6
Appreciate the reply. I've read and re-read the setup tutorial, but just to be sure, I went through it again, and matched those settings to mine. Same result. I would think if that was off, it wouldn't even compile (it does just fine).

The "" vs <> include was an oversight on my part (I was in a hurry with that test); the original project that I noticed this in does use  <>. I've also used the precompiled headers (stdafx.h) with SFML (1.6 and 2.0) in the past without this issue. Just to be sure,  I wrote another test without them that returns the same result.

Unhandled exception at 0x58f5b60e in Test2.exe: 0xC0000005: Access violation reading location 0x0000002c.

#include <SFML/Graphics.hpp>

int main(){
   sf::RenderWindow window;
   return 0;
}

Debugger always points to the RenderWindow initialization.

7
I'm getting the follow error when trying to initialize a RenderWindow on a specific machine: Unhandled exception at 0x58f5b60e in SFML test.exe: 0xC0000005: Access violation reading location 0x0000002c.

The code that threw that error was simply (created a new project to test):

#include "stdafx.h"
#include "SFML/Window.hpp"
#include "SFML/Graphics.hpp"


int _tmain(int argc, _TCHAR* argv[])
{
   sf::RenderWindow window;
   return 0;
}


Have had this happen with multiple projects, which build and run fine on my main PC. I've set my project exactly the same as my other PC (even copied the entire project folder over and still gets this). Is there something I'm missing, or could this be a hardware thing?

I was not able to find a similar situation via search thus far...

System that will run this is a Dell T7400 running Windows 7 Ultimate (Dual Xeon X5482 nVidia GTX 660 gfx).
System that will not run this is a Surface Pro running Windows 8 (i5-3317u HD4000 gfx).

Any input on this would be appreciated. Thanks!

EDIT: Corrected the status of this. Project will compile, the error comes when trying to run it.

Pages: [1]