Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Aparapi
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Luis Mendes
Aparapi
Commits
cc1b5bda
Commit
cc1b5bda
authored
12 years ago
by
Gary Frost
Browse files
Options
Downloads
Patches
Plain Diff
update nobody to work with latest jogl and mac osx
parent
1af60da1
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/nbody/.classpath
+1
-1
1 addition, 1 deletion
examples/nbody/.classpath
examples/nbody/build.xml
+0
-1
0 additions, 1 deletion
examples/nbody/build.xml
examples/nbody/src/com/amd/aparapi/examples/nbody/Main.java
+24
-6
24 additions, 6 deletions
examples/nbody/src/com/amd/aparapi/examples/nbody/Main.java
with
25 additions
and
8 deletions
examples/nbody/.classpath
+
1
−
1
View file @
cc1b5bda
...
...
@@ -5,6 +5,6 @@
<classpathentry
kind=
"con"
path=
"org.eclipse.jdt.junit.JUNIT_CONTAINER/4"
/>
<classpathentry
combineaccessrules=
"false"
kind=
"src"
path=
"/com.amd.aparapi"
/>
<classpathentry
kind=
"lib"
path=
"jogamp/gluegen-rt.jar"
/>
<classpathentry
kind=
"lib"
path=
"jogamp/jogl
.
all.jar"
/>
<classpathentry
kind=
"lib"
path=
"
/Users/garyfrost/aparapi/aparapi/trunk/examples/nbody/
jogamp/jogl
-
all.jar"
/>
<classpathentry
kind=
"output"
path=
"classes"
/>
</classpath>
This diff is collapsed.
Click to expand it.
examples/nbody/build.xml
+
0
−
1
View file @
cc1b5bda
...
...
@@ -3,7 +3,6 @@
<project
name=
"nbody"
default=
"build"
basedir=
"."
>
<!--<property name="jogamp-jar-url" value="http://jogamp.org/deployment/archive/rc/gluegen_28-joal_17-jogl_41-jocl_25/jar"/>-->
<property
name=
"jogamp-jar-url"
value=
"http://jogamp.org/deployment/archive/rc/gluegen_52-joal_32-jogl_66-jocl_41/jar"
/>
<path
id=
"compiler.class.path"
>
<pathelement
path=
"../../com.amd.aparapi/dist/aparapi.jar"
/>
<pathelement
path=
"jogamp/jogl-all.jar"
/>
...
...
This diff is collapsed.
Click to expand it.
examples/nbody/src/com/amd/aparapi/examples/nbody/Main.java
+
24
−
6
View file @
cc1b5bda
...
...
@@ -68,6 +68,7 @@ import com.amd.aparapi.ProfileInfo;
import
com.amd.aparapi.Range
;
import
com.jogamp.opengl.util.FPSAnimator
;
import
com.jogamp.opengl.util.texture.Texture
;
import
com.jogamp.opengl.util.texture.TextureData
;
import
com.jogamp.opengl.util.texture.TextureIO
;
/**
...
...
@@ -198,9 +199,11 @@ public class Main {
public
static
int
height
;
public
static
boolean
running
;
static
Texture
texture
;
public
static
void
main
(
String
_args
[])
{
//System.load("/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/libawt.dylib");
//System.load("/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/libjawt.dylib");
final
NBodyKernel
kernel
=
new
NBodyKernel
(
Range
.
create
(
Integer
.
getInteger
(
"bodies"
,
8192
)));
final
JFrame
frame
=
new
JFrame
(
"NBody"
);
...
...
@@ -276,7 +279,8 @@ public class Main {
public
void
display
(
GLAutoDrawable
drawable
)
{
final
GL2
gl
=
drawable
.
getGL
().
getGL2
();
texture
.
enable
(
gl
);
texture
.
bind
(
gl
);
gl
.
glLoadIdentity
();
gl
.
glClear
(
GL
.
GL_COLOR_BUFFER_BIT
|
GL
.
GL_DEPTH_BUFFER_BIT
);
gl
.
glColor3f
(
1
f
,
1
f
,
1
f
);
...
...
@@ -324,12 +328,26 @@ public class Main {
final
GL2
gl
=
drawable
.
getGL
().
getGL2
();
gl
.
glShadeModel
(
GLLightingFunc
.
GL_SMOOTH
);
gl
.
glEnable
(
GL
.
GL_BLEND
);
gl
.
glEnable
(
GL
.
GL_BLEND
);
gl
.
glBlendFunc
(
GL
.
GL_SRC_ALPHA
,
GL
.
GL_ONE
);
gl
.
glEnable
(
GL
.
GL_TEXTURE_2D
);
gl
.
glTexParameteri
(
GL
.
GL_TEXTURE_2D
,
GL
.
GL_TEXTURE_MAG_FILTER
,
GL
.
GL_LINEAR
);
gl
.
glTexParameteri
(
GL
.
GL_TEXTURE_2D
,
GL
.
GL_TEXTURE_MIN_FILTER
,
GL
.
GL_NEAREST
);
try
{
final
InputStream
textureStream
=
Main
.
class
.
getResourceAsStream
(
"particle.jpg"
);
final
Texture
texture
=
TextureIO
.
newTexture
(
textureStream
,
false
,
null
);
texture
.
enable
(
gl
);
TextureData
data
=
TextureIO
.
newTextureData
(
profile
,
textureStream
,
false
,
"jpg"
);
texture
=
TextureIO
.
newTexture
(
data
);
//final Texture texture = TextureIO.newTexture(textureStream, false, null);
// texture.enable(gl);
// texture.bind(gl);
// gl.glEnable(GL.GL_TEXTURE_2D);
//gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
//gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
// gl.glBindTexture(GL.GL_TEXTURE_2D, texture.);
}
catch
(
final
IOException
e
)
{
e
.
printStackTrace
();
}
catch
(
final
GLException
e
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment