Class RenderingContext

java.lang.Object
eu.svjatoslav.sixth.e3d.gui.RenderingContext

public class RenderingContext extends Object
Rendering context that contains all the information that is needed to render the scene.
  • Field Details

    • bufferedImageType

      public static final int bufferedImageType
      See Also:
    • graphics

      public final Graphics2D graphics
    • pixels

      public final byte[] pixels
      Pixels of the rendering area. Each pixel is represented by 4 bytes: alpha, blue, green, red.
    • width

      public final int width
      Width of the rendering area in pixels.
    • height

      public final int height
      Height of the rendering area in pixels.
    • centerCoordinate

      public final Point2D centerCoordinate
      Center of the screen in screen space (pixels). This is the point where (0,0) coordinate of the world space is rendered.
    • zoom

      public final double zoom
      Zoom factor. The bigger the value, the more zoomed in the view is.
    • frameNumber

      public int frameNumber
      Number of frame that is currently being rendered. Every frame has its own number.
  • Constructor Details

    • RenderingContext

      public RenderingContext(int width, int height)
  • Method Details

    • prepareForNewFrameRendering

      public void prepareForNewFrameRendering()
    • getMouseEvent

      public MouseEvent getMouseEvent()
    • setMouseEvent

      public void setMouseEvent(MouseEvent mouseEvent)
    • setCurrentObjectUnderMouseCursor

      public void setCurrentObjectUnderMouseCursor(MouseInteractionController currentObjectUnderMouseCursor)
      Called when given object was detected under mouse cursor, while processing mouseEvent. Because objects are rendered back to front. The last method caller will set the top-most object, if there are multiple objects under mouse cursor.
    • handlePossibleComponentMouseEvent

      public boolean handlePossibleComponentMouseEvent()
      Returns:
      true if view update is needed as a consequence of this mouse event.