Skip to content

Commit d8d827b

Browse files
committed
Revert "merging new files."
This reverts commit 1bda3f0.
1 parent 1bda3f0 commit d8d827b

File tree

340 files changed

+47946
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

340 files changed

+47946
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* Copyright (c) 2009-2023 jMonkeyEngine All rights reserved.
3+
*
4+
* Redistribution and use in source and binary forms, with or without modification, are permitted
5+
* provided that the following conditions are met:
6+
*
7+
* * Redistributions of source code must retain the above copyright notice, this list of conditions
8+
* and the following disclaimer.
9+
*
10+
* * Redistributions in binary form must reproduce the above copyright notice, this list of
11+
* conditions and the following disclaimer in the documentation and/or other materials provided with
12+
* the distribution.
13+
*
14+
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors may be used to endorse or
15+
* promote products derived from this software without specific prior written permission.
16+
*
17+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
18+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19+
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23+
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
24+
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25+
*/
26+
package com.jme3.system;
27+
28+
/**
29+
* This class holds information about the monitor that was returned by glfwGetMonitors() calls in
30+
* the context class
31+
*
32+
* @author Kevin Bales
33+
*/
34+
public class MonitorInfo {
35+
36+
/**
37+
* monitorID - monitor id that was return from Lwjgl3.
38+
*/
39+
public long monitorID = 0;
40+
41+
/**
42+
* width - width that was return from Lwjgl3.
43+
*/
44+
public int width = 1080;
45+
46+
/**
47+
* height - height that was return from Lwjgl3.
48+
*/
49+
public int height = 1920;
50+
51+
/**
52+
* rate - refresh rate that was return from Lwjgl3.
53+
*/
54+
public int rate = 60;
55+
56+
/**
57+
* primary - indicates if the monitor is the primary monitor.
58+
*/
59+
public boolean primary = false;
60+
61+
/**
62+
* name - monitor name that was return from Lwjgl3.
63+
*/
64+
public String name = "Generic Monitor";
65+
66+
}
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/*
2+
* Copyright (c) 2009-2023 jMonkeyEngine All rights reserved.
3+
*
4+
* Redistribution and use in source and binary forms, with or without modification, are permitted
5+
* provided that the following conditions are met:
6+
*
7+
* * Redistributions of source code must retain the above copyright notice, this list of conditions
8+
* and the following disclaimer.
9+
*
10+
* * Redistributions in binary form must reproduce the above copyright notice, this list of
11+
* conditions and the following disclaimer in the documentation and/or other materials provided with
12+
* the distribution.
13+
*
14+
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors may be used to endorse or
15+
* promote products derived from this software without specific prior written permission.
16+
*
17+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
18+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19+
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23+
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
24+
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25+
*/
26+
package com.jme3.system;
27+
28+
import java.util.ArrayList;
29+
30+
/**
31+
* This class holds all information about all monitors that where return from the glfwGetMonitors()
32+
* call. It stores them into an <ArrayList>
33+
*
34+
* @author Kevin Bales
35+
*/
36+
public class Monitors {
37+
38+
private ArrayList<MonitorInfo> monitors = new ArrayList<MonitorInfo>();
39+
40+
public int addNewMonitor(long monitorID) {
41+
MonitorInfo info = new MonitorInfo();
42+
info.monitorID = monitorID;
43+
monitors.add(info);
44+
return monitors.size() - 1;
45+
}
46+
47+
/**
48+
* This function returns the size of the monitor ArrayList
49+
*
50+
* @return the
51+
*/
52+
public int size() {
53+
return monitors.size();
54+
}
55+
56+
/**
57+
* Call to get monitor information on a certain monitor.
58+
*
59+
* @param pos the position in the arraylist of the monitor information that you want to get.
60+
* @return returns the MonitorInfo data for the monitor called for.
61+
*/
62+
public MonitorInfo get(int pos) {
63+
if (pos < monitors.size())
64+
return monitors.get(pos);
65+
66+
return null;
67+
}
68+
69+
/**
70+
* Set information about this monitor stored in monPos position in the array list.
71+
*
72+
* @param monPos arraylist position of monitor to update
73+
* @param width the current width the monitor is displaying
74+
* @param height the current height the monitor is displaying
75+
* @param rate the current refresh rate the monitor is set to
76+
*/
77+
public void setInfo(int monPos, String name, int width, int height, int rate) {
78+
if (monPos < monitors.size()) {
79+
MonitorInfo info = monitors.get(monPos);
80+
if (info != null) {
81+
info.width = width;
82+
info.height = height;
83+
info.rate = rate;
84+
info.name = name;
85+
}
86+
}
87+
}
88+
89+
/**
90+
* This function will mark a certain monitor as the primary monitor.
91+
*
92+
* @param monPos the position in the arraylist of which monitor is the primary monitor
93+
*/
94+
public void setPrimaryMonitor(int monPos) {
95+
if (monPos < monitors.size()) {
96+
MonitorInfo info = monitors.get(monPos);
97+
if (info != null)
98+
info.primary = true;
99+
}
100+
101+
}
102+
103+
104+
105+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright (c) 2009-2021 jMonkeyEngine
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are
7+
* met:
8+
*
9+
* * Redistributions of source code must retain the above copyright
10+
* notice, this list of conditions and the following disclaimer.
11+
*
12+
* * Redistributions in binary form must reproduce the above copyright
13+
* notice, this list of conditions and the following disclaimer in the
14+
* documentation and/or other materials provided with the distribution.
15+
*
16+
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
17+
* may be used to endorse or promote products derived from this software
18+
* without specific prior written permission.
19+
*
20+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
*/
32+
33+
package jme3test.app.state;
34+
35+
import com.jme3.app.state.AbstractAppState;
36+
import com.jme3.scene.Node;
37+
38+
public class RootNodeState extends AbstractAppState {
39+
40+
final private Node rootNode = new Node("Root Node");
41+
42+
public Node getRootNode(){
43+
return rootNode;
44+
}
45+
46+
@Override
47+
public void update(float tpf) {
48+
super.update(tpf);
49+
50+
rootNode.updateLogicalState(tpf);
51+
rootNode.updateGeometricState();
52+
}
53+
54+
}
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/*
2+
* Copyright (c) 2009-2022 jMonkeyEngine
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are
7+
* met:
8+
*
9+
* * Redistributions of source code must retain the above copyright
10+
* notice, this list of conditions and the following disclaimer.
11+
*
12+
* * Redistributions in binary form must reproduce the above copyright
13+
* notice, this list of conditions and the following disclaimer in the
14+
* documentation and/or other materials provided with the distribution.
15+
*
16+
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
17+
* may be used to endorse or promote products derived from this software
18+
* without specific prior written permission.
19+
*
20+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
*/
32+
33+
package jme3test.app.state;
34+
35+
import com.jme3.app.LegacyApplication;
36+
import com.jme3.niftygui.NiftyJmeDisplay;
37+
import com.jme3.scene.Spatial;
38+
import com.jme3.system.AppSettings;
39+
import com.jme3.system.JmeContext;
40+
import com.jme3.texture.image.ColorSpace;
41+
import jme3test.niftygui.StartScreenController;
42+
43+
public class TestAppStates extends LegacyApplication {
44+
45+
public static void main(String[] args){
46+
TestAppStates app = new TestAppStates();
47+
app.start();
48+
}
49+
50+
@Override
51+
public void start(JmeContext.Type contextType){
52+
AppSettings settings = new AppSettings(true);
53+
settings.setResolution(1024, 768);
54+
setSettings(settings);
55+
56+
super.start(contextType);
57+
}
58+
59+
@Override
60+
public void initialize(){
61+
super.initialize();
62+
63+
System.out.println("Initialize");
64+
65+
RootNodeState state = new RootNodeState();
66+
viewPort.attachScene(state.getRootNode());
67+
stateManager.attach(state);
68+
69+
Spatial model = assetManager.loadModel("Models/Teapot/Teapot.obj");
70+
model.scale(3);
71+
model.setMaterial(assetManager.loadMaterial("Interface/Logo/Logo.j3m"));
72+
state.getRootNode().attachChild(model);
73+
74+
ColorSpace colorSpace = renderer.isMainFrameBufferSrgb()
75+
? ColorSpace.sRGB : ColorSpace.Linear;
76+
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager,
77+
inputManager,
78+
audioRenderer,
79+
guiViewPort,
80+
colorSpace);
81+
StartScreenController startScreen = new StartScreenController(this);
82+
niftyDisplay.getNifty().fromXml("Interface/Nifty/HelloJme.xml", "start",
83+
startScreen);
84+
guiViewPort.addProcessor(niftyDisplay);
85+
}
86+
87+
@Override
88+
public void update(){
89+
super.update();
90+
91+
// do some animation
92+
float tpf = timer.getTimePerFrame();
93+
94+
stateManager.update(tpf);
95+
stateManager.render(renderManager);
96+
97+
// render the viewports
98+
renderManager.render(tpf, context.isRenderable());
99+
}
100+
101+
@Override
102+
public void destroy(){
103+
super.destroy();
104+
105+
System.out.println("Destroy");
106+
}
107+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2021 jMonkeyEngine
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are
7+
* met:
8+
*
9+
* * Redistributions of source code must retain the above copyright
10+
* notice, this list of conditions and the following disclaimer.
11+
*
12+
* * Redistributions in binary form must reproduce the above copyright
13+
* notice, this list of conditions and the following disclaimer in the
14+
* documentation and/or other materials provided with the distribution.
15+
*
16+
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
17+
* may be used to endorse or promote products derived from this software
18+
* without specific prior written permission.
19+
*
20+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
*/
32+
/**
33+
* example apps and non-automated tests for appstates
34+
*/
35+
package jme3test.app.state;

0 commit comments

Comments
 (0)