Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / JOGL Development / Re: PBuffers. How to? on: 2005-04-03 09:33:46
thank you kind sir

would the new extension be appearing in jogl in the future?   Wink
2  Java Game APIs & Engines / JOGL Development / Re: PBuffers. How to? on: 2005-04-01 12:41:38
is it possible to render 2 images to 2 textures using jogl pbuffers, and use the resulting textures in my main glcanvas

how would i pass along these textures? the javadoc just says the pbuffer binds to its internal texture, and sadly, doesn't say how i can access it thereafter  Huh or am i just reading it wrong
3  Java Game APIs & Engines / JOGL Development / Point sprites on: 2005-03-14 17:46:10
Has anyone made anything invovling textured point sprites? I can't find any examples anywhere, apart from c++ that i've tried to convert

the points are easy to do, but texture mapping isn't working for me  Embarrassed
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
public void display(GLDrawable drawable) {
       
        //GLUT glut = new GLUT();
       
        /*float[] ambientDiffuse = {0f,0.7f,0f,1f};
        gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, ambientDiffuse);*/

       
        gl.glEnable(GL.GL_TEXTURE_2D);
        gl.glTexEnvf(GL.GL_POINT_SPRITE_NV, GL.GL_COORD_REPLACE_NV, GL.GL_TRUE);
        gl.glBindTexture(GL.GL_TEXTURE_2D, spriteTexture[0]);
       
        gl.glEnable(GL.GL_POINT_SPRITE_NV);
       
        gl.glPointSize(50f);
       
        gl.glBegin(GL.GL_POINTS);
            gl.glVertex3i(0,0,0);
        gl.glEnd();
       
       
        gl.glDisable(GL.GL_POINT_SPRITE_NV);
        gl.glDisable(GL.GL_TEXTURE_2D);
       
    }


texture part of init()
1  
2  
3  
4  
5  
6  
7  
gl.glGenTextures(1, spriteTexture);
        gl.glBindTexture(GL.GL_TEXTURE_2D, spriteTexture[0]);
        gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
        gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
        gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, nameTexture.getBands(),
                         nameTexture.getWidth(), nameTexture.getHeight(), 0,
                         GL.GL_RGBA, GL.GL_BYTE, nameTexture.getTexture());
4  Java Game APIs & Engines / JOGL Development / Re: Installation queries on: 2005-03-08 14:49:00
cheers daire

doh, i don't always immediately think 'UNZIP!' when i see a jar file. silly me  Embarrassed
5  Java Game APIs & Engines / JOGL Development / Re: Cg profile trouble on: 2005-03-08 11:42:30
HAZAA IT WORKS AT LAST!

cheers for the help folks, maybe i'll be an advice-giver one day  Cool
6  Java Game APIs & Engines / JOGL Development / Re: Cg profile trouble on: 2005-03-08 08:58:03
Quote
you're a star gregof, cheers mate  Grin

wierd follow on problem. jogl works fine on my win98, but comes up with "UnsatisfiedLinkError: CreateDummyWindow" on win2000 and xp platforms  Huh

anyone experienced this?



ignore that, sorted it by using newer dll. managed to get it working using arbvp1 profile, but no colours  Angry

"Warning: Profile option 'NumTemps=' value (65535) too large; clamped to 32."
*sigh* a little bit at a time...  Roll Eyes
7  Java Game APIs & Engines / JOGL Development / Re: Installation queries on: 2005-03-07 21:39:41
new dlls? the only ones i can find are in the 2003 download folder  Huh
8  Java Game APIs & Engines / JOGL Development / Re: Cg profile trouble on: 2005-03-06 18:28:22
you're a star gregof, cheers mate  Grin

wierd follow on problem. jogl works fine on my win98, but comes up with "UnsatisfiedLinkError: CreateDummyWindow" on win2000 and xp platforms  Huh

anyone experienced this?
9  Java Game APIs & Engines / JOGL Development / Re: Cg profile trouble on: 2005-03-03 13:47:04
Quote
Yes, I have done both vertex and fragment programs using cg in JOGL and know several others. Have you tried compiling your vertex program from the commandline to see if it is correct? can you post your test.cg file too?

