Package-level declarations

Types

Link copied to clipboard
interface Backend

All drawing operations are done from here. By having this as an interface, this lets us have different backends, which leaves open the possibility of creating a multi-platform kotlin project with a different Backend for the js platform for use in a browser.

Link copied to clipboard

A Backend used for unit-testing, which renders nothing. By having a backend which doesn't actually render anything, unit tests which are not testing the actual display output do not need to create a window, or use OpenGL.

Link copied to clipboard

A dummy implementation of Window, used for unit-testing. See DummyBackend.

Link copied to clipboard
data class GlokRect(val left: Float, val top: Float, val right: Float, val bottom: Float)

A rectangle using Floats. Used to pass rectangles from Glok's core to the Backend.

Link copied to clipboard
class LoggingBackend(val inner: Backend, val log: Log) : Backend

Logs calls to the Backend, and the forwards the calls to an inner.

Link copied to clipboard
class PartialTexture(val texture: Texture, val srcX: Float, val srcY: Float, val imageWidth: Float, val imageHeight: Float) : Image

Defines a rectangular region of a Texture as an Image. For example, it is common to place many icons in a single .png file, which is loaded as a single Texture. Each icon is then defined using PartialTexture.

Link copied to clipboard
interface Resources

An abstraction for loading resources, without needing to know the ultimate source of those resources. At time of writing, the only implementation is GLJarResources, though another implementation which loads from the filesystem would also be useful.

Link copied to clipboard
class ScaledPartialTexture(val partialTexture: PartialTexture, val scaleX: Float, val scaleY: Float) : Image

Defines a rectangular region of a Texture as an Image, but its size is reported scaled. i.e. a 64x64 image, scaled by 0.5 will report is size to be 32x32. NOTE, its actual size is still 64x64, and if you draw it (without additional scaling), it will be drawn as 32x32.

Link copied to clipboard
interface Texture : Image

A bitmap graphic.

Link copied to clipboard
interface TextureBatch

OpenGL is more efficient if you batch operations. Backend.batch lets us create such a batch. Currently, the only operation is the rectangular draw.

Link copied to clipboard
class Vector2(val x: Float, val y: Float)

Holds an x, y coordinate.

Link copied to clipboard
interface Window

Properties

Link copied to clipboard
lateinit var backend: Backend