How to Use GLFW in XCode

First, download the GLFW source code.

Extract the tarball to a directory.

Open a terminal and cd to the extracted directory. Run cmake (if not already installed, install it!):

%>cmake .

Then,

%>make

%>make install

The header files will be placed under a GLFW directory in

/usr/local/include/

and the library file in

/usr/local/lib/

To now use the libraries, start a new XCode project.

Screen Shot 2014-08-06 at 9.25.02 AM

Select “OS X Application” and “Command Line Tool.” Name the project whatever you like and save it somewhere.

Screen Shot 2014-08-06 at 9.25.18 AM

The first step is to link the search paths for the libraries and header files. With your project selected in the Project Navigator pane, select the “Build Settings” tab. In the search box, type Search Paths.

In header search paths, add

/usr/local/include/

and select recursive.

Screen Shot 2014-08-06 at 9.26.26 AM

Similarly, under library search paths, add

/usr/local/lib/

and select recursive.

Screen Shot 2014-08-06 at 9.26.36 AM

Now, click the “Build Phases” tab. Under “Link Binary with Libraries,” we must add the appropriate libraries necessary for OpenGL and GLFW to function. First add the OpenGL framework. (You may type “OpenGL” in the search on the dialog box that comes up to quickly find it.)

Screen Shot 2014-08-06 at 9.31.40 AMWe must also add several libraries (frameworks) required by GLFW: Cocoa, OIKit, and CoreVideo. Add each of these in turn by finding them alphabetically or typing them in the search box.

Finally, add the GLFW library (libglfw3.a, located in the /usr/local/lib/ directory). In the framework add dialog box that pops up, click “Add Other.” Now this is a bit tricky, because the OS X file open dialog won’t allow you to select the /usr/ folder by default. The workaround is to download TinkerTool, and select “Show hidden and system files,” then click “Relaunch Finder.”

Screen Shot 2014-08-06 at 9.40.54 AM

Now, make the /usr/ folder a favorite as described in this post. The usr folder will now show up in the file open dialog for easily selecting the library.

Screen Shot 2014-08-06 at 9.44.33 AM

Your Build Phases pages should now look like this:

Screen Shot 2014-08-06 at 9.44.41 AM

Now, to test to see if it works, copy GLFW’s sample code from here into your main.cpp, then build and run.

Screen Shot 2014-08-06 at 9.51.50 AM

 

Advertisements

How to Get Rid of Menu Bar Grey Ghost in VLC 2.1.4 in Mavericks OS X on Second Display

Whether it’s a bug in Mavericks or VLC Player, when full-screening a video on a second display the OS X Menu bar will often appear as a grey bar. See here for example:

Screen Shot 2014-07-22 at 1.05.38 PM (2)

In order to remove the bar, click VLC > Preferences, and make sure you’re on the “Interface” tab. De-select “Use the native fullscreen mode.”

Screen Shot 2014-07-22 at 1.06.18 PMNow, the video should take up the full screen of the second display without that annoying bar.

Screen Shot 2014-07-22 at 1.10.58 PM (2)

How to Remove Chrome Notifications Icon in Menu Bar in Mac OS X

Chrome adds an annoying semi-worthless notifications icon in the menu bar in Mac OS X.

To get rid of it, type

chrome://flags

in the address bar. Hit “Command+F” to open up a search menu and type

Notification Center

to find the “Notification Center behavior Mac” setting. (In older versions of Chrome, it may be called “Enable Rich Notifications Mac, Windows”)

Screen Shot 2014-06-20 at 11.57.50 AM

Hit the drop-down and select “Never show.”Screen Shot 2014-06-20 at 11.58.00 AMNow, click the “Relaunch Now” button at the bottom of the window.

source: http://macforums.com/34-os-x-applications/2895-how-do-i-remove-chrome-notifications-icon-menu-bar.html

 

How to Add and Remove Favorites from OS X Finder

In order to add, remove, or re-order favorites (or anything on the left side of the Finder window, for that matter), simply hold Command, and drag.

Screen Shot 2014-06-20 at 8.25.15 AM For Example, to remove an item, hold Command, click and drag the item off the window. You’ll hear a “poof” sound indicating it’s gone to the trash.

