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

Pages: [1] 2 3
1
Graphics / Re: Drawing darkness around player
« on: October 06, 2012, 02:03:15 am »


Thank you, it works perfectly now. Your example code really helped also.

2
Graphics / Re: Drawing darkness around player
« on: October 05, 2012, 09:04:38 am »
Lol, I was just about to ask for a link to an example of that. Thanks I'll have a look at this.

3
Graphics / Re: Drawing darkness around player
« on: October 05, 2012, 07:54:32 am »
Thank you! That's exactly what I was hoping for!

4
Graphics / Drawing darkness around player
« on: October 05, 2012, 03:40:08 am »


This is what I'm working on in my game. I want to have the player only able to see a square or so in front of them.

How I'm doing it is I just have a sprite that's all black except for the center, and I have it move along with the player's position. It works, until the sprite boundaries hit the window boundaries (since this sprite has to be rather large to stay black no matter where the player is on the map), and then the sprite doesn't display in this case.

This is all framed within the rest of the screen, so everything else is going on top of it to hide the edges of the "blackness."

I could only think of one option to fix this:

1) Make 4 differently shaped "blackness" sprites, and change between which is displayed depending on where the player is on the map (divide it into 4 quadrants). This way would work, but it would be a pain in the butt to do and take a long time to implement.

I wish there was some way I could just fill the map area of the screen with black, then remove a hole in the area of the sprite, and have that hole move around. Is there someway I can do that?

Or, is there a better way you think I could do this?

Thank you for your help.

5
General / Re: Can't get VC++ to run with SFML [Solved]
« on: August 03, 2012, 09:40:44 am »
I guess I should've thought about "compiled executable" a little more. It was vague to me when I first read it, but maybe only because I was frustrated trying to make it work. When I read it now, it does make sense :P
Thank you again for your help.

6
General / Re: Can't get VC++ to run with SFML
« on: August 03, 2012, 09:14:27 am »
I tried it again, and took your suggestion to just ignore the errors that I was getting (at least some of those ones), and it works now!!!

Perhaps for the tutorial, I suggest it would be better to give more information on using sfml-main, since it's a bit confusing the way it explains why to use it. I think it'd be better to just say "we recommend you add sfml-main.lib and sfml-main-d.lib (for the Debug) to these libraries" at the same part where it lists which library files to add, instead of at the very end of the tutorial. It could have a simple explanation why, but it was a bit confusing to read that because I thought, "if I add sfml-main, what does it mean? Do I still put int WinMain()? or something else? Do I have to add it?"

Also for the first image in the VC++ tutorial, it should put a red box around "All Configurations." Even though it says that above, I forgot to do it because I was focused on the picture when I saw it. Maybe this is just a problem I had though.

It also says, toward the end of the tutorial, "don't forget to copy the SFML DLLs (they are in <sfml-install-path/bin>) to the directory where your compiled executable is." However, this is still a little vague, since VC++ creates multiple folders for the same project. I was wondering, "If I link dynamically, then do I put these .dlls in the main folder of the project, or in the sub-folder that contains main.cpp? Or, in the individual Release and Debug folders that VC++ creates?" It might be easier to just say "put them in the same folder as main.cpp is located"

Anyway, I'm not going to blame the tutorial for any mistakes. It's always my fault for not knowing more about programming. But thanks to your help I was able to make it work finally. ( Finally :D )

Thank you for your help again!

7
General / Re: Can't get VC++ to run with SFML
« on: August 03, 2012, 08:41:48 am »
The first time I compiled it, and that's what I posted on my error. But I just recently tried to use the SFML RC 2.0 and still wasn't able to make it work.

If I can make it work, I'd love to give my feedback for the installation tutorial to make it better to help other people who are struggling to get it working. I think SFML is the best (simple) API out there for so it'd be great if more people could try it.

I'm surprised you can understand what all of the errors mean! I'm going to try again one more time.
After reading your comment on the last one, it might be a problem because I'd previously installed SFML and have been using it with MinGW for the past couple of months, so perhaps VC++ is locating my old dll files (which I'd copied into system32.
Thanks for your help.

8
General / Re: Can't get VC++ to run with SFML
« on: August 03, 2012, 02:24:11 am »
I'll post the steps I'm doing exactly, one at a time, so hopefully someone can see if I'm doing something wrong (or missing something). I'll do this exactly as the official tutorial says to do.

1) Download SFML 2.0 Release Candidate (Windows 32 bits - Visual C++ 2010) and extract it (I put it in C:\sfml\)

2) Make a new 'Win32 Project' in Visual C++ 2010

3) Select 'Empty Project' and click 'Finish'

4) Add a main.cpp to the project, and fill it with example project from the tutorial (found here: http://www.sfml-dev.org/tutorials/2.0/start-vc.php)

6) Project Properties -> Configuration -> "All Configurations"

7) Configuration Properties -> C/C++ -> General -> Additional Include Directories -> "C:\sfml\SFML-2.0-rc\include"

8) Configuration Properties -> Linker -> General -> Additional Library Directories -> "C:\sfml\SFML-2.0-rc\lib"

9) Configuration -> "Debug"

10) Configuration Properties -> Linker -> Input -> Additional Dependencies -> added "sfml-main-d.lib; sfml-graphics-d.lib; sfml-window-d.lib; sfml-system-d.lib; sfml-audio-d.lib; sfml-network-d.lib;" (I added main because it's a Windows application)

11) Configuration -> "Release

12) Configuration Properties -> Linker -> Input -> Additional Dependencies -> added "sfml-main.lib; sfml-graphics.lib; sfml-window.lib; sfml-system.lib; sfml-audio.lib; sfml-network.lib;"

13) Copied all 10 library files to the same folder as main.cpp (12 files copied total, including both sfml-main files)

------------------------------

Try compiling with Debug.
I get this error:

Code: [Select]
1>  main.cpp
1>sfml-main-d.lib(SFML_Main.cpp.obj) : warning LNK4099: PDB 'sfml-main-d.pdb' was not found with 'sfml-main-d.lib(SFML_Main.cpp.obj)' or at 'c:\users\username\documents\visual studio 2010\Projects\MyProject\Debug\sfml-main-d.pdb'; linking object as if no debug info
1>sfml-main-d.lib(SFML_Main.cpp.obj) : warning LNK4099: PDB 'sfml-main-d.pdb' was not found with 'sfml-main-d.lib(SFML_Main.cpp.obj)' or at 'c:\users\username\documents\visual studio 2010\Projects\MyProject\Debug\sfml-main-d.pdb'; linking object as if no debug info
1>  MyProject.vcxproj -> c:\username\mycomputer\documents\visual studio 2010\Projects\MyProject\Debug\MyProject.exe
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

Try compiling with Release.
I get this error:

Code: [Select]
'MyProject.exe': Loaded 'C:\Users\username\Documents\Visual Studio 2010\Projects\MyProject\Release\MyProject.exe', Symbols loaded.
'MyProject.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file
'MyProject.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file
'MyProject.exe': Loaded 'C:\Windows\System32\sfml-graphics-2.dll', Binary was not built with debug information.
'MyProject.exe': Loaded 'C:\Windows\System32\sfml-system-2.dll', Binary was not built with debug information.
'MyProject.exe': Loaded 'C:\Windows\System32\msvcrt.dll', Cannot find or open the PDB file
'MyProject.exe': Loaded 'C:\MinGW\bin\libgcc_s_dw2-1.dll', Binary was not built with debug information.
'MyProject.exe': Loaded 'C:\MinGW\bin\libstdc++-6.dll', Binary was not built with debug information.
'MyProject.exe': Loaded 'C:\Windows\System32\sfml-window-2.dll', Binary was not built with debug information.
'MyProject.exe': Loaded 'C:\Windows\System32\gdi32.dll', Cannot find or open the PDB file
'MyProject.exe': Loaded 'C:\Windows\System32\user32.dll', Cannot find or open the PDB file
'MyProject.exe': Loaded 'C:\Windows\System32\advapi32.dll', Cannot find or open the PDB file
'MyProject.exe': Loaded 'C:\Windows\System32\rpcrt4.dll', Cannot find or open the PDB file
'MyProject.exe': Loaded 'C:\Windows\System32\opengl32.dll', Cannot find or open the PDB file
'MyProject.exe': Loaded 'C:\Windows\System32\glu32.dll', Cannot find or open the PDB file
'MyProject.exe': Loaded 'C:\Windows\System32\ddraw.dll', Cannot find or open the PDB file
'MyProject.exe': Loaded 'C:\Windows\System32\dciman32.dll', Cannot find or open the PDB file
'MyProject.exe': Loaded 'C:\Windows\System32\setupapi.dll', Cannot find or open the PDB file
'MyProject.exe': Loaded 'C:\Windows\System32\oleaut32.dll', Cannot find or open the PDB file
'MyProject.exe': Loaded 'C:\Windows\System32\ole32.dll', Cannot find or open the PDB file
'MyProject.exe': Loaded 'C:\Windows\System32\dwmapi.dll', Cannot find or open the PDB file
'MyProject.exe': Loaded 'C:\Windows\System32\winmm.dll', Cannot find or open the PDB file
'MyProject.exe': Loaded 'C:\Windows\System32\oleacc.dll', Cannot find or open the PDB file
Debugger:: An unhandled non-continuable exception was thrown during process load

If I just try to run it anyway in Debug, it'll tell me:
"This application has failed to start because sfml-graphics-d-2.dll was not found. Re-installing the application may fix this problem."

If I just try to run it anyway in Release, it'll tell me:
"The procedure entry point ??0RenderWindow@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IABUContextSettings@1@@Z could not be located in the dynamic link library sfml-graphics-2.dll."


So, what should I reinstall? Did I make some mistake in following the instructions?

9
General / Re: Can't get VC++ to run with SFML
« on: August 03, 2012, 12:06:50 am »
I checked if the missing dll file was there, but I couldn't find it either in the \lib folder. I guess it never properly installed, even though I followed the steps. But I won't give up yet, I'll try to do everything again from the beginning using the official tutorial. If it doesn't work this next time I'm just gonna pay somebody to remote control my PC and do it for me  >:(


edit: I did it again, this time using the SFML SDK for Visual C++ 2010 (Express). I really wish someone would remake that tutorial, because it's so hard to understand (some parts are super easy to understand, but some parts kind of gloss over the details and assume the user has experience compiling other APIs). I have no experience compiling other APIs and the instructions really confuse me, but I still followed them as perfectly as I could. Still, the basic code example won't compile in Debug or in Release :'(

10
General / Re: Installation help.
« on: August 02, 2012, 11:10:58 pm »

SFML 1.6, just any compile, other code works, and the floating point starts at 3.01 and goes down every time.
[/quote]

Can you create a minimal example that replicates the  problem, and show us the code that you're using?

11
General / Re: Can't get VC++ to run with SFML
« on: August 02, 2012, 11:07:01 pm »
There's no magic in VS. If VS says it can't open that lib file, then there are only two possibilities:
  • VS couldn't find the library.
  • VS doesn't have access to it (not enough rights or something else is blocking it).

Since the second one is rather unlikely I'd say that you still somehow setup something wrong. :-\

You're mentioning you've tried once the dynamic and once the static libraries for debuging, do you also have compiled the debug libraries?
You have to run the library compilation twice once for debug and once for release.

I ran nmake, and the tutorial didn't say I had to compile it twice (for VC++), and since the default of nmake is 'all'. Are there other special instructions that aren't in the tutorial? Like, do I have to run nmake -d or something like that again?

