Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Help me out  (Read 1266 times)
0 Members and 1 Guest are viewing this topic.
Offline Java Cool Dude

Senior Duke




Java forever


« Posted 2004-01-24 02:57:48 »

Alright, so I decide to implement Vertex and Pixel Shaders using Xith3D and binding the programs in a process that is close to Texture binding.
I fire up netbeans, go to G:\Xith3D\xith3d\src\com\xith3d\scenegraph, create an abstract ShaderProgram class, and then a VertexProgram class that extends it and try to compile it.
Nada, I'm greeted with the following error message
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
G:\Xith3D\xith3d\src\com\xith3d\scenegraph\VertexProgram.java:50: cannot resolve symbol
symbol  : class ShaderProgram
location: class com.xith3d.scenegraph.VertexProgram
public class VertexProgram extends ShaderProgram {
                                   ^
G:\Xith3D\xith3d\src\com\xith3d\scenegraph\VertexProgram.java:73: cannot resolve symbol
symbol  : variable super
location: class com.xith3d.scenegraph.VertexProgram
        super.duplicateNodeComponent(original,forceDuplicate);
        ^
2 errors


I scratch my head thinking to myself, maybe I didn't spell the name right? But I wasn't that careless to do such mistake, everything looked and felt just fine, and yet I couldn't compile sh|t.
So I load up Texture2D from the same directory, rename it to TextureTest and made the constructors changes accordingly, compiled just fine. However, trying to declare a TextureTest variable in any other class that is in the same directory would return a cannot resolve symbol error message...
This never happened to me before, and it drives me totally insane.
PS: This is a brand new pc that I built myself

Tool completed with exit code 1
Offline Java Cool Dude

Senior Duke




Java forever


« Reply #1 - Posted 2004-01-24 02:59:11 »

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  
/*
 * VertexProgram.java
 *
 * Created on January 24, 2004, 12:44 AM
 */


package com.xith3d.scenegraph;

/**
 *
 * @author  Abdul
 */

/**
 * Copyright (c) 2003, Xith3D Project Group
 * All rights reserved.
 *
 * Portions based on the Java3D interface, Copyright by Sun Microsystems.
 * Many thanks to the developers of Java3D and Sun Microsystems for their
 * innovation and design.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 *
 * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 *
 * Neither the name of the 'Xith3D Project Group' nor the names of its contributors
 * may be used to endorse or promote products derived from this software
 * without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) A
 * RISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE
 *
 */

import javax.vecmath.Vector4f;

public class VertexProgram extends ShaderProgram {

    public VertexProgram() {
        super("!!ARBvp1.0 \n END");
    }

    public VertexProgram(String   vertexProgram) {
        super(vertexProgram);
    }

    public VertexProgram(String   vertexProgram,
                         Vector4f parameters[]) {
        super(vertexProgram, parameters);
    }
    public VertexProgram(String   vertexProgram,
                         Vector4f parameters[],
                         boolean  enabled) {
        super(vertexProgram, parameters, enabled);
    }
    /**
     * @see com.xith3d.scenegraph.NodeComponent#duplicateNodeComponent(com.xith3d.scenegraph.NodeComponent, boolean)
     */

    public void duplicateNodeComponent(NodeComponent original, boolean forceDuplicate) {
        super.duplicateNodeComponent(original,forceDuplicate);
    }

    /**
     * @see com.xith3d.scenegraph.NodeComponent#cloneNodeComponent(boolean)
     */

    public NodeComponent cloneNodeComponent(boolean forceDuplicate) {
        VertexProgram vp = new VertexProgram();
        vp.duplicateNodeComponent(this, forceDuplicate);
        return vp;
    }

}


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  
151  
152  
153  
154  
155  
156  
/**
 * Copyright (c) 2003, Xith3D Project Group
 * All rights reserved.
 *
 * Portions based on the Java3D interface, Copyright by Sun Microsystems.
 * Many thanks to the developers of Java3D and Sun Microsystems for their
 * innovation and design.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 *
 * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 *
 * Neither the name of the 'Xith3D Project Group' nor the names of its contributors
 * may be used to endorse or promote products derived from this software
 * without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) A
 * RISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE
 *
 */

package com.xith3d.scenegraph;

import java.nio.*;
import javax.vecmath.Vector4f;

abstract public class ShaderProgram extends NodeComponent {

    static long SH_PRO_STATE_ID_SEQ = 0;
    // Create an IntBuffer for the shaderProgram name
    private IntBuffer shaderProgramNames = null;
    // Get vertexProgram name address
    private int shaderProgramNameAddr = 0;

    private String   shaderProgram              = "";
    private boolean  enabled                    = true;
    private Vector4f shaderProgramParameters[]  = null;

    private Object  shaderProgramHandleCanvasID = null;
    private int     shaderProgramHandle = -1;
    private long    shProStateId;
    private boolean dirty = false;


    public ShaderProgram() {
        super();
        shProStateId = SH_PRO_STATE_ID_SEQ++;
    }


    public ShaderProgram(String shaderProgram){
      this();
      this.shaderProgram = shaderProgram;
    }

    public ShaderProgram(String    shaderProgram,
                        Vector4f[] parameters){
      this();
      this.shaderProgram = shaderProgram;
      shaderProgramParameters = new Vector4f[parameters.length];
      for(int i = 0; i < parameters.length; i++)
        shaderProgramParameters[i] = new Vector4f(parameters[i]);
    }

    public ShaderProgram(String     shaderProgram,
                         Vector4f[] parameters,
                         boolean    shaderState){
      this();
      shaderProgramParameters = new Vector4f[parameters.length];

      for(int i = 0; i < parameters.length; i++)
        shaderProgramParameters[i] = new Vector4f(parameters[i]);

      enabled = shaderState;
    }

    public final void setShaderProgram(String shaderProgram){
      this.shaderProgram = shaderProgram;
      dirty = true;
    }

    public final void setEnabled(boolean programState){
      enabled = programState;
    }

    public final void setParameters(Vector4f[] parameters){
      shaderProgramParameters = new Vector4f[parameters.length];
      for(int i = 0; i < parameters.length; i++)
        shaderProgramParameters[i] = new Vector4f(parameters[i]);

      dirty = true;
    }

    public String getShaderProgram(){
      return shaderProgram;
    }

    public boolean isEnabled(){
      return enabled;
    }

    public Vector4f[] getParameters(){
      Vector4f parameters[] = new Vector4f[shaderProgramParameters.length];

      for(int i = 0; i < parameters.length; i++)
        parameters[i] = new Vector4f(shaderProgramParameters[i]);

      return parameters;
    }

    public boolean isDirty() {
        return dirty;
    }

    public void setDirty( boolean dirty ) {
        this.dirty = dirty;
    }

    public int getShaderProgramHandle(Object shaderProgramHandleCanvasID) {
        if (this.shaderProgramHandleCanvasID == shaderProgramHandleCanvasID)
            return shaderProgramHandle;
        else
            return -1;
    }

    /**
     * @see com.xith3d.scenegraph.NodeComponent#duplicateNodeComponent(com.xith3d.scenegraph.NodeComponent, boolean)
     */

    public void duplicateNodeComponent(NodeComponent original, boolean forceDuplicate) {
        super.duplicateNodeComponent(original,forceDuplicate);
        throw new UnsupportedOperationException("Not implemented yet");
    }

        /**
         * returns the state ID used to sort the item
         * @return
         */

        public long getStateId() {
            return shProStateId;
        }

}

PS: Could someone with Xith3D source installed on his pc try and compile the two previous classes in the mentioned directory.
Thanks
Offline Jeff

JGO Coder




Got any cats?


« Reply #2 - Posted 2004-01-24 03:06:49 »

This looks like it belongs  in the xith forum at first glance.

JK

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline abies

Senior Duke





« Reply #3 - Posted 2004-01-24 08:20:44 »

Works for me without problem. I think that for some reason you have project classpath/sourcepath mixed up. I think that you would get same effect if you would run javac inside  G:\Xith3D\xith3d\src\com\xith3d\scenegraph directory instead of  G:\Xith3D\xith3d\src\

I have not used netbeans since 3 years, so I cannot tell you what settings you need to correct, but first try sanity test - compile everything with javac from G:\Xith3D\xith3d\src\ directory. If it will work, then you can be sure that it is netbeans configuration fault.

Artur Biesiadowski
Offline Java Cool Dude

Senior Duke




Java forever


« Reply #4 - Posted 2004-01-24 09:31:44 »

If failed on me again Cry
Damn I wonder why making a class by totally copying another one and modifying the title as well as the constructors would result in such error.
Every other class that comes with xith3D works and compiles just fine.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (43 views)
2014-10-16 15:22:06

Norakomi (33 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (67 views)
2014-10-14 00:35:47

TehJavaDev (60 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (86 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!