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

Pages: [1]
1
General / Installing & Using SFML on Mac OS X for the complete PC idiot
« on: January 23, 2016, 05:36:23 pm »
I recently got a MacBook Air (Yosemite), and decided to convert some projects I’d written using SFML from my PC to the Mac.  This turned out to be such an ordeal, I wrote this synopsis of the problems I had to help anyone else with similar unfamiliarity with Mac OS X, and to raise some questions about using SFML on the Mac OS X system. 
No problems installing Xcode (7.1) with Clang or the Command Line Tools following the SFML tutorial, or installing SFML frameworks (2.3).  However, the instructions for installing SFML dylibs starts with “Copy the content of lib to /usr/local/lib and copy the content of include to /usr/local/include.”  I didn’t realize that the /usr/local/ folders are hidden (seems this info should be included in the instructions), so I was unclear what to do.  I initially installed them in folders I made in /Library/, and the fact that Xcode was able to successfully run the Hello SFML demo shows that if frameworks is properly installed and specified for the build, Xcode doesn’t need dylibs for SFML projects.  I later learned how to show hidden files (http://www.macworld.co.uk/how-to/mac-software/how-show-hidden-files-in-mac-os-x-finder-3520878/).  I’ve now installed dylibs properly, although include didn’t exist in usr/local/, so I had to make the folder. I can now compile apps with either dylibs or frameworks. I had assumed that dylibs would build smaller apps with fewer unnecessary files, but I don’t see a big difference in app sizes built with either dylibs or frameworks, and some frameworks are present in the apps built with dylibs. A good tutorial on how and why to set up SFML Xcode projects with frameworks vs. dylibs would be useful.
The first game project worked immediately, but the second compiled and ran without errors when building with Xcode, but when the app was copied onto the desktop and run, the game high score text file would never update.  Turns out I’d forgotten to include resourcePath() in the path for writing to the data text file, but trying to debug that turned into a major project of its own, since the program worked perfectly when using Xcode but failed when run as a separate app. I knew the data text file was in the app, because I could see it when I looked at it on my PC, but couldn’t see anything on the Mac. I found a website that recommended right-clicking the mouse to show app contents on the Mac, but of course, there is no right click on the touch pad of a MacBook Air.  Quite by accident, I found that hovering over the app icon and clicking with two fingers is the equivalent of a right mouse click, and then the finder prompts you to show the package contents. However, having to separately click on each app to see the app content files seems like a serious defect in the finder.  If there’s a shortcut I’m missing that allows you to search for all copies of a named file in all apps as well as on the main drive file structure, I’d very much appreciate hearing about it.  Once I could see the app contents in the finder, it was possible to launch the app using a terminal located in the app’s MacOS folder that allowed easier debugging when running the app independently of Xcode.
I hope others find this useful, and look forward to hearing about why one should use SFML dylibs vs. frameworks on Mac OS X.

2
SFML projects / Re: Particle Quest
« on: September 27, 2015, 09:31:48 pm »
Sorry, I've got to learn how to use Github.
I chose 2Shared because it has a Trustworthiness score of Excellent on Web of Trust (for what that's worth), several other users on this website also post there, and it's easy to use, unlike what I saw on the tutorials about how to use Github.  I'm still unclear about how Github is any better protection against posting by someone with malicious intent.  But I've got a lot to learn and Github is on my to-do list.

I've been learning to use Xcode on a friend's Mac, and here's a downloadable OSX app for ParticleQuest posted on 2Shared:
http://www.2shared.com/file/o9nqtofK/ParticleQuestapp.html

3
SFML projects / Re: Particle Quest
« on: September 26, 2015, 05:59:04 pm »
Here's an executable file with all the resources compiled on Code::Blocks to run on Windows 8.   The program still needs work, but I'll have to get back to that later.
Download the zip file at
http://www.2shared.com/file/IX_11QUS/ParticleQuestWindowsExecutable.html?
Open the file and double click on ParticleQuest2singleFile.exe. 
After playing the game and finding the secret rule, you have to hit escape to close the program and then run it again to play a different rule (the chance of repeating the same rule again is 1 out  of 10).  This lack of game flow is the part that needs fixing most.

4
SFML projects / Re: Vector Slalom
« on: September 12, 2015, 06:36:12 pm »
Sorry that I'm such a beginner that I'm not sure what you mean by a game package.

If you want a zip file with all the files in one place, then click here: http://www.2shared.com/file/IaY8oHWs/sfml-Vector-Slalom.html?.  I tried to upload the files on the SFML website, but there's a 1 MB limit. 

If you mean a stand-alone executable file with the dll's encapsulated, I'd like to know how to do that, but I'm not sure it's possible.  Poking around the web, a lot of people have asked that question, but I haven't found anyone who has an answer.  This really isn't a SFML question, but if anyone knows how to do it, I'm using CodeBlocks 13.12 with MinGW and would love to know the linker options and other settings that would allow this.

Unfortunately, the students are back on campus and Drugdoctor is already grading exams.  I'll try to respond to questions as they come up, but correspondence may be sporadic until next spring.

5
SFML projects / Vector Slalom
« on: September 05, 2015, 12:59:35 pm »
I’m new to both C++ and SFML and am trying to learn both.  Reading Chapter 1 of SFML Game Development by Moreira, Hansson and Haller and moving the red circle around the SFML screen reminded me of a game we used to play on graph paper before we had personal computers.  So this is a modified version of that game.  It’s basically a learning exercise, but it’s turned out to be a lot of fun.

To see screenshots of the game, click here http://rhloring.wix.com/utilitypage

The attachments contain the code, an executable file compiled for PC, and a data file (bestgamedata.txt) for a sample game.  The executable file requires sansation.tff, the bestgamedata.txt file and the sfml-graphics, system and window dll’s to run. 

Some future SFML enhancements that I’d like to try:
•   Setting up a touch pad for move entry
•   Adding sounds to the moves 
•   It is possible to play this game with two players, so a network version would be fun to try.
•   Setting up a timer (and pause) to limit the time allowed for each move.
•   Two graphics problems: Sometimes it’s hard to see whether a possible move causes the player to miss a gate AND it’s apparently not possible to get the future move circles perfectly aligned around the grid points at single pixel resolution.  One possible solution to both problems is to set up the course at a higher resolution, and then use SFML View and Zoom to allow seeing either the whole course with correct alignment or conversely, see a close up of a gate.

Some future C++ enhancements I’d like to try:
•   Setting up a player class that would include past moves and future moves and move vectors
•   Setting a gate class that includes the gate vectors
•   Learning how to use game states instead of Boolean flags to control the flow of the game (covered in part in SFML Game Development).
•   Playing against an AI opponent, but this might be a hard nut to crack

I’d love to get people’s feedback and ideas on how to proceed.
For more information about the original game, see http://en.wikipedia.org/wiki/Racetrack_(game) .

6
SFML projects / Particle Quest
« on: August 05, 2015, 11:38:05 pm »
A game loosely based on the card game Eleusis to simulate deductive reasoning during scientific research.
The object is to find the particles that make up an alternate universe by deducing the secret rule that connects them. 
You can play alone or against AI.
The code is posted at http://www.2shared.com/file/V7meGTsx/ParticleQuest.html?
Once you've got the hang of the game, I encourage you to make your own secret rules and post them in this thread.
Please read the README file (in either Word or txt in the zipped www.2shared file) for more info.
A screen shot and the Word version of README is attached.

7
Thanks so much G.!!
Actually, I still got an error message with mapPixelToCoords, but I realized it is in a console message, so I changed the string and commented out the line.  It now works perfectly after loading a text font.
P.S. I'm really new to this.  Are these emoticons important? If so,  ;D

8
Graphics / Missing sfml function and classes in sf::view tutorial
« on: May 19, 2015, 11:00:32 pm »
I'm new to both SFML and C++ and am working on my second project.  The project IS working, but I've run out of room to display the results and thought I'd look at a tutorial on how to use sf::view so I can scroll the results down below.  The SFML tutorial is a bit sparse and I found this tutorial in GitHub: https://github.com/SFML/SFML/wiki/Tutorial:-Using-View
It claims to be using SFML 2 (I'm using SFML 2.1) and is written for Xcode, while I'm using Code::Blocks 13.12.
The CPP is attached.  I get 3 errors and 3 notes (see attached screenshot jpg).  Is this just bad code, or is there some conversion problem from Xcode to Code::Blocks?  Or am I missing a library?
The errors are: 
line 46 no matching function for call to 'sf::Text::Text(const char [16])'
line 146 two identical errors, 'class sf::RenderWindow' has no member named 'convertCoords'
It's so close!  If this is bad code, does anyone have an idea what it should be?
I'd appreciate your help.

Pages: [1]