Thursday, September 22, 2011
Xcode libraries
Tuesday, September 6, 2011
Boost and SOIL in Xcode
BOOST
This one was the hardest, mainly because you have to install it instead of just dragging it into the project. To install it (on mac) you can either use "MacPorts" via "sudo port install boost" or my terminal method. It's up to you wich method you pick. My terminal method I came up with is:
#!/bin/bash/
#BOOST INSTALL
clear
echo "### INSTALLING -> BOOST ###"
echo "---This part will take a while, and needs user participation"
cd ~/Downloads/
#see if the file is there to begin with, if it is skip the download part
if [ ! -d "boost_1_47_0" ]; then
echo "---A web browser will open up a website for you to download a"
echo "zip containing BOOST."
echo "---Please let it download to ~/Downloads/"
echo "---When the download has finished come back to this terminal for"
echo "--- further instructions."
echo "---Please press the enter button to commence..."
read
open "http://prdownloads.sourceforge.net/boost/boost_1_47_0.tar.gz"
echo "---Press the enter key when the download is"
echo "--- finished and when you are ready to proceed"
#wait for the user
read
#see if the file is there
if [ -f "boost_1_47_0.tar.gz" ]; then
echo "---Got the file, now continuing"
else
echo "---Could not find the file!"
exit
fi
tar -zxvf "boost_1_47_0.tar.gz"
else
echo "---You already have the tar.gz archive unzipped. Skipping the download"
fi
cd "boost_1_47_0"
echo "---I also need to use your password to install the library"
sudo chmod u+x bootstrap.sh
sudo chmod u+x ./tools/build/v2/engine/build.sh
echo "---Thank you"
echo "---This will take a while..."
sudo ./bootstrap.sh
#echo "---THIS WILL ALSO TAKE A LOOOOONG TIME..."
#sudo ./b2
echo "---ALMOST THERE..."
sudo ./bjam architecture=combined
echo "---DONE WITH INSTALLING BOOST!"
echo "...press enter to continue on with your life..."
read
clear
#END BOOST INSTALL
The terminal code is not the best in the world, but it does its job. And quite nicely. Well now comes part two, which changes if you decide to use g++/make or Xcode. In g++, you have to specify the libraries you are going to compile with, those commands are: -lboost_filesystem -lboost_system. The full makefile should look similar to:
CC = g++
CFLAGS = -Wall
PROG = game
SRCS := $(patsubst %.cpp,%.o,$(wildcard *.c*))
SRCS += $(patsubst %.cpp,%.o,$(wildcard */*.c*))
SRCS += $(patsubst %.cpp,%.o,$(wildcard */*/*.c*))
SRCS += $(patsubst %.cpp,%.o,$(wildcard */*/*/*.c*))
COMPILE = $(CC) $(CFLAGS) -c
ifeq ($(shell uname),Darwin)
LIBS = -framework OpenGL -framework GLUT -framework CoreFoundation
else
LIBS = -lglut
endif
all: $(PROG)
$(PROG): $(SRCS)
$(CC) $(CFLAGS) -lboost_filesystem -lboost_system -o $(PROG) $(SRCS) $(LIBS)
clean:
rm -f $(PROG)
rm -f *.o
rm -f */*.o
rm -f */*/*.o
rm -f */*/*/*.o
%.o: %.cpp
$(COMPILE) -o $@ $<
Sunday, September 26, 2010
C++ -> Flash
Monday, September 6, 2010
OpenGL and GLUT on Mac
Before I continue, go into terminal and type in:
"man make"
"man g++"
"man manuals are not found you NEED to upgrade Xcode! (I have no idea how you got MacPorts to work if you have not done this already)
Xcode is about 2.5gB, so it will take a while. But the upgrade is really nice (at least in my opinion). But it is needed for MacPorts.
Next, I will go over all the wrong steps.
MacPorts is a really nice tool, but you will NOT need it to install OpenGL and GLUT. It uses the "port" command from Terminal. Such as: "sudo port install cmake", which installs cmake. I tried installing glut though MacPorts, but it did not help. So I tried installing it manually from a zip file. Which include files are located (from what I currently know of) in two spots on the computer: "/opt/local/include/" and "/usr/local/include". I dragged and dropped some files in there (as well as some "Allegro" files, which is another library. I will be going over "Allegro" for a little bit in here since it also messed me up. I copied .../Allegro5/* into the include folders, but I really needed to copy .../* of the zip into the folder (leaving the Allegro5 folder intact though the copy). This left conflicting packages (ie. Memory.h!). Allegro needed to install something in "/Allegro5/platform/". (try to compile with #include
So what should you do?
NOTHING! Thats right, nothing! It is ALREADY INSTALLED ON MACS!!! Lucky you!
But to use it the right way you need to:
Use the right includes:
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
Terminal users:
g++ main.cpp -o main -framework GLUT -framework OpenGL
gcc main.c -o main -framework GLUT -framework OpenGL
make is the same way
Xcode users:
Right click project in the "Groups & Files" bar (left side)
Add
Existing Frameworks...
Select Glut and OpenGl
You should see them added with your project
Thursday, August 12, 2010
My conflicting dpkg install of g++
Copy everything below and paste it into the terminal. It will auto run when you paste it.
How to extract it & copy it over: (please change the stuff in red)
cd ~/Documents/folder/to/app/
cp Geo.ipa Geo.zip || exit
unzip Geo.zip
cd Payload
rm Geo.zip
scp -r Geo.app root@192.168.1.999:/Applications||rm -rf "Payload" &&exit
rm -rf Payload
ssh root@192.168.1.999 || exit && exit
cd /Applications
cd Geo.app/ || echo "ERROR D" && exit
chmod +x Geo
echo "done!"
exit
exit
<- end highlight right here, then copy
It will prompt for the password two times.
And there we go! Go to the home screen and it should be there. If it isn't look though all your pages. Tf it still is not there, open up an app, use the app for about a minute and close it. If it still isn't there, restart you iPhone.
Wednesday, May 12, 2010
300: Revised Abstract
Laurens Requirement
My research examined the application and benefits of using Solar Power vs. Wind Power as alternative energy. I found that we need to reform our ways of obtaining energy from the carbon emitting producers and replace the process with clean, renewable, options. Without these new options we would soon face the doom of filling our atmosphere with concentrated carbon dioxide. The problem is in finding which option is best in a given situation. My method in analyzing the problem was to explore individual requirement in each case, understanding what it needs, what can be done, when it can be used, etc. By learning which option is best to use, we may develop a more efficient result and a cleaner environment. Unfortunately, there is no clean cut answer to each problem as there are variables to consider, such as reliant climate, sun and wind, environmental protection, and costs. For example, wind generated energy requires a lot of wind. Solar generated energy requires a lot of sun. Placing these options in regions not suited to the particular environment does not make environmental sense.
Some possibilities are being explored now with varying results. Solar generated street signs have been proven too unreliable due to the cost of each solar panel and the unreliability of weather patterns. According to “Solar Powered Signals: Myth or Marvel?” by Coetzee, theft of solar panels was one of the biggest cons for using solar generated street lights. However, there are some good possibilities, such as a US and China solar project to develop the biggest solar farm set for completion in 2019 in the Mongolian Desert with a total of 11,950 megawatts of power. The same US company is also developing three more solar farms, one the Mohave Desert totaling up to be 1,100 megawatts of power.
Friday, May 7, 2010
Revised Abstract: The Future of Renewable Power
Some possibilities are being explored now with varying results, wind generated power used in residential zones has been unacceptable due to audible noise caused by the spinning turbine generators. Solar generated street signs have been proven too unreliable due to the cost of each solar panel and the unreliability of weather patterns. According to “Solar Powered Signals: Myth or Marvel?” by Coetzee1, theft of solar panels was one of the biggest cons for using solar generated street lights. However, there are some good possibilities, such as a US and China solar project to develop the biggest solar farm set for completion in 2019 in the Mongolian desert of China2. This project will supply power to three million Chinese homes when fully completed with a total of 11,950 megawatts of power. The same us company is also developing three more solar farms, one the Mohave Desert, California totaling up to be 1,100 megawatts of power3.
As these solar and wind options become cheaper and more available, we can count on seeing them competing with other non-renewable options in the future to help relieve our demand for energy.
1)Coetzee, Jan, Willem Louw, and Peter Bullock. "SOLAR POWERED TRAFFIC SIGNALS: MYTH OR MARVEL?." digital research repository of the University of Pretoria. Document Transformation Technologies cc, 11 July 2008. Web. 9 Apr. 2010.
2)Woody, Todd. "China and U.S. Company Plan a Big Solar Project - NYTimes.com." The New York Times - Breaking News, World News & Multimedia. N.p., 8 Sept. 2009. Web. 6 May 2010.
3)Woody, Todd. "A Boost for Photovoltaics in California Deal - Green Blog - NYTimes.com." Energy and Environment - Green Blog - NYTimes.com. N.p., 18 Aug. 2009. Web. 7 May 2010.