For adding an item, such as your home folder for example, click “Go” and “Home.”

Screen Shot 2014-06-20 at 8.25.27 AM

Then, click “Go” and “Enclosing Folder.” Select your username (your home folder).

Screen Shot 2014-06-20 at 8.26.23 AMHold “Command” and drag it into “Favorites.”
Screen Shot 2014-06-20 at 8.26.37 AM

How to Reverse Mouse Scroll Direction on Mac OS X, but not that of the Trackpad

Connecting a traditional mouse with a scroll wheel to Mac OS X can be a frustrating experience if you use the default scroll direction (natural) of the Mac OS X trackpad. The scroll wheel also follows this natural direction, which is backwards from what most people expect. If you’re using only the mouse and don’t expect to use the trackpad, then simply reverse the direction under System Preferences > Mouse, and uncheck Scroll Direction: Natural.

However, if you wish to use both, you’ll need an additional tool. Download the free Scroll Reverse software. Unzip the contents into the Applications folder.

Now, you’ll have a double arrow in the system toolbar. Right click and make sure “Reverse Scrolling” is selected.

Screen Shot 2014-05-25 at 5.21.23 PM

 

Next, click Preferences and uncheck “Reverse Trackpad.” You might also want to check “Start at Login.”

Screen Shot 2014-05-25 at 5.22.40 PM

How To Output Video and Sound From Macbook to HDMI Capable TV

Simply plug in an HDMI cable from your TV to your Macbook, select that input on your TV, and you’ll notice that the TV becomes a second monitor. However, you’ll still only get sound from your Macbook. In order to get the sound piped through the TV, click the Sound icon in your OS X menu bar:

Screen Shot 2014-05-05 at 7.26.06 PM

Then, select your TV instead of Internal Speakers; my option, for example, looks like this:

Screen Shot 2014-05-05 at 7.25.34 PM

How to Install Orbiter Space Flight Simulator in Mac OS X

Orbiter Space Flight Simulator uses Direct3D (7) and so is not strictly compatible with any operating system other than Windows. However, using Wineskin Winery, it is not too difficult to install on Mac OS X. For this how-to, I’m using Mac OS X Mavericks, Orbiter 2010-P1, and Wineskin Winery 1.7. I could simply supply the Wineskin Wrapper I’ve made here for you to download (minus Orbiter, which I wouldn’t be allowed to distribute without permission). Instead, however, I think it is useful to more people to learn how to actually set up software using Wineskin.

First, download Wineskin Winery. Then, download the Orbiter 2010-P1 MSI Installer from here.

Launch Wineskin Winery. Note the installed engine in the list, then click the + button. Check to see if there is a later (high number) engine available, and if so click Download and Install. Then, click “Create New Blank Wrapper.”

Screen Shot 2014-04-28 at 9.23.21 PMNext, type your desired application name. I chose “Orbiter2010-P1.”

Screen Shot 2014-04-28 at 9.24.19 PMGive Wineskin some time to work its magic, at which point you’ll see this:

Screen Shot 2014-04-28 at 9.25.10 PMClick OK. Now, go to your launchpad to find the app, or else under /Users/YOURUSERNAME/Applications/Wineskin/. Click “Install Software.”

Screen Shot 2014-04-28 at 9.28.18 PMNow, click “Choose Setup Executable,” then browse to your Downloads and select the Orbiter MSI installer.

Screen Shot 2014-04-28 at 9.28.27 PMYou’ll be greeted by the Orbiter installation.

Screen Shot 2014-04-28 at 9.29.58 PMClick next, agree to the terms, and and not the next screen, select “Custom.”

Screen Shot 2014-04-28 at 9.30.09 PMFor some reason, the default install location doesn’t mate well with Wineskin, so after Location, select “Browse.”

Screen Shot 2014-04-28 at 9.30.33 PMUnder folder name, replace the text with “C:\Orbiter2010\”

Screen Shot 2014-04-28 at 9.30.25 PMClick OK, and then click Next through until completion of the installation.

