/*
- * Sixth 3D engine. Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General Public License
public static final int bufferedImageType = BufferedImage.TYPE_4BYTE_ABGR;
- public final BufferedImage bufferedImage;
+ final BufferedImage bufferedImage;
public final Graphics2D graphics;
- public final byte[] bytes;
+ public final byte[] pixels;
public final int width;
public final int height;
*/
public boolean doRender = true; // TODO: make use of the variable
+ /**
+ * Mouse click. During rendering we can detect which item user clicked on.
+ */
public MouseClick mouseClick;
+ /**
+ * Item that user clicked on.
+ */
public MouseInteractionController clickedItem;
- public RenderingContext(final int width, final int height,
- final RenderingContext oldContext) {
-
+ public RenderingContext(final int width, final int height) {
this.width = width;
this.height = height;
final WritableRaster raster = bufferedImage.getRaster();
final DataBufferByte dbi = (DataBufferByte) raster.getDataBuffer();
- bytes = dbi.getData();
+ pixels = dbi.getData();
graphics = (Graphics2D) bufferedImage.getGraphics();
-
- graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_ON);
-
- graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
- RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
-
- if (oldContext != null) {
- mouseClick = oldContext.mouseClick;
- clickedItem = oldContext.clickedItem;
- }
+ graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+ graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
}
}