// Gregof


the command line compiles using all the different profiles all worked, but here's the code anyway:
1  
2  
3  
4  
5  
6  
7  
8  
9  
void main(      float4 iPosition      : POSITION,
            float4 iColour      : COLOR,
            out float4 oPosition      : POSITION,
            out float4 oColour      : COLOR,
            uniform      float4x4 modelviewProjection)
{
      oPosition = mul(modelviewProjection, iPosition);
      oColour = iColour;
}


as you can see, i'm only transforming to clip space. from messing about debugging, i also noticed that the same cryptic error comes up from cgGLLoadProgram() if i specify what profile to use in the java code. the error messages are about as helpful as Haskell( Shocked) ones!
10  Java Game APIs & Engines / JOGL Development / Re: Cg profile trouble on: 2005-03-03 09:37:58
has anyone got cg working on jogl at all?  Cry
11  Java Game APIs & Engines / JOGL Development / Re: Cg profile trouble on: 2005-03-02 16:03:10
i wouldn't be surprised  Roll Eyes

cheers for the help people!
12  Java Game APIs & Engines / JOGL Development / Re: Cg profile trouble on: 2005-03-02 15:48:23
i've been trying to build those for months. one error after another with them, so i gave up

edit: just d/l'd that one, same error  Sad
13  Java Game APIs & Engines / JOGL Development / Re: Cg profile trouble on: 2005-03-02 15:18:07
oops, forgot to say that i've tried on geforce5200fx and radeon9600  Roll Eyes  using jogl 2003 build
14  Java Game APIs & Engines / JOGL Development / Cg profile trouble on: 2005-03-02 15:15:48
i've tried making a simple vertex prog, but i get a runtime error: "profile not supported"

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
/*
* Noise3dFrame.java
*
* Created on 25 November 2004, 12:59
*/

import java.awt.*;
import java.awt.event.*;
import net.java.games.jogl.*;
import net.java.games.jogl.util.*;
import net.java.games.cg.*;
/**
*
* @author  Neil Medforth
*/

public class Noise3dFrame extends Frame implements GLEventListener {

    private static CGcontext context = null;
    private static CGprogram program = null;
    private static int profile;
    private static CGparameter matrixHandle = null;

    static void checkCgError() {
        int error = CgGL.cgGetError();
        if (error != CgGL.CG_NO_ERROR) {
            System.out.println(CgGL.cgGetErrorString(error));
            System.exit(0);
        }
    }



    private net.java.games.jogl.GLCanvas canvas;