Screen Shot 2014-04-28 at 9.30.42 PMWineskin will ask you to choose the appropriate executable (since there are a few in the Orbiter folder). In the drop-down menu, select “/Orbiter2010/orbiter.exe”

Screen Shot 2014-04-28 at 9.33.51 PMYou’ll next be presented with the Wineskin configuration screen. Select “Set Screen Options.”Screen Shot 2014-04-28 at 9.35.09 PMYou might be tempted to select “Override” and then the “Fullscreen” option. Don’t. it’s nicer to have the Orbiter launch panel show up in a Window; then we’ll set Orbiter up so that it is fullscreen. Select “Use Mac Driver instead of X11,” and then I also selected the Direct3D boost, but I’ve no clue if it actually does anything.

Screen Shot 2014-04-28 at 10.18.18 PMClick “Done”, select “Quit” and then run your Orbiter app again. Now, instead of being presented with the Wineskin menu. Orbiter will launch. The first time Orbiter is run, it will do a serious of checks and will fail on the Direct3D check; however, the program still appears to work. There is a strange flickering effect if we were to leave things the way they are. So go to the “Video” window, and select the 3D device dropdown menu. Instead of the default “Wine D3D7  T&L HAL (Direct3D HAL), select “Wine D3D7 RGB (Direct3D HAL).” Also, select the “Full Screen” button, and set the resolution to whatever you’re running. (Note: Wineskin Winery I do not believe supports the Mac’s retina resolution, and so here I’ve selected half of it, 1440×900.)

Screen Shot 2014-04-28 at 10.10.57 PMOk, that’s it. Either click “Exit” or select a Scenario and “Launch Orbiter.”

Screen Shot 2014-04-28 at 9.46.18 PMThat’s it. Now you’re playing Orbiter on your Mac.

Screen Shot 2014-04-28 at 10.27.52 PM

Except, you may notice that you are now unable to control your spacecraft, since by default Orbiter utilizes the Windows number pad. There are a couple of options. You may simply assign any alphabetical keys you want to the control of the spacecraft, or preferably, hook up a Mac number pad. Unlike Windows, however, the keys are not NUMPAD keys, but rather just the numbers themselves. In other words, in Windows, 4 and NUMPAD4 are two different things. In OS X, they’re the same. Therefore, it is necessary to modify the keyboard configuration file in Orbiter to recognize these numeric keys. Right click your Orbiter app and select “Show Package Contents.”

Screen Shot 2014-04-28 at 10.58.12 PM

 

Now, you’ll see the “contents” of the wineskin package.

Screen Shot 2014-06-06 at 11.30.59 PM

Click on “drive_c”, select Orbiter2010, and find the file called “keymap.cfg.” Open it in your favorite text editor.Screen Shot 2014-06-06 at 11.31.10 PM

Now anywhere you see NUMPAD, simply remove that text to leave only the number behind it. A simple search and replace will work just fine.

Screen Shot 2014-06-06 at 11.31.33 PM

Additionally, you’ll also want to find the line for “DecHoverThrust” and change “DECIMAL” to “PERIOD”. Now, when you start up an Orbiter scenario, you’ll find your numpad works.

If you’re only interested in getting Orbiter installed you can stop reading here, but there are a few things you can do to improve the experience. So if you’re interested, continue on.

Orbiter 2010 is a bit dated graphically at this point, so go to the “Visual Effects” window, and turn on options as desired; more than likely your Mac will have no problem handling it.

Screen Shot 2014-04-28 at 9.46.49 PMThe default textures in Orbiter are relatively low, but higher resolution textures are available. Return to the Orbiter Forum download page and scroll down to the Optional Texture packs section. Get any or all that you’re interested in (at the very least, download the high level 14 Earth). If you’ve downloaded all these resolution packs to a single folder, then when you open it, it may look something like this:

Screen Shot 2014-04-28 at 10.49.48 PMDouble click each zip file and they will extract to sequentially numbered “Textures2” folders. Combine all the files from these folder into a single “Textures2” folder. It may look like this:

Screen Shot 2014-04-28 at 10.53.26 PM