12
General / Can't get VC++ to run with SFML [Solved]
« on: August 02, 2012, 10:26:25 pm »
I just finished following the official SFML tutorial perfectly, but I still get this problem.

Code: [Select]
fatal error LNK1104: cannot open file 'sfml-graphics-s-d.lib'

I switched to Dynamic linking and tried the same thing, and got the same error "sfml-graphics-d.lib." It also does the same thing in Release mode, with both Dynamic and Static linking. I've triple checked that the compiler has the include and lib directories like the tutorial shows.

I checked on the forums, and it seems people with this problem were told that they didn't correctly link the libraries.
Perhaps I'm not linking the libraries correctly, but I did exactly what the tutorial said to do.

It's my fifth time trying to install SFML with VC++ 2010 Express :-(
I'm running Windows Vista 32-bit and already used CMake and nmake on the SFML files (I'm using SFML 2.0) and everything up to there worked fine.

Anyone know what the problem is?

13
General / Re: Making my program work on other machines
« on: August 02, 2012, 11:38:53 am »
I don't think my friend would like me to turn their computer into a debug machine.

Thanks for your nice advice. I think I'll give the official tutorial one more try and hope it works :)

14
General / Re: Making my program work on other machines
« on: August 02, 2012, 11:11:30 am »
You can also get more details on the crash by looking at the Windows Event Viewer (Control Panel->Administritive Tools->Event Viewer->Windows Logs->Application).

Run the program so it crashes, then immediately look at the error event that will be generated.

It could be missing WinSxS libraries, if not then as Laurent suggested, write a small program to reproduce the fault. If you intend the game to only run on Windows....personally, I would always use Visual Studio ;)

That's a very good suggestion, thanks! I tried that and here's what I got. I can't really understand it though. I cut out the PC name but this is what I got. Any ideas what the problem could be?
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
<Provider Name="Windows Error Reporting" />
<EventID Qualifiers="0">1001</EventID>
<Level>4</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2012-08-02T08:57:13.000Z" />
<EventRecordID>5642</EventRecordID>
<Channel>Application</Channel>
<Computer>Personal-PC</Computer>
<Security />
</System>
- <EventData>
<Data>3094532583</Data>
<Data>1</Data>
<Data>APPCRASH</Data>
<Data>NONE</Data>
<Data>0</Data>
<Data>Game.exe</Data>
<Data>0.0.0.0</Data>
<Data>501a3f6a</Data>
<Data>StackHash_5ab3</Data>
<Data>6.0.6000.16386</Data>
<Data>4549bdc9</Data>
<Data>c0000374</Data>
<Data>000af1c9</Data>

-------------------------

P1: Game.exe
P2: 0.0.0.0
P3: 501a3f6a
P4: StackHash_5ab3
P5: 6.0.6000.16386
P6: 4549bdc9
P7: c0000374
P8: 000af1c9
P9:
P10:
 

15
General / Re: Making my program work on other machines
« on: August 02, 2012, 11:00:38 am »
Sorry that my post is so vague, that I only wrote "crashes" on it. I'm not sure what other information that I can give to help figure out the problem.

I took your suggestion and compiled a minimal application, which only opens a window (just to check if SFML will work), and I still included all of the dlls with it. I tried it and the minimal application opens fine on the laptop now without any problems.

I thought it might be a problem with music, so I tried again without the music, but it still did the same thing as before. Any other ideas what I can try testing?

I wanted to make it run on Visual Studio, like 10 times when I first downloaded SFML, for like 2 days, but every time even when I followed the instructions for setting up SFML perfectly, from multiple tutorials, even from video tutorials, it never works; it just won't link correctly, because everyone's tutorial isn't the exact same set-up as my computer, so I gave up on Visual Studio and switched to MinGW... unless there's some better tutorial. But I'd really love if I could use VC++ instead, since MinGW is nice but it's not as user friendly.

Pages: [1] 2 3