Thank you EgonOlsen for you hints. I'll continue to dig into this issue...
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: java.lang.NullPointerException
at com.threed.jpct.AWTJPCTCanvas.paintGL(AWTJPCTCanvas.java:238)
at org.lwjgl.opengl.AWTGLCanvas.paint(AWTGLCanvas.java:339)
at org.lwjgl.opengl.AWTGLCanvas.update(AWTGLCanvas.java:368)
at java.desktop/sun.awt.RepaintArea.updateComponent(RepaintArea.java:255)
at java.desktop/sun.awt.RepaintArea.paint(RepaintArea.java:232)
at java.desktop/sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:358)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5073)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4844)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.NullPointerException
at org.lwjgl.BufferChecks.checkDirect(BufferChecks.java:126)
at org.lwjgl.opengl.GL11.glDrawElements(GL11.java:1101)
at com.threed.jpct.CompiledInstance.render(CompiledInstance.java:732)
at com.threed.jpct.AWTGLRenderer.drawVertexArray(AWTGLRenderer.java:1349)
at com.threed.jpct.AWTJPCTCanvas.paintGL(AWTJPCTCanvas.java:198)
... 24 more
addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
resizeRenderer(getSize());
}
});
public void setupWorld() {
...
HashSet<Element> nonBatched = new HashSet<>();
// add non batched elements here
...
worldObject = Object3D.createDummyObj();
for (Group group : getElementGroups()) {
List<Object3D> objects = new ArrayList<Object3D>();
for (Element element : group.getElements()) {
try {
Object3D object = new Object3D(0);
element.setObject3D(object);
if (element.isBatchEnabled() && !nonBatched.contains(element)) {
objects.add(object);
} else {
object.setAdditionalColor(RGBColor.white);
object.compile(true, true, true, true, 8000);
world.addObject(object);
group.addObject3D(object);
}
} catch (Exception e) {
_log.error("Unable to create Object3D for element : " + element, e);
}
}
Object3D object = null;
if (objects.size() > 0) {
object = Object3D.mergeAll(objects.toArray(new Object3D[objects.size()]));
object.setTexture(TextureHandler.ELEMENTS_TEXTURENAME);
object.setName(group.getName());
object.setVisibility(group.isVisible());
object.setAdditionalColor(Color.white);
object.compileAndStrip();
world.addObject(object);
worldObject.addChild(object);
group.addObject3D(object);
}
}
...
}
...
protected void setupFrameBuffer(Dimension size) {
Dimension framebufferSize = size == null ? Toolkit.getDefaultToolkit().getScreenSize() : size;
_buffer = new FrameBuffer(framebufferSize.width, framebufferSize.height, FrameBuffer.SAMPLINGMODE_NORMAL);
_frameBufferBGColor = DEFAULT_FRAMEBUFFER_BG_COLOR;
_buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
_buffer.enableRenderer(IRenderer.RENDERER_OPENGL);
_canvas = _buffer.enableGLCanvasRenderer();
_textureHandler.setFrameBuffer(_buffer);
_textureHandler.setCanvas(_canvas);
getNotifier().rendererInitialized(_canvas);
}
...
public void updateFrameBuffer() {
_performanceStatistics.incrementFPS();
_performanceStatistics.startMethod();
_buffer.clear(_frameBufferBGColor);
world.renderScene(_buffer);
world.draw(_buffer);
_textureHandler.blit();
_buffer.update();
_videoHandler.encodeFrame(_currentDate);
_buffer.displayGLOnly();
_canvas.repaint();
_performanceStatistics.endDrawMethod();
}
Page created in 0.030 seconds with 12 queries.