Select all these files and copy them. Now, we must place the contents of this folder inside the Orbiter directory inside the Wineskin wrapper. Open the Finder and navigate to your home applications folder (Click Finder, then Go >> Home, then double click “Applications” and finally “Wineskin”). Right click your Orbiter app as you did earlier and select “Show Package Contents.”

Screen Shot 2014-04-28 at 10.58.12 PMLaunch the Wineskin application located here. Note that for any other addons you may ever want to install in your Orbiter wrapper, this is how you’ll do it. Now simply navigate: “drive_c” >> “Orbiter2010” >> “Textures2.” Now paste the clipboard content in here. The higher-resolution textures will now be used next time you launch Orbiter.

Another practically essential add-on for Orbiter is Dan Steph’s Orbiter Sound package. Download it from here. Since this add-on is an installer, the procedure is a little different. Navigate again to your Orbiter app and show the package contents. You’ll see an app here simply called Wineskin. Launch it. You’ll be greeted again by the Wineskin settings window. Note for the future that this is where you’ll go if you ever want to change any of the wrapper settings. But for now, click “Install Software” and then “Choose Setup Executable.” Select the Orbiter sound installation file.

Screen Shot 2014-04-28 at 11.11.58 PMClick “Browse.” Expand the “/” directory, then “Users,” “YOURUSERNAME,” “Applications,” “Wineski,” “Orbiter2010-P1.app,” “drive_c”, and finally click “Orbiter2010.”

Screen Shot 2014-04-28 at 11.15.33 PMClick “OK” and then “Install OrbiterSound 4.0.”

Screen Shot 2014-04-28 at 11.15.45 PMOnce done installing, you can choose to run the configure tool and set it up however you like.

Screen Shot 2014-04-28 at 11.16.07 PMNext time you launch Orbiter, you’ll now have sound.

Screen Shot 2014-04-28 at 11.21.13 PM

 

How to Prevent (Real, i.e. “Snail Mail”) Spam

This is the one incredibly effective way to prevent Spam; that is, actual, real, “snail mail” spam. Junk mail that you open in, not your virtual Inbox, but that Mailbox that sits outside between the sidewalk and the road in front of your house. It is completely free, an incredibly effective.

The solution is an app called Paper Karma. It is available on both Android and iOS devices:

Paper Karma on Apple Store

Paper Karma on Google Play Store

Download the app, sign up to provide your name and postal address, and click “Scan Mail” to start snapping pictures of all the junk mail you receive.

Screenshot_2014-04-14-22-33-17

Primarily, the app is looking for the brand name of the company that sent the mail, so focus on that logo or name; your address area is relatively unimportant since they will already have that information. Photos will be uploaded to their servers immediately and scanned for the junk mail sender. No further action is required by you (almost). Occasionally, they won’t be able to recognize the company and will require your input. And occasionally, the company “denies” the request and requires that *you* personally call. Wow.

Screenshot_2014-04-14-22-33-37

View and/or Forget and Uninstall Unused COM Ports in Windows 7.

Windows by default generates a new COM port (including USB) number for every *new* device that connects to it. But occasionally, depending on software functionality or another reason, one may wish to “start over” at a lower number. This is done in the Device Manager through a simple selection of “Show Hidden Devices.” Well, you’d think, anyway. Likely you’ve already tried this and realized it does not work. Why these extra steps are required I don’t know, but they’re the very reason I’ve mostly switched to OS X and Linux. But here you go:

Click “START”, and in the “Search Programs and Files” box, type

Command

You should see “Command Prompt.” show up above. *Right click” and click “Run as Administrator.”

Image

At this command prompt, type

set devmgr_show_show_nonpresent_devices=1

Presse ENTER and then type the following followed by ENTER again:

start devmgmt.msc

Now, click “View” and then “Show hidden devices.”

win7_2

 

Now, all devices that Windows has “saved” a COM port for but is not actually connected will now show. Simply right click and “Uninstall” to release that COM port number for a new instrument. Don’t worry: this will not delete drivers or anything; the instrument that was previously associated with that number will simply be assigned an unassigned number upon connection.

source: http://support.microsoft.com/kb/315539