    public Noise3dFrame() {
        setSize(600,600);
        setTitle("JOGL Hello World");

        addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            System.exit(0);
          }
        });

        canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
        canvas.addGLEventListener(this);
        add(canvas, BorderLayout.CENTER);
        setVisible(true);
    }

    public static void main(String[] args) {
        context = CgGL.cgCreateContext();
        checkCgError();

      profile = CgGL.cgGLGetLatestProfile(CgGL.CG_GL_VERTEX);
      CgGL.cgGLSetOptimalOptions(profile);
      checkCgError();

        program = CgGL.cgCreateProgramFromFile(context,CgGL.CG_SOURCE,"test.cg",
                                                profile,"main",null);
        checkCgError();
        if(program != null){
            CgGL.cgGLLoadProgram(program);
            matrixHandle = CgGL.cgGetNamedParameter(program, "modelviewProjection");
            checkCgError();
        }

        new Noise3dFrame();

        CgGL.cgDestroyProgram(program);
        CgGL.cgDestroyContext(context);
    }


    /*******************************************
     *** GLEventListener implementations *******
     ******************************************/


    public void display(GLDrawable drawable) {

      CgGL.cgGLSetStateMatrixParameter(matrixHandle, CgGL.CG_GL_MODELVIEW_PROJECTION_MATRIX,
                                    CgGL.CG_GL_MATRIX_IDENTITY);
      CgGL.cgGLEnableProfile(profile);
        checkCgError();
        CgGL.cgGLBindProgram(program);
        checkCgError();
       

        GL gl = drawable.getGL();
        //GLUT glut = new GLUT();

        float[] matAmbientDiffuse = {0f,0.7f,0f,1f};
        float[] matSpecular = {0f,0f,0f,0f};
        float[] matEmission = {0f,0f,0f,1f};
        gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, matAmbientDiffuse);
        gl.glMaterialfv(GL.GL_FRONT, GL.GL_SPECULAR, matSpecular);
        gl.glMaterialfv(GL.GL_FRONT, GL.GL_EMISSION, matEmission);

        gl.glBegin(GL.GL_TRIANGLES);
            gl.glVertex3i(-2,0,0);
            gl.glVertex3i(2,0,0);
            gl.glVertex3i(0,2,0);
        gl.glEnd();

        CgGL.cgGLDisableProfile(profile);
    }

    public void displayChanged(GLDrawable drawable, boolean param, boolean param2) {}

    public void init(GLDrawable drawable) {
        GL gl = drawable.getGL();
        GLU glu = drawable.getGLU();

        gl.glClearColor(0,0,0,1);
        //gl.glEnable(GL.GL_DEPTH_TEST);
       gl.glEnable(GL.GL_CULL_FACE);
        gl.glCullFace(GL.GL_BACK);
        gl.glShadeModel(GL.GL_SMOOTH);
        gl.glClear(GL.GL_COLOR_BUFFER_BIT|GL.GL_DEPTH_BUFFER_BIT);
        gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.GL_FILL);
        gl.glEnable(GL.GL_NORMALIZE);
        gl.glEnable(GL.GL_LIGHTING);

        /*
         * Initialise Light0
         */

        gl.glEnable(GL.GL_LIGHT0);
        float[] lightPosition = {0f,1f,1f,0f};
        float[] ambient = {0.6f,0.6f,0.6f,1f};
        float[] whiteLight = {1f,1f,1f,1f};
        gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, lightPosition);
        gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient);
        gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, whiteLight);
        gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, whiteLight);

        /*
         * Viewing System
         */

        gl.glViewport(0, 0, getWidth(), getHeight());
        gl.glMatrixMode(GL.GL_PROJECTION);
        gl.glLoadIdentity();
        gl.glFrustum(-1, 1, -1, 1, 1.0, 25.0);

        gl.glMatrixMode(GL.GL_MODELVIEW);
        gl.glLoadIdentity();
        glu.gluLookAt(1.0,2.0,3.0, 0.0,0.0,0.0, 0.0,1.0,0.0);
    }

    public void reshape(GLDrawable drawable, int x, int y, int width, int height) {}

}


i've also tried explicitly naming the profile, trying all the different ones like ARBVP1,VP20 and VS_1_1 etc. this leads me to think that it might not be a profile problem at all, and just the error reporter being an arse (for non-british, read "ass"  Grin)

any ideas?
15  Java Game APIs & Engines / JOGL Development / build xml troubles... on: 2005-02-15 12:56:10
i got the jogl.dev.java.net  most recent release of JOGL. ie 1.1b08 february 2005 . using java 1.4.1

unfortunately when i type the command "ant -Djogl.cg=1 win32.vc6", the build fails due to problem after problem in the build.xml file.
such as:
unexpected typedef
cannot use zipgroupfileset in jar task
cannot create task of type dirset

i try to rectify them, but other problems just pop up  Huh

i've checked that all the paths in my batch file and properties file are correct, and everything is in place. should i try an earlier jogl release instead? or is there something else i should try? if anyone needs more facts, ask away

cheers, angry Med
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (26 views)
2014-07-24 01:59:36

Riven (25 views)
2014-07-23 21:16:32

Riven (20 views)
2014-07-23 21:07:15

Riven (22 views)
2014-07-23 20:56:16

ctomni231 (51 views)
2014-07-18 06:55:21

Zero Volt (46 views)
2014-07-17 23:47:54

danieldean (37 views)
2014-07-17 23:41:23

MustardPeter (40 views)
2014-07-16 23:30:00

Cero (56 views)
2014-07-16 00:42:17

Riven (55 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!