30 lines
1.1 KiB
Java
30 lines
1.1 KiB
Java
|
|
package com.chuangzhou.vivid2D.test;
|
||
|
|
|
||
|
|
import com.chuangzhou.vivid2D.render.ModelGLPanel;
|
||
|
|
import com.chuangzhou.vivid2D.render.model.Model2D;
|
||
|
|
|
||
|
|
import javax.swing.*;
|
||
|
|
|
||
|
|
public class TestModelGLPanel {
|
||
|
|
|
||
|
|
private static final String MODEL_PATH = "C:\\Users\\Administrator\\Desktop\\trump_texture.model";
|
||
|
|
public static void main(String[] args) {
|
||
|
|
SwingUtilities.invokeLater(() -> {
|
||
|
|
JFrame frame = new JFrame("ModelGLPanel Demo");
|
||
|
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||
|
|
//com.chuangzhou.vivid2D.render.model.Model2D model = com.chuangzhou.vivid2D.render.model.Model2D.loadFromFile(MODEL_PATH);
|
||
|
|
ModelGLPanel glPanel = null;
|
||
|
|
try {
|
||
|
|
Model2D model2D = new Model2D("Hi");
|
||
|
|
glPanel = new ModelGLPanel(MODEL_PATH, 800, 600);
|
||
|
|
} catch (Exception e) {
|
||
|
|
throw new RuntimeException(e);
|
||
|
|
}
|
||
|
|
frame.add(glPanel);
|
||
|
|
frame.pack();
|
||
|
|
frame.setLocationRelativeTo(null);
|
||
|
|
frame.setVisible(true);
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|