Module service:gfxcore - RMoX graphics service

RMoX graphics service. This provides the basic graphics support for RMoX. Usage:

gfxcore [device]

Where device specifies the underlying device to use, that must provide the interface:guifb interface. If not specified, the default is "vgafb". The purpose of this is to sit between an underlying display device (currently framebuffers only) and export a higher-level graphics interface.

Requires: service:fontengine interface:guifb

Provides: interface:gfx

Index

Declarations

gfxcore.occ:77Process gfxcore.service

PROC gfxcore.service (CT.SERVICE? in, SHARED CT.DRIVER! to.drv, SHARED CT.KERNEL! to.kernel, VAL []BYTE options, SHARED LOG! log)

Graphics service top-level process.

Parameters:

CT.SERVICE? in Connection to parent service.
SHARED CT.DRIVER! to.drv Connection to driver-core.
SHARED CT.KERNEL! to.kernel Connection to RMoX kernel.
VAL []BYTE options Options to service.
SHARED LOG! log System log channels.

line.inc:145Process Line1

PROC Line1 (VAL INT x.0, y.0, d.x, d.y, VAL INT32 c.1, [][]INT32 raster, VAL GFX.CR cr)

Draw a straight line.

Returns end point in (x.0, y.0).

Does nothing if (x.0, y.0) is outside raster.

Based on Foley & van Dam, Computer Graphics Principles and Practice, Second Edition in C, Fig. 3.8.

Parameters:

VAL INT x.0, y.0 Starting point
VAL INT d.x, d.y Relative position of end point
VAL INT32 c.1 Draw in this colour ...
[][]INT32 raster ... on this raster
VAL GFX.CR cr Clip rectangle

line.inc:268Process Line2

PROC Line2 (INT x.0, y.0, VAL INT d.x, d.y, VAL INT32 c.0, c.1, [][]INT32 raster, VAL GFX.CR cr)

Draw a straight line.

Returns end point in (x.0, y.0).

Does nothing if (x.0, y.0) is outside raster.

Based on Foley & van Dam, Computer Graphics Principles and Practice, Second Edition in C, Fig. 3.8.

Parameters:

INT x.0, y.0 Starting point
VAL INT d.x, d.y Relative position of end point
VAL INT32 c.0 Stop when line hits this colour
VAL INT32 c.1 Draw in this colour ...
[][]INT32 raster ... on this raster
VAL GFX.CR cr Clipping rectangle

disc.inc:32Process CircleFill

PROC CircleFill (VAL INT x, y, r, VAL INT32 colour, [][]INT32 raster, VAL GFX.CR cr)

Draws a solid circle. Clips as necessary.

Parameters:

VAL INT x, y Coordinates of centre.
VAL INT r Radius.
VAL INT32 colour Colour.
[][]INT32 raster Raster.
VAL GFX.CR cr Clipping rectangle.

rmoxbutton.inc:9Constant rmox.button.rgba

VAL [32][96]INT32 rmox.button.rgba

This array contains the 96x32 button-style RMoX logo.

ellipse.inc:32Process EllipseFill

PROC EllipseFill (VAL INT x, y, a, b, VAL INT32 colour, [][]INT32 raster, VAL GFX.CR cr)

Draws a solid ellipse. Clips as necessary.

Parameters:

VAL INT x, y Coordinates of centre.
VAL INT a, b X and Y radii.
VAL INT32 colour Colour.
[][]INT32 raster Raster.
VAL GFX.CR cr Clip rectangle.

rectangle.inc:32Process Rectangle

PROC Rectangle (VAL INT x.0, y.0, w.0, h.0, VAL INT32 colour, [][]INT32 raster, VAL GFX.CR cr)

Draws a solid rectangle. Clips as necessary.

Parameters:

VAL INT x.0, y.0 Top left corner.
VAL INT w.0 Width.
VAL INT h.0 Height/depth.
VAL INT32 colour Colour.
[][]INT32 raster Raster.
VAL GFX.CR cr Clipping rectangle.

rectangle.inc:78Process Square

PROC Square (VAL INT x, y, s, VAL INT32 colour, [][]INT32 raster, VAL GFX.CR cr)

Special case of Rectangle