Skip to content

Commit

Permalink
made a basic proof of concept demo
Browse files Browse the repository at this point in the history
  • Loading branch information
notlion committed Jun 18, 2009
0 parents commit e91386b
Show file tree
Hide file tree
Showing 48 changed files with 3,729 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
bin
92 changes: 92 additions & 0 deletions Rakefile
@@ -0,0 +1,92 @@
P5_MAIN_CLASS = "RakeP5Demo"

MIN_MEMORY_MB = "64m"
MAX_MEMORY_MB = "512m"


require 'rake'

task :default => :build

task :build, [:main_class] do |t, args|
args.with_defaults(:main_class => P5_MAIN_CLASS)

puts "\n## Building..."

start_secs = Time.now.to_f

Dir.mkdir("bin") unless File.exists?("bin")
Dir.mkdir("bin/classes") unless File.exists?("bin/classes")

system "javac -sourcepath src -cp \"#{library_classpath}\" -d bin/classes src/#{args.main_class}.java"

puts "## Built sketch in #{Time.now.to_f - start_secs} seconds."

# Stuff for Jar which isnt working yet
# sh "echo Main-Class: #{MAIN_CLASS}>bin/manifest"
# sh "jar cmf bin/manifest bin/#{MAIN_CLASS}.jar -C bin/classes ."
end

task :run, [:main_class] => :build do |t, args|
args.with_defaults(:main_class => P5_MAIN_CLASS)
run_sketch(args.main_class)
end

# task :run_fs => :build do
# run_sketch true
# end

task :clean do
rmfiles = ['bin/classes', 'bin/manifest', "bin/#{P5_MAIN_CLASS}.jar"]
rmfiles.each do |file|
sh "rm -rf #{file}" if File.exists?(file)
end
end


def run_sketch(main_class)
puts "\n## Running... Prepare for downcount.\n\n"

java_args = main_class

# if present
# java_args += " --present --exclusive --hide-stop"
# end

system "java -Xms#{MIN_MEMORY_MB} -Xmx#{MAX_MEMORY_MB} -cp \"#{library_classpath}:bin/classes\" -Djava.library.path=\"#{library_jnipath}\" processing.core.PApplet #{java_args}"

# Hmm running from Jar isn't working yet..
# sh "java -cp \"#{class_path}\" -jar bin/#{MAIN_CLASS}.jar #{MAIN_CLASS}"
end


def library_classpath()
cp_jars = Dir.glob(File.join('library', '*.jar')) # catch free floating jars

library_dirs.each do |dir|
# eventually work this in
# if File.exists?("#{dir}/export.txt")

cp_jars += Dir.glob(File.join(dir, '*.jar'))
end

return cp_jars.join(':')
end

def library_jnipath()
jni_dirs = [] # Native Library Folders

library_dirs.each do |dir|
jni_files = Dir.glob(File.join(dir, '*.jnilib'))

if jni_files.length > 0
jni_dirs << dir
end
end

return jni_dirs.join(':')
end

def library_dirs()
return Dir.glob(File.join('library', '**', 'library'))
end
Binary file added data/Helvetica-Bold-128.vlw
Binary file not shown.
11 changes: 11 additions & 0 deletions library/.svn/all-wcprops
@@ -0,0 +1,11 @@
K 25
svn:wc:ra_dav:version-url
V 31
/meshwalk/!svn/ver/12/trunk/lib
END
core.jar
K 25
svn:wc:ra_dav:version-url
V 40
/meshwalk/!svn/ver/12/trunk/lib/core.jar
END
75 changes: 75 additions & 0 deletions library/.svn/entries
@@ -0,0 +1,75 @@
9

dir
54
http://svn.onecm.com/meshwalk/trunk/lib
http://svn.onecm.com/meshwalk



2009-03-19T01:24:37.484418Z
12
ryan


svn:special svn:externals svn:needs-lock











e13ec501-5b54-0410-9cb1-ea4ea950c392






0

core.jar
file




2009-02-24T15:49:09.000000Z
9fdec8bee615bc8411a0118751269e13
2009-03-19T01:24:37.484418Z
12
ryan
has-props




















229713

opengl
dir

pdf
dir

1 change: 1 addition & 0 deletions library/.svn/format
@@ -0,0 +1 @@
9
5 changes: 5 additions & 0 deletions library/.svn/prop-base/core.jar.svn-base
@@ -0,0 +1,5 @@
K 13
svn:mime-type
V 24
application/octet-stream
END
Binary file added library/.svn/text-base/core.jar.svn-base
Binary file not shown.
Binary file added library/core.jar
Binary file not shown.
13 changes: 13 additions & 0 deletions library/opengl/.classpath
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/core"/>
<classpathentry kind="lib" path="library/jogl.jar" sourcepath="jogl-src.zip">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="opengl/library"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="library/gluegen-rt.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 changes: 17 additions & 0 deletions library/opengl/.project
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>opengl</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

0 comments on commit e91386b

Please sign in to comment.