Difference between revisions of "Unit Framebuffer"

From Ultibo.org
Jump to: navigation, search
 
(28 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
----
 
----
  
''To be documented''
+
'''Ultibo Framebuffer Interface unit'''
  
 
=== Constants ===
 
=== Constants ===
 
----
 
----
  
''To be documented''
+
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Framebuffer specific constants''' <code> FRAMEBUFFER_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>FRAMEBUFFER_NAME_PREFIX = 'Framebuffer';</code>
 +
| Name prefix for Framebuffer Devices
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Framebuffer device type''' <code> FRAMEBUFFER_TYPE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>FRAMEBUFFER_TYPE_NONE = 0;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>FRAMEBUFFER_TYPE_HARDWARE = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FRAMEBUFFER_TYPE_VIRTUAL = 2;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FRAMEBUFFER_TYPE_MAX = 2;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Framebuffer device state''' <code> FRAMEBUFFER_STATE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>FRAMEBUFFER_STATE_DISABLED = 0;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>FRAMEBUFFER_STATE_ENABLED = 1;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FRAMEBUFFER_STATE_MAX = 1;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Framebuffer cursor state''' <code> FRAMEBUFFER_CURSOR_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>FRAMEBUFFER_CURSOR_DISABLED = 0;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>FRAMEBUFFER_CURSOR_ENABLED = 1;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Framebuffer device flag''' <code> FRAMEBUFFER_FLAG_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>FRAMEBUFFER_FLAG_NONE = $00000000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FRAMEBUFFER_FLAG_DMA = $00000001;</code>
 +
| If set the framebuffer supports DMA for read/write operations
 +
|-
 +
| <code>FRAMEBUFFER_FLAG_MARK = $00000002;</code>
 +
| If set the framebuffer requires mark after write operations
 +
|-
 +
| <code>FRAMEBUFFER_FLAG_COMMIT = $00000004;</code>
 +
| If set the framebuffer requires commit after write operations
 +
|-
 +
| <code>FRAMEBUFFER_FLAG_BLANK = $00000008;</code>
 +
| If set the framebuffer supports blanking the screen
 +
|-
 +
| <code>FRAMEBUFFER_FLAG_CACHED = $00000010;</code>
 +
| If set framebuffer is in cached memory and cache cleaning should be used
 +
|-
 +
| <code>FRAMEBUFFER_FLAG_SWAP = $00000020;</code>
 +
| If set framebuffer requires byte order of colors to be reversed (BGR <-> RGB)
 +
|-
 +
| <code>FRAMEBUFFER_FLAG_BACKLIGHT = $00000040;</code>
 +
| If set the framebuffer supports setting the backlight brightness
 +
|-
 +
| <code>FRAMEBUFFER_FLAG_VIRTUAL = $00000080;</code>
 +
| If set the framebuffer supports virtual width and height
 +
|-
 +
| <code>FRAMEBUFFER_FLAG_OFFSETX = $00000100;</code>
 +
| If set the framebuffer supports virtual offset X (Horizontal Pan/Flip etc)
 +
|-
 +
| <code>FRAMEBUFFER_FLAG_OFFSETY = $00000200;</code>
 +
| If set the framebuffer supports virtual offset Y (Vertical Pan/Flip etc)
 +
|-
 +
| <code>FRAMEBUFFER_FLAG_SYNC = $00000400;</code>
 +
| If set the framebuffer supports waiting for vertical sync
 +
|-
 +
| <code>FRAMEBUFFER_FLAG_CURSOR = $00000800;</code>
 +
| If set the framebuffer supports a hardware mouse cursor
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Framebuffer transfer flag''' <code> FRAMEBUFFER_TRANSFER_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>FRAMEBUFFER_TRANSFER_NONE = $00000000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FRAMEBUFFER_TRANSFER_DMA = $00000001;</code>
 +
| Use DMA for transfer operations (Note: Buffers must be DMA compatible)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Type definitions ===
 
=== Type definitions ===
 
----
 
----
  
''To be documented''
+
 
 +
'''Framebuffer palette'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PFramebufferPalette = ^TFramebufferPalette;</code>
 +
 
 +
<code>TFramebufferPalette = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>Start:LongWord;</code>
 +
| The number of the first valid entry in the palette
 +
|-
 +
| <code>Count:LongWord;</code>
 +
| The total number of entries in the palette
 +
|-
 +
| <code>Entries:array[0..255] of LongWord;</code>
 +
| The palette entries in COLOR_FORMAT_DEFAULT format
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Framebuffer properties'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PFramebufferProperties = ^TFramebufferProperties;</code>
 +
 
 +
<code>TFramebufferProperties = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>Flags:LongWord;</code>
 +
| Framebuffer device flags (eg FRAMEBUFFER_FLAG_COMMIT) (Ignored for Allocate/SetProperties)
 +
|-
 +
| <code>Address:PtrUInt;</code>
 +
| Framebuffer address (Ignored for Allocate/SetProperties)
 +
|-
 +
| <code>Size:LongWord;</code>
 +
| Framebuffer size (Bytes) (Ignored for Allocate/SetProperties)
 +
|-
 +
| <code>Pitch:LongWord;</code>
 +
| Framebuffer pitch (Bytes per Line) (Ignored for Allocate/SetProperties)
 +
|-
 +
| <code>Depth:LongWord;</code>
 +
| Framebuffer depth (Bits per Pixel)(8/16/24/32)
 +
|-
 +
| <code>Order:LongWord;</code>
 +
| Framebuffer pixel order (BGR/RGB)
 +
|-
 +
| <code>Mode:LongWord;</code>
 +
| Framebuffer alpha mode (Enabled/Reversed/Ignored)
 +
|-
 +
| <code>Format:LongWord;</code>
 +
| Framebuffer color format (eg COLOR_FORMAT_ARGB32) (Ignored for Allocate/SetProperties)
 +
|-
 +
| <code>PhysicalWidth:LongWord;</code>
 +
| Framebuffer Physical Width (Pixels)
 +
|-
 +
| <code>PhysicalHeight:LongWord;</code>
 +
| Framebuffer Physical Height (Pixels)
 +
|-
 +
| <code>VirtualWidth:LongWord;</code>
 +
| Framebuffer Virtual Width (Pixels)
 +
|-
 +
| <code>VirtualHeight:LongWord;</code>
 +
| Framebuffer Virtual Height (Pixels)
 +
|-
 +
| <code>OffsetX:LongWord;</code>
 +
| Framebuffer Virtual Offset X (Pixels)
 +
|-
 +
| <code>OffsetY:LongWord;</code>
 +
| Framebuffer Virtual Offset Y (Pixels)
 +
|-
 +
| <code>OverscanTop:LongWord;</code>
 +
| Framebuffer Overscan Top (Pixels)
 +
|-
 +
| <code>OverscanBottom:LongWord;</code>
 +
| Framebuffer Overscan Bottom (Pixels)
 +
|-
 +
| <code>OverscanLeft:LongWord;</code>
 +
| Framebuffer Overscan Left (Pixels)
 +
|-
 +
| <code>OverscanRight:LongWord;</code>
 +
| Framebuffer Overscan Right (Pixels)
 +
|-
 +
| <code>Rotation:LongWord;</code>
 +
| Framebuffer Rotation (eg FRAMEBUFFER_ROTATION_180)
 +
|-
 +
| <code>CursorX:LongWord;</code>
 +
| Framebuffer Cursor X (Pixels) (Ignored for Allocate / SetProperties)
 +
|-
 +
| <code>CursorY:LongWord;</code>
 +
| Framebuffer Cursor Y (Pixels) (Ignored for Allocate / SetProperties)
 +
|-
 +
| <code>CursorState:LongWord;</code>
 +
| Framebuffer Cursor State (eg FRAMEBUFFER_CURSOR_ENABLED) (Ignored for Allocate / SetProperties)
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Framebuffer enumeration callback'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferEnumerate = function(Framebuffer:PFramebufferDevice; Data:Pointer):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer notification callback'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device allocate'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceAllocate = function(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device release'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceRelease = function(Framebuffer:PFramebufferDevice):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device blank'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceBlank = function(Framebuffer:PFramebufferDevice; Blank:Boolean):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device read'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceRead = function(Framebuffer:PFramebufferDevice; X,Y:LongWord; Buffer:Pointer; Len,Flags:LongWord):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device write'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceWrite = function(Framebuffer:PFramebufferDevice; X,Y:LongWord; Buffer:Pointer; Len,Flags:LongWord):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device mark'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceMark = function(Framebuffer:PFramebufferDevice; X,Y,Width,Height,Flags:LongWord):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device commit'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceCommit = function(Framebuffer:PFramebufferDevice; Address:PtrUInt; Size,Flags:LongWord):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device get rect'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceGetRect = function(Framebuffer:PFramebufferDevice; X,Y:LongWord; Buffer:Pointer; Width,Height,Skip,Flags:LongWord):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device put rect'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDevicePutRect = function(Framebuffer:PFramebufferDevice; X,Y:LongWord; Buffer:Pointer; Width,Height,Skip,Flags:LongWord):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device copy rect'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceCopyRect = function(Framebuffer:PFramebufferDevice; X1,Y1,X2,Y2,Width,Height,Flags:LongWord):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device fill rect'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceFillRect = function(Framebuffer:PFramebufferDevice; X,Y,Width,Height,Color,Flags:LongWord):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device get line'''
 +
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceGetLine = function(Framebuffer:PFramebufferDevice; Y:LongWord):Pointer;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device get point'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceGetPoint = function(Framebuffer:PFramebufferDevice; X,Y:LongWord):Pointer;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device wait sync'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceWaitSync = function(Framebuffer:PFramebufferDevice):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device get offset'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceGetOffset = function(Framebuffer:PFramebufferDevice; var X,Y:LongWord):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device set offset'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceSetOffset = function(Framebuffer:PFramebufferDevice; X,Y:LongWord;Pan:Boolean):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device set offset ex'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceSetOffsetEx = function(Framebuffer:PFramebufferDevice; X,Y:LongWord; Pan,Switch:Boolean):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device get palette'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceGetPalette = function(Framebuffer:PFramebufferDevice; Palette:PFramebufferPalette):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device set palette'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceSetPalette = function(Framebuffer:PFramebufferDevice; Palette:PFramebufferPalette):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device set backlight'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceSetBacklight = function(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device set cursor'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceSetCursor = function(Framebuffer:PFramebufferDevice; Width,Height,HotspotX,HotspotY:LongWord; Image:Pointer; Len:LongWord):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device update cursor'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceUpdateCursor = function(Framebuffer:PFramebufferDevice; Enabled:Boolean; X,Y:LongInt; Relative:Boolean):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device get properties'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceGetProperties = function(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device set properties'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TFramebufferDeviceSetProperties = function(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Framebuffer device'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PFramebufferDevice = ^TFramebufferDevice;</code>
 +
 
 +
<code>TFramebufferDevice = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''Device Properties''
 +
|-
 +
| <code>Device:TDevice;</code>
 +
| The Device entry for this Framebuffer device
 +
|-
 +
|colspan="2"|''Framebuffer Properties''
 +
|-
 +
| <code>FramebufferId:LongWord;</code>
 +
| Unique Id of this Framebuffer device in the Framebuffer device table
 +
|-
 +
| <code>FramebufferState:LongWord;</code>
 +
| Framebuffer device state (eg FRAMEBUFFER_STATE_ENABLED)
 +
|-
 +
| <code>DeviceAllocate:TFramebufferDeviceAllocate;</code>
 +
| A device specific DeviceAllocate method implementing a standard framebuffer device interface (Mandatory)
 +
|-
 +
| <code>DeviceRelease:TFramebufferDeviceRelease;</code>
 +
| A device specific DeviceRelease method implementing a standard framebuffer device interface (Mandatory)
 +
|-
 +
| <code>DeviceBlank:TFramebufferDeviceBlank;</code>
 +
| A device specific DeviceBlank method implementing a standard framebuffer device interface (Optional)
 +
|-
 +
| <code>DeviceRead:TFramebufferDeviceRead;</code>
 +
| A device specific DeviceRead method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
 +
|-
 +
| <code>DeviceWrite:TFramebufferDeviceWrite;</code>
 +
| A device specific DeviceWrite method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
 +
|-
 +
| <code>DeviceMark:TFramebufferDeviceMark;</code>
 +
| A device specific DeviceMark method implementing a standard framebuffer device interface (Optional)
 +
|-
 +
| <code>DeviceCommit:TFramebufferDeviceCommit;</code>
 +
| A device specific DeviceCommit method implementing a standard framebuffer device interface (Optional)
 +
|-
 +
| <code>DeviceGetRect:TFramebufferDeviceGetRect;</code>
 +
| A device specific DeviceGetRect method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
 +
|-
 +
| <code>DevicePutRect:TFramebufferDevicePutRect;</code>
 +
| A device specific DevicePutRect method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
 +
|-
 +
| <code>DeviceCopyRect:TFramebufferDeviceCopyRect;</code>
 +
| A device specific DeviceCopyRect method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
 +
|-
 +
| <code>DeviceFillRect:TFramebufferDeviceFillRect;</code>
 +
| A device specific DeviceFillRect method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
 +
|-
 +
| <code>DeviceGetLine:TFramebufferDeviceGetLine;</code>
 +
| A device specific DeviceGetLine method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
 +
|-
 +
| <code>DeviceGetPoint:TFramebufferDeviceGetPoint;</code>
 +
| A device specific DeviceGetPoint method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
 +
|-
 +
| <code>DeviceWaitSync:TFramebufferDeviceWaitSync;</code>
 +
| A device specific DeviceWaitSync method implementing a standard framebuffer device interface (Optional)
 +
|-
 +
| <code>DeviceGetOffset:TFramebufferDeviceGetOffset;</code>
 +
| A device specific DeviceGetOffset method implementing a standard framebuffer device interface (Optional)
 +
|-
 +
| <code>DeviceSetOffset:TFramebufferDeviceSetOffset;</code>
 +
| A device specific DeviceSetOffset method implementing a standard framebuffer device interface (Optional)
 +
|-
 +
| <code>DeviceSetOffsetEx:TFramebufferDeviceSetOffsetEx;</code>
 +
| A device specific DeviceSetOffsetEx method implementing a standard framebuffer device interface (Optional)
 +
|-
 +
| <code>DeviceGetPalette:TFramebufferDeviceGetPalette;</code>
 +
| A device specific DeviceGetPalette method implementing a standard framebuffer device interface (Optional)
 +
|-
 +
| <code>DeviceSetPalette:TFramebufferDeviceSetPalette;</code>
 +
| A device specific DeviceSetPalette method implementing a standard framebuffer device interface (Optional)
 +
|-
 +
| <code>DeviceSetBacklight:TFramebufferDeviceSetBacklight;</code>
 +
| A device specific DeviceSetBacklight method implementing a standard framebuffer device interface (Optional)
 +
|-
 +
| <code>DeviceSetCursor:TFramebufferDeviceSetCursor;</code>
 +
| A device specific DeviceSetCursor method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
 +
|-
 +
| <code>DeviceUpdateCursor:TFramebufferDeviceUpdateCursor;</code>
 +
| A device specific DeviceUpdateCursor method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
 +
|-
 +
| <code>DeviceGetProperties:TFramebufferDeviceGetProperties;</code>
 +
| A device specific DeviceGetProperties method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
 +
|-
 +
| <code>DeviceSetProperties:TFramebufferDeviceSetProperties;</code>
 +
| A device specific DeviceSetProperties method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
 +
|-
 +
|colspan="2"|''Statistics Properties''
 +
|-
 +
| <code>AllocateCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReleaseCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReadCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WriteCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PutCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>CopyCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FillCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Driver Properties''
 +
|-
 +
| <code>Lock:TMutexHandle;</code>
 +
| Device lock
 +
|-
 +
| <code>Address:PtrUInt;</code>
 +
| Framebuffer address
 +
|-
 +
| <code>Size:LongWord;</code>
 +
| Framebuffer size (Bytes)
 +
|-
 +
| <code>Pitch:LongWord;</code>
 +
| Framebuffer pitch (Bytes per Line)
 +
|-
 +
| <code>Depth:LongWord;</code>
 +
| Framebuffer depth (Bits per Pixel)(8/16/24/32)
 +
|-
 +
| <code>Order:LongWord;</code>
 +
| Framebuffer pixel order (BGR/RGB)
 +
|-
 +
| <code>Mode:LongWord;</code>
 +
| Framebuffer alpha mode (Enabled/Reversed/Ignored)
 +
|-
 +
| <code>Format:LongWord;</code>
 +
| Framebuffer color format (eg COLOR_FORMAT_ARGB32)
 +
|-
 +
| <code>PhysicalWidth:LongWord;</code>
 +
| Framebuffer Physical Width (Pixels)
 +
|-
 +
| <code>PhysicalHeight:LongWord;</code>
 +
| Framebuffer Physical Height (Pixels)
 +
|-
 +
| <code>VirtualWidth:LongWord;</code>
 +
| Framebuffer Virtual Width (Pixels)
 +
|-
 +
| <code>VirtualHeight:LongWord;</code>
 +
| Framebuffer Virtual Height (Pixels)
 +
|-
 +
| <code>OffsetX:LongWord;</code>
 +
| Framebuffer Virtual Offset X (Pixels)
 +
|-
 +
| <code>OffsetY:LongWord;</code>
 +
| Framebuffer Virtual Offset Y (Pixels)
 +
|-
 +
| <code>OverscanTop:LongWord;</code>
 +
| Framebuffer Overscan Top (Pixels)
 +
|-
 +
| <code>OverscanBottom:LongWord;</code>
 +
| Framebuffer Overscan Bottom (Pixels)
 +
|-
 +
| <code>OverscanLeft:LongWord;</code>
 +
| Framebuffer Overscan Left (Pixels)
 +
|-
 +
| <code>OverscanRight:LongWord;</code>
 +
| Framebuffer Overscan Right (Pixels)
 +
|-
 +
| <code>Rotation:LongWord;</code>
 +
| Framebuffer Rotation (eg FRAMEBUFFER_ROTATION_180)
 +
|-
 +
| <code>CursorX:LongWord;</code>
 +
| Framebuffer Cursor X (Pixels)
 +
|-
 +
| <code>CursorY:LongWord;</code>
 +
| Framebuffer Cursor Y (Pixels)
 +
|-
 +
| <code>CursorState:LongWord;</code>
 +
| Framebuffer Cursor State (eg FRAMEBUFFER_CURSOR_ENABLED)
 +
|-
 +
|colspan="2"|''Buffer Properties''
 +
|-
 +
| <code>LineBuffer:Pointer;</code>
 +
| Buffer for line fills
 +
|-
 +
| <code>CopyBuffer:Pointer;</code>
 +
| Buffer for overlapped copy
 +
|-
 +
|colspan="2"|''Cursor Properties''
 +
|-
 +
| <code>CursorUpdate:LongBool;</code>
 +
| Flag to indicate if cursor update (Show/Hide) is in progress
 +
|-
 +
| <code>CursorImage:Pointer;</code>
 +
| Buffer for cursor image pixels (COLOR_FORMAT_DEFAULT)
 +
|-
 +
| <code>CursorInput:Pointer;</code>
 +
| Buffer for cursor image pixels (Native color format)
 +
|-
 +
| <code>CursorBuffer:Pointer;</code>
 +
| Buffer for pixels currently under cursor (Native color format)
 +
|-
 +
| <code>CursorOutput:Pointer;</code>
 +
| Buffer for cursor pixels currently displayed (Native color format)
 +
|-
 +
| <code>CursorWidth:LongWord;</code>
 +
| Framebuffer Cursor Width (Pixels)
 +
|-
 +
| <code>CursorHeight:LongWord;</code>
 +
| Framebuffer Cursor Height (Pixels)
 +
|-
 +
| <code>CursorHotspotX:LongWord;</code>
 +
| Framebuffer Cursor Hotspot X (Pixels)
 +
|-
 +
| <code>CursorHotspotY:LongWord;</code>
 +
| Framebuffer Cursor Hotspot Y (Pixels)
 +
|-
 +
|colspan="2"|''Internal Properties''
 +
|-
 +
| <code>Prev:PFramebufferDevice;</code>
 +
| Previous entry in Framebuffer device table
 +
|-
 +
| <code>Next:PFramebufferDevice;</code>
 +
| Next entry in Framebuffer device table
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Public variables ===
 
=== Public variables ===
 
----
 
----
  
''To be documented''
+
 
 +
'''Initialization handlers'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>FramebufferInitHandler:TFramebufferInit;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
<br />
  
 
=== Function declarations ===
 
=== Function declarations ===
 
----
 
----
  
<br />
+
 
 
'''Initialization functions'''
 
'''Initialization functions'''
  
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">procedure FramebufferInit;</pre>
 
<pre style="border: 0; padding-bottom:0px;">procedure FramebufferInit;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Initialize the Framebuffer unit and Framebuffer device table</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| Called only during system startup
 
|-
 
|-
 
|}
 
|}
Line 49: Line 754:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Framebuffer'''
+
! Framebuffer
 
| The framebuffer device to allocate
 
| The framebuffer device to allocate
 
|-
 
|-
! '''Properties'''
+
! Properties
 
| The framebuffer properties (Width/Height/Depth etc) to use for allocation (Optional)
 
| The framebuffer properties (Width/Height/Depth etc) to use for allocation (Optional)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
Line 67: Line 772:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Framebuffer'''
+
! Framebuffer
 
| The framebuffer device to release
 
| The framebuffer device to release
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
Line 82: Line 787:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Framebuffer'''
+
! Framebuffer
 
| The framebuffer device to blank
 
| The framebuffer device to blank
 
|-
 
|-
! '''Blank'''
+
! Blank
| Turn off the display if True / Turn on the display if False
+
| Turn off the display if True/Turn on the display if False
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| Not all framebuffer devices support blank, returns ERROR_CALL_NOT_IMPLEMENTED if not supported. Devices that support blank should set the flag FRAMEBUFFER_FLAG_BLANK.
+
| Not all framebuffer devices support blank, returns ERROR_CALL_NOT_IMPLEMENTED if not supported.
 +
Devices that support blank should set the flag FRAMEBUFFER_FLAG_BLANK
 
|-
 
|-
 
|}
 
|}
Line 103: Line 809:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Framebuffer'''
+
! Framebuffer
 
| The framebuffer device to read from
 
| The framebuffer device to read from
 
|-
 
|-
! '''X'''
+
! X
 
| The column to start reading from
 
| The column to start reading from
 
|-
 
|-
! '''Y'''
+
! Y
 
| The row to start reading from
 
| The row to start reading from
 
|-
 
|-
! '''Buffer'''
+
! Buffer
 
| Pointer to a buffer to receive the read pixels
 
| Pointer to a buffer to receive the read pixels
 
|-
 
|-
! '''Len'''
+
! Len
 
| The number of pixels to read starting at X,Y
 
| The number of pixels to read starting at X,Y
 
|-
 
|-
! '''Flags'''
+
! Flags
 
| The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
 
| The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
 
| Pixel data will be returned in the color format of the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache cleaning before a DMA read.
 
| Pixel data will be returned in the color format of the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache cleaning before a DMA read.
 
|-
 
|-
Line 136: Line 842:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Framebuffer'''
+
! Framebuffer
 
| The framebuffer device to write to
 
| The framebuffer device to write to
 
|-
 
|-
! '''X'''
+
! X
 
| The column to start writing from
 
| The column to start writing from
 
|-
 
|-
! '''Y'''
+
! Y
 
| The row to start writing from
 
| The row to start writing from
 
|-
 
|-
! '''Buffer'''
+
! Buffer
 
| Pointer to a buffer containing the pixels to write
 
| Pointer to a buffer containing the pixels to write
 
|-
 
|-
! '''Len'''
+
! Len
 
| The number of pixels to write starting at X,Y
 
| The number of pixels to write starting at X,Y
 
|-
 
|-
! '''Flags'''
+
! Flags
 
| The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
 
| The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must ensure pixel data is in the correct color format for the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache invalidation after a DMA write.
 
| Caller must ensure pixel data is in the correct color format for the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache invalidation after a DMA write.
 
|-
 
|-
Line 165: Line 871:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceMark(Framebuffer:PFramebufferDevice; X,Y,Width,Height,Flags:LongWord):LongWord;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceMark(Framebuffer:PFramebufferDevice; X,Y,Width,Height,Flags:LongWord):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Mark a region written to the framebuffer and signal the device to take any neccessary actions</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Mark a region written to the framebuffer and signal the device to take any necessary actions</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Framebuffer'''
+
! Framebuffer
 
| The framebuffer device to mark
 
| The framebuffer device to mark
 
|-
 
|-
! '''X'''
+
! X
 
| The starting column of the mark
 
| The starting column of the mark
 
|-
 
|-
! '''Y'''
+
! Y
 
| The starting row of the mark
 
| The starting row of the mark
 
|-
 
|-
! '''Width'''
+
! Width
 
| The number of columns to mark
 
| The number of columns to mark
 
|-
 
|-
! '''Height'''
+
! Height
 
| The number of rows to mark
 
| The number of rows to mark
 
|-
 
|-
! '''Flags'''
+
! Flags
 
| The flags used for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
 
| The flags used for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| Not all framebuffer devices support mark, returns ERROR_CALL_NOT_IMPLEMENTED if not supported. Devices that support and require mark should set the flag FRAMEBUFFER_FLAG_MARK.
+
| Not all framebuffer devices support mark, returns ERROR_CALL_NOT_IMPLEMENTED if not supported.
 +
Devices that support and require mark should set the flag FRAMEBUFFER_FLAG_MARK
 
|-
 
|-
 
|}
 
|}
Line 197: Line 904:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceCommit(Framebuffer:PFramebufferDevice; Address,Size,Flags:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceCommit(Framebuffer:PFramebufferDevice; Address:PtrUInt; Size,Flags:LongWord):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Commit a region written to the framebuffer and signal the device to take any neccessary actions</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Commit a region written to the framebuffer and signal the device to take any necessary actions</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Framebuffer'''
+
! Framebuffer
 
| The framebuffer device to commit
 
| The framebuffer device to commit
 
|-
 
|-
! '''Address'''
+
! Address
 
| The starting address of the commit
 
| The starting address of the commit
 
|-
 
|-
! '''Size'''
+
! Size
 
| The size in bytes of the commit
 
| The size in bytes of the commit
 
|-
 
|-
! '''Flags'''
+
! Flags
 
| The flags used for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
 
| The flags used for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| Not all framebuffer devices support commit, returns ERROR_CALL_NOT_IMPLEMENTED if not supported. Devices that support and require commit should set the flag FRAMEBUFFER_FLAG_COMMIT.
+
| Not all framebuffer devices support commit, returns ERROR_CALL_NOT_IMPLEMENTED if not supported.
 +
Devices that support and require commit should set the flag FRAMEBUFFER_FLAG_COMMIT
 
|-
 
|-
 
|}
 
|}
Line 229: Line 937:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Framebuffer'''
+
! Framebuffer
 
| The framebuffer device to get from
 
| The framebuffer device to get from
 
|-
 
|-
! '''X'''
+
! X
 
| The starting column of the get
 
| The starting column of the get
 
|-
 
|-
! '''Y'''
+
! Y
 
| The starting row of the get
 
| The starting row of the get
 
|-
 
|-
! '''Buffer'''
+
! Buffer
 
| Pointer to a block of memory large enough to hold the pixels in a contiguous block of rows
 
| Pointer to a block of memory large enough to hold the pixels in a contiguous block of rows
 
|-
 
|-
! '''Width'''
+
! Width
 
| The number of columns to get
 
| The number of columns to get
 
|-
 
|-
! '''Height'''
+
! Height
 
| The number of rows to get
 
| The number of rows to get
 
|-
 
|-
! '''Skip'''
+
! Skip
 
| The number of pixels to skip in the buffer after each row (Optional)
 
| The number of pixels to skip in the buffer after each row (Optional)
 
|-
 
|-
! '''Flags'''
+
! Flags
 
| The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
 
| The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
 
| Pixel data will be returned in the color format of the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache cleaning before a DMA read.
 
| Pixel data will be returned in the color format of the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache cleaning before a DMA read.
 
|-
 
|-
Line 268: Line 976:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Framebuffer'''
+
! Framebuffer
 
| The framebuffer device to put to
 
| The framebuffer device to put to
 
|-
 
|-
! '''X'''
+
! X
 
| The starting column of the put
 
| The starting column of the put
 
|-
 
|-
! '''Y'''
+
! Y
 
| The starting row of the put
 
| The starting row of the put
 
|-
 
|-
! '''Buffer'''
+
! Buffer
 
| Pointer to a block of memory containing the pixels in a contiguous block of rows
 
| Pointer to a block of memory containing the pixels in a contiguous block of rows
 
|-
 
|-
! '''Width'''
+
! Width
 
| The number of columns to put
 
| The number of columns to put
 
|-
 
|-
! '''Height'''
+
! Height
 
| The number of rows to put
 
| The number of rows to put
 
|-
 
|-
! '''Skip'''
+
! Skip
 
| The number of pixels to skip in the buffer after each row (Optional)
 
| The number of pixels to skip in the buffer after each row (Optional)
 
|-
 
|-
! '''Flags'''
+
! Flags
 
| The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
 
| The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must ensure pixel data is in the correct color format for the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache invalidation after a DMA write.
 
| Caller must ensure pixel data is in the correct color format for the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache invalidation after a DMA write.
 
|-
 
|-
Line 307: Line 1,015:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Frambuffer'''
+
! Framebuffer
 
| The framebuffer device to copy on
 
| The framebuffer device to copy on
 
|-
 
|-
! '''X1'''
+
! X1
 
| The starting column to copy from
 
| The starting column to copy from
 
|-
 
|-
! '''Y1'''
+
! Y1
 
| The starting row to copy from
 
| The starting row to copy from
 
|-
 
|-
! '''X2'''
+
! X2
 
| The starting column to copy to
 
| The starting column to copy to
 
|-
 
|-
! '''Y2'''
+
! Y2
 
| The starting row to copy to
 
| The starting row to copy to
 
|-
 
|-
! '''Width'''
+
! Width
 
| The number of columns to copy
 
| The number of columns to copy
 
|-
 
|-
! '''Height'''
+
! Height
 
| The number of rows to copy  
 
| The number of rows to copy  
 
|-
 
|-
! '''Flags'''
+
! Flags
 
| The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
 
| The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
 
| The default method assumes that framebuffer memory is DMA coherent and does not require cache clean/invalidate before or after a DMA read/write.
 
| The default method assumes that framebuffer memory is DMA coherent and does not require cache clean/invalidate before or after a DMA read/write.
 
|-
 
|-
Line 346: Line 1,054:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Frambuffer'''
+
! Framebuffer
 
| The framebuffer device to fill on
 
| The framebuffer device to fill on
 
|-
 
|-
! '''X'''
+
! X
 
| The starting column of the fill
 
| The starting column of the fill
 
|-
 
|-
! '''Y'''
+
! Y
 
| The starting row of the fill
 
| The starting row of the fill
 
|-
 
|-
! '''Width'''
+
! Width
 
| The number of columns to fill
 
| The number of columns to fill
 
|-
 
|-
! '''Height'''
+
! Height
 
| The number of rows to fill
 
| The number of rows to fill
 
|-
 
|-
! '''Color'''
+
! Color
 
| The color to use for the fill
 
| The color to use for the fill
 
|-
 
|-
! '''Flags'''
+
! Flags
 
| The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
 
| The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
 
| Color must be specified in the correct format for the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache invalidation after a DMA write.
 
| Color must be specified in the correct format for the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache invalidation after a DMA write.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceGetLine(Framebuffer:PFramebufferDevice; Y:LongWord):Pointer;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the address of the start of a row in framebuffer memory</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Framebuffer
 +
| The framebuffer device to get the start address from
 +
|-
 +
! Y
 +
| The row to get the start address of
 +
|-
 +
! Return
 +
| Pointer to the start address of the row or nil on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceGetPoint(Framebuffer:PFramebufferDevice; X,Y:LongWord):Pointer;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the address of the specified row and column in framebuffer memory</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Framebuffer
 +
| The framebuffer device to get the address from
 +
|-
 +
! X
 +
| The column to get the start address of
 +
|-
 +
! Y
 +
| The row to get the start address of
 +
|-
 +
! Return
 +
| Pointer to the address of the row and column or nil on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceWaitSync(Framebuffer:PFramebufferDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Wait for the next vertical sync signal from the display hardware</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Framebuffer
 +
| The framebuffer device to wait for
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| Not all framebuffer devices support wait sync, returns ERROR_CALL_NOT_IMPLEMENTED if not supported.
 +
Devices that support wait sync should set the flag FRAMEBUFFER_FLAG_SYNC
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceGetOffset(Framebuffer:PFramebufferDevice; var X,Y:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the virtual offset X and Y from a framebuffer device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Framebuffer
 +
| The framebuffer device to get the offset from
 +
|-
 +
! X
 +
| The X (Column) offset value in pixels returned from the device if successful
 +
|-
 +
! Y
 +
| The Y (Row) offset value in pixels returned from the device if successful
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| X and Y are relative to the virtual buffer and NOT the physical screen (Where applicable)
 +
Not all framebuffer devices support X and/or Y offset
 +
<br />Devices that support offset X should set the flag FRAMEBUFFER_FLAG_OFFSETX
 +
<br />Devices that support offset Y should set the flag FRAMEBUFFER_FLAG_OFFSETY
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceSetOffset(Framebuffer:PFramebufferDevice; X,Y:LongWord; Pan:Boolean):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the virtual offset X and Y of a framebuffer device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Framebuffer
 +
| The framebuffer device to set the offset for
 +
|-
 +
! X
 +
| The X (Column) offset value in pixels to set
 +
|-
 +
! Y
 +
| The Y (Row) offset value in pixels to set
 +
|-
 +
! Pan
 +
| If True then pan the display without updating the Offset X and/or Y
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| X and Y are relative to the virtual buffer and NOT the physical screen (Where applicable)
 +
Not all framebuffer devices support X and/or Y offset, returns ERROR_CALL_NOT_IMPLEMENTED if not supported
 +
<br />Devices that support offset X should set the flag FRAMEBUFFER_FLAG_OFFSETX
 +
<br />Devices that support offset Y should set the flag FRAMEBUFFER_FLAG_OFFSETY
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceSetOffsetEx(Framebuffer:PFramebufferDevice; X,Y:LongWord; Pan,Switch:Boolean):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the virtual offset X and Y of a framebuffer device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Framebuffer
 +
| The framebuffer device to set the offset for
 +
|-
 +
! X
 +
| The X (Column) offset value in pixels to set
 +
|-
 +
! Y
 +
| The Y (Row) offset value in pixels to set
 +
|-
 +
! Pan
 +
| If True then pan the display without updating the Offset X and/or Y
 +
|-
 +
! Switch
 +
| If False then update the Offset X and/or Y without moving the display
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| X and Y are relative to the virtual buffer and NOT the physical screen (Where applicable)
 +
Not all framebuffer devices support X and/or Y offset, returns ERROR_CALL_NOT_IMPLEMENTED if not supported
 +
<br />Devices that support offset X should set the flag FRAMEBUFFER_FLAG_OFFSETX
 +
<br />Devices that support offset Y should set the flag FRAMEBUFFER_FLAG_OFFSETY
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceGetPalette(Framebuffer:PFramebufferDevice; Palette:PFramebufferPalette):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the 8 bit color palette from a framebuffer device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Framebuffer
 +
| The framebuffer device to get the palette from
 +
|-
 +
! Palette
 +
| Pointer to a TFramebufferPalette structure for the palette data
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| Not all framebuffer devices support 8 bit palette, returns ERROR_CALL_NOT_IMPLEMENTED if not supported.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceSetPalette(Framebuffer:PFramebufferDevice; Palette:PFramebufferPalette):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the 8 bit color palette of a framebuffer device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Framebuffer
 +
| The framebuffer device to set the palette for
 +
|-
 +
! Palette
 +
| Pointer to a TFramebufferPalette structure for the palette data
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| Not all framebuffer devices support 8 bit palette, returns ERROR_CALL_NOT_IMPLEMENTED if not supported.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceSetBacklight(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the brightness of the backlight of a framebuffer device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Framebuffer
 +
| The framebuffer device to set the backlight
 +
|-
 +
! Brightness
 +
| The brightness value to set (Normally 0 to 100)
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| Not all framebuffer devices support set backlight, returns ERROR_CALL_NOT_IMPLEMENTED if not supported.
 +
Devices that support set backlight should set the flag FRAMEBUFFER_FLAG_BACKLIGHT
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceSetCursor(Framebuffer:PFramebufferDevice; Width,Height,HotspotX,HotspotY:LongWord; Image:Pointer; Len:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the mouse cursor image and properties of a framebuffer device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Framebuffer
 +
| The framebuffer device to set the cursor
 +
|-
 +
! Width
 +
| The width of the cursor image in pixels
 +
|-
 +
! Height
 +
| The height of the cursor image in pixels
 +
|-
 +
! HotspotX
 +
| The X hotspot of the cursor image, where the cursor X location will be (Normally 0).
 +
|-
 +
! HotspotY
 +
| The Y hotspot of the cursor image, where the cursor Y location will be (Normally 0).
 +
|-
 +
! Image
 +
| A buffer containing the cursor image pixels in COLOR_FORMAT_DEFAULT format
 +
|-
 +
! Len
 +
| The length of the image buffer in bytes
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| For devices that don't support hardware mouse cursor a software cursor will be implemented
 +
If image is nil then the default cursor image will be used
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceUpdateCursor(Framebuffer:PFramebufferDevice; Enabled:Boolean; X,Y:LongInt; Relative:Boolean):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Update the position and state for the mouse cursor of a framebuffer device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Framebuffer
 +
| The framebuffer device to update the cursor
 +
|-
 +
! Enabled
 +
| If true then show the cursor else hide it
 +
|-
 +
! X
 +
| The cursor X location in pixels
 +
|-
 +
! Y
 +
| The cursor Y location in pixels
 +
|-
 +
! Relative
 +
| If true then X and Y are considered relative to the current position
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| For devices that don't support hardware mouse cursor a software cursor will be implemented
 
|-
 
|-
 
|}
 
|}
Line 382: Line 1,369:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Framebuffer'''
+
! Framebuffer
 
| The framebuffer device to get properties from
 
| The framebuffer device to get properties from
 
|-
 
|-
! '''Properties'''
+
! Properties
 
| Pointer to a TFramebufferProperties structure to return
 
| Pointer to a TFramebufferProperties structure to return
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
Line 400: Line 1,387:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Framebuffer'''
+
! Framebuffer
 
| The framebuffer device to set properties for
 
| The framebuffer device to set properties for
 
|-
 
|-
! '''Properties'''
+
! Properties
 
| Pointer to a TFramebufferProperties structure containing the properties
 
| Pointer to a TFramebufferProperties structure containing the properties
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
 
| Changing certain properties may cause the framebuffer to be reallocated
 
| Changing certain properties may cause the framebuffer to be reallocated
 
|-
 
|-
Line 417: Line 1,404:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceCheckFlag(Framebuffer:PFramebufferDevice; Flag:LongWord):Boolean;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceCheckFlag(Framebuffer:PFramebufferDevice; Flag:LongWord):Boolean;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if a framebuffer device supports a flag value</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Framebuffer
| To be documented
+
| The framebuffer device to check
 +
|-
 +
! Flag
 +
| The framebuffer flag to check (eg FRAMEBUFFER_FLAG_BACKLIGHT)
 +
|-
 +
! Return
 +
| True if flag is supported, False if not or on error.
 
|-
 
|-
 
|}
 
|}
Line 429: Line 1,422:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceGetFormat(Framebuffer:PFramebufferDevice):LongWord;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceGetFormat(Framebuffer:PFramebufferDevice):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the color format of a framebuffer device</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Framebuffer
| To be documented
+
| The framebuffer device to get from
 +
|-
 +
! Return
 +
| The color format of the framebuffer (eg COLOR_FORMAT_RGB24)
 
|-
 
|-
 
|}
 
|}
Line 445: Line 1,441:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Return'''
+
! Return
 
| Pointer to new Framebuffer entry or nil if Framebuffer could not be created
 
| Pointer to new Framebuffer entry or nil if Framebuffer could not be created
 
|-
 
|-
Line 457: Line 1,453:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Size'''
+
! Size
 
| Size in bytes to allocate for new Framebuffer (Including the Framebuffer entry)
 
| Size in bytes to allocate for new Framebuffer (Including the Framebuffer entry)
 
|-
 
|-
! '''Return'''
+
! Return
 
| Pointer to new Framebuffer entry or nil if Framebuffer could not be created
 
| Pointer to new Framebuffer entry or nil if Framebuffer could not be created
 
|-
 
|-
Line 472: Line 1,468:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Framebuffer
| To be documented
+
| The framebuffer device to destroy
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
 
|}
 
|}
Line 484: Line 1,483:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Framebuffer
| To be documented
+
| The framebuffer device to register
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
 
|}
 
|}
Line 496: Line 1,498:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Framebuffer
| To be documented
+
| The framebuffer device to deregister
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
 
|}
 
|}
Line 504: Line 1,509:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceFind(FramebufferId:LongWord):PFramebufferDevice;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceFind(FramebufferId:LongWord):PFramebufferDevice;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Find a framebuffer device by ID in the framebuffer table</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! FramebufferId
| To be documented
+
| The ID number of the framebuffer to find
 +
|-
 +
! Return
 +
| Pointer to framebuffer device entry or nil if not found
 
|-
 
|-
 
|}
 
|}
Line 516: Line 1,524:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceFindByName(const Name:String):PFramebufferDevice; inline;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceFindByName(const Name:String):PFramebufferDevice; inline;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Find a framebuffer device by name in the framebuffer table</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Name
| To be documented
+
| The name of the framebuffer to find (eg Framebuffer0)
 +
|-
 +
! Return
 +
| Pointer to framebuffer device entry or nil if not found
 
|-
 
|-
 
|}
 
|}
Line 528: Line 1,539:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceFindByDescription(const Description:String):PFramebufferDevice; inline;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceFindByDescription(const Description:String):PFramebufferDevice; inline;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Find a framebuffer device by description in the framebuffer table</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Description
| To be documented
+
| The description of the framebuffer to find (eg BCM2836 Framebuffer)
 +
|-
 +
! Return
 +
| Pointer to framebuffer device entry or nil if not found
 
|-
 
|-
 
|}
 
|}
Line 540: Line 1,554:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceEnumerate(Callback:TFramebufferEnumerate; Data:Pointer):LongWord;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceEnumerate(Callback:TFramebufferEnumerate; Data:Pointer):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enumerate all framebuffer devices in the framebuffer table</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Callback
| To be documented
+
| The callback function to call for each framebuffer in the table
 +
|-
 +
! Data
 +
| A private data pointer to pass to callback for each framebuffer in the table
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
 
|}
 
|}
Line 552: Line 1,572:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceNotification(Framebuffer:PFramebufferDevice; Callback:TFramebufferNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceNotification(Framebuffer:PFramebufferDevice; Callback:TFramebufferNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Register a notification for framebuffer device changes</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Framebuffer
| To be documented
+
| The framebuffer device to notify changes for (Optional, pass nil for all framebuffer devices)
 +
|-
 +
! Callback
 +
| The function to call when a notification event occurs
 +
|-
 +
! Data
 +
| A private data pointer to pass to callback when a notification event occurs
 +
|-
 +
! Notification
 +
| The events to register for notification of (eg DEVICE_NOTIFICATION_REGISTER)
 +
|-
 +
! Flags
 +
| The flags to control the notification (eg NOTIFIER_FLAG_WORKER)
 
|-
 
|-
 
|}
 
|}
Line 563: Line 1,595:
 
<br />
 
<br />
  
 +
'''RTL framebuffer functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function SysFramebufferAvailable:Boolean;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if a framebuffer device is available</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''Framebuffer helper functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceGetCount:LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current framebuffer device count</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceGetDefault:PFramebufferDevice;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current default framebuffer device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceSetDefault(Framebuffer:PFramebufferDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current default framebuffer device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceCheck(Framebuffer:PFramebufferDevice):PFramebufferDevice;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if the supplied Framebuffer device is in the Framebuffer table</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferDeviceSwap(Value:LongWord):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' No longer required (See ColorDefaultToFormat and ColorFormatToDefault)</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferTypeToString(FramebufferType:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Framebuffer type value to a string</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferStateToString(FramebufferState:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Framebuffer state value to a string</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure FramebufferDeviceHideCursor(Framebuffer:PFramebufferDevice);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Restore the framebuffer area under the cursor from the cursor buffer</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Caller must hold the framebuffer lock
 +
Driver support function only, not intended for direct use by applications
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure FramebufferDeviceShowCursor(Framebuffer:PFramebufferDevice);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Save the framebuffer area under the cursor to the cursor buffer and merge the cursor input with it to create the cursor output. Put the output to the framebuffer.</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Caller must hold the framebuffer lock
 +
Driver support function only, not intended for direct use by applications.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferCursorToString(State:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferDepthToString(Depth:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferOrderToString(Order:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferModeToString(Mode:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FramebufferRotationToString(Rotation:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
Return to [[Unit_Reference|Unit Reference]]
 
Return to [[Unit_Reference|Unit Reference]]

Latest revision as of 04:50, 10 October 2023

Return to Unit Reference


Description


Ultibo Framebuffer Interface unit

Constants



Framebuffer specific constants FRAMEBUFFER_*
FRAMEBUFFER_NAME_PREFIX = 'Framebuffer'; Name prefix for Framebuffer Devices


Framebuffer device type FRAMEBUFFER_TYPE_*
FRAMEBUFFER_TYPE_NONE = 0;  
FRAMEBUFFER_TYPE_HARDWARE = 1;  
FRAMEBUFFER_TYPE_VIRTUAL = 2;  
 
FRAMEBUFFER_TYPE_MAX = 2;  


Framebuffer device state FRAMEBUFFER_STATE_*
FRAMEBUFFER_STATE_DISABLED = 0;  
FRAMEBUFFER_STATE_ENABLED = 1;  
 
FRAMEBUFFER_STATE_MAX = 1;  


Framebuffer cursor state FRAMEBUFFER_CURSOR_*
FRAMEBUFFER_CURSOR_DISABLED = 0;  
FRAMEBUFFER_CURSOR_ENABLED = 1;  


Framebuffer device flag FRAMEBUFFER_FLAG_*
FRAMEBUFFER_FLAG_NONE = $00000000;  
FRAMEBUFFER_FLAG_DMA = $00000001; If set the framebuffer supports DMA for read/write operations
FRAMEBUFFER_FLAG_MARK = $00000002; If set the framebuffer requires mark after write operations
FRAMEBUFFER_FLAG_COMMIT = $00000004; If set the framebuffer requires commit after write operations
FRAMEBUFFER_FLAG_BLANK = $00000008; If set the framebuffer supports blanking the screen
FRAMEBUFFER_FLAG_CACHED = $00000010; If set framebuffer is in cached memory and cache cleaning should be used
FRAMEBUFFER_FLAG_SWAP = $00000020; If set framebuffer requires byte order of colors to be reversed (BGR <-> RGB)
FRAMEBUFFER_FLAG_BACKLIGHT = $00000040; If set the framebuffer supports setting the backlight brightness
FRAMEBUFFER_FLAG_VIRTUAL = $00000080; If set the framebuffer supports virtual width and height
FRAMEBUFFER_FLAG_OFFSETX = $00000100; If set the framebuffer supports virtual offset X (Horizontal Pan/Flip etc)
FRAMEBUFFER_FLAG_OFFSETY = $00000200; If set the framebuffer supports virtual offset Y (Vertical Pan/Flip etc)
FRAMEBUFFER_FLAG_SYNC = $00000400; If set the framebuffer supports waiting for vertical sync
FRAMEBUFFER_FLAG_CURSOR = $00000800; If set the framebuffer supports a hardware mouse cursor


Framebuffer transfer flag FRAMEBUFFER_TRANSFER_*
FRAMEBUFFER_TRANSFER_NONE = $00000000;  
FRAMEBUFFER_TRANSFER_DMA = $00000001; Use DMA for transfer operations (Note: Buffers must be DMA compatible)


Type definitions



Framebuffer palette

PFramebufferPalette = ^TFramebufferPalette;

TFramebufferPalette = record

Start:LongWord; The number of the first valid entry in the palette
Count:LongWord; The total number of entries in the palette
Entries:array[0..255] of LongWord; The palette entries in COLOR_FORMAT_DEFAULT format

Framebuffer properties

PFramebufferProperties = ^TFramebufferProperties;

TFramebufferProperties = record

Flags:LongWord; Framebuffer device flags (eg FRAMEBUFFER_FLAG_COMMIT) (Ignored for Allocate/SetProperties)
Address:PtrUInt; Framebuffer address (Ignored for Allocate/SetProperties)
Size:LongWord; Framebuffer size (Bytes) (Ignored for Allocate/SetProperties)
Pitch:LongWord; Framebuffer pitch (Bytes per Line) (Ignored for Allocate/SetProperties)
Depth:LongWord; Framebuffer depth (Bits per Pixel)(8/16/24/32)
Order:LongWord; Framebuffer pixel order (BGR/RGB)
Mode:LongWord; Framebuffer alpha mode (Enabled/Reversed/Ignored)
Format:LongWord; Framebuffer color format (eg COLOR_FORMAT_ARGB32) (Ignored for Allocate/SetProperties)
PhysicalWidth:LongWord; Framebuffer Physical Width (Pixels)
PhysicalHeight:LongWord; Framebuffer Physical Height (Pixels)
VirtualWidth:LongWord; Framebuffer Virtual Width (Pixels)
VirtualHeight:LongWord; Framebuffer Virtual Height (Pixels)
OffsetX:LongWord; Framebuffer Virtual Offset X (Pixels)
OffsetY:LongWord; Framebuffer Virtual Offset Y (Pixels)
OverscanTop:LongWord; Framebuffer Overscan Top (Pixels)
OverscanBottom:LongWord; Framebuffer Overscan Bottom (Pixels)
OverscanLeft:LongWord; Framebuffer Overscan Left (Pixels)
OverscanRight:LongWord; Framebuffer Overscan Right (Pixels)
Rotation:LongWord; Framebuffer Rotation (eg FRAMEBUFFER_ROTATION_180)
CursorX:LongWord; Framebuffer Cursor X (Pixels) (Ignored for Allocate / SetProperties)
CursorY:LongWord; Framebuffer Cursor Y (Pixels) (Ignored for Allocate / SetProperties)
CursorState:LongWord; Framebuffer Cursor State (eg FRAMEBUFFER_CURSOR_ENABLED) (Ignored for Allocate / SetProperties)

Framebuffer enumeration callback

TFramebufferEnumerate = function(Framebuffer:PFramebufferDevice; Data:Pointer):LongWord;

Framebuffer notification callback

TFramebufferNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;

Framebuffer device allocate

TFramebufferDeviceAllocate = function(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;

Framebuffer device release

TFramebufferDeviceRelease = function(Framebuffer:PFramebufferDevice):LongWord;

Framebuffer device blank

TFramebufferDeviceBlank = function(Framebuffer:PFramebufferDevice; Blank:Boolean):LongWord;

Framebuffer device read

TFramebufferDeviceRead = function(Framebuffer:PFramebufferDevice; X,Y:LongWord; Buffer:Pointer; Len,Flags:LongWord):LongWord;

Framebuffer device write

TFramebufferDeviceWrite = function(Framebuffer:PFramebufferDevice; X,Y:LongWord; Buffer:Pointer; Len,Flags:LongWord):LongWord;

Framebuffer device mark

TFramebufferDeviceMark = function(Framebuffer:PFramebufferDevice; X,Y,Width,Height,Flags:LongWord):LongWord;

Framebuffer device commit

TFramebufferDeviceCommit = function(Framebuffer:PFramebufferDevice; Address:PtrUInt; Size,Flags:LongWord):LongWord;

Framebuffer device get rect

TFramebufferDeviceGetRect = function(Framebuffer:PFramebufferDevice; X,Y:LongWord; Buffer:Pointer; Width,Height,Skip,Flags:LongWord):LongWord;

Framebuffer device put rect

TFramebufferDevicePutRect = function(Framebuffer:PFramebufferDevice; X,Y:LongWord; Buffer:Pointer; Width,Height,Skip,Flags:LongWord):LongWord;

Framebuffer device copy rect

TFramebufferDeviceCopyRect = function(Framebuffer:PFramebufferDevice; X1,Y1,X2,Y2,Width,Height,Flags:LongWord):LongWord;

Framebuffer device fill rect

TFramebufferDeviceFillRect = function(Framebuffer:PFramebufferDevice; X,Y,Width,Height,Color,Flags:LongWord):LongWord;

Framebuffer device get line

TFramebufferDeviceGetLine = function(Framebuffer:PFramebufferDevice; Y:LongWord):Pointer;

Framebuffer device get point

TFramebufferDeviceGetPoint = function(Framebuffer:PFramebufferDevice; X,Y:LongWord):Pointer;

Framebuffer device wait sync

TFramebufferDeviceWaitSync = function(Framebuffer:PFramebufferDevice):LongWord;

Framebuffer device get offset

TFramebufferDeviceGetOffset = function(Framebuffer:PFramebufferDevice; var X,Y:LongWord):LongWord;

Framebuffer device set offset

TFramebufferDeviceSetOffset = function(Framebuffer:PFramebufferDevice; X,Y:LongWord;Pan:Boolean):LongWord;

Framebuffer device set offset ex

TFramebufferDeviceSetOffsetEx = function(Framebuffer:PFramebufferDevice; X,Y:LongWord; Pan,Switch:Boolean):LongWord;

Framebuffer device get palette

TFramebufferDeviceGetPalette = function(Framebuffer:PFramebufferDevice; Palette:PFramebufferPalette):LongWord;

Framebuffer device set palette

TFramebufferDeviceSetPalette = function(Framebuffer:PFramebufferDevice; Palette:PFramebufferPalette):LongWord;

Framebuffer device set backlight

TFramebufferDeviceSetBacklight = function(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;

Framebuffer device set cursor

TFramebufferDeviceSetCursor = function(Framebuffer:PFramebufferDevice; Width,Height,HotspotX,HotspotY:LongWord; Image:Pointer; Len:LongWord):LongWord;

Framebuffer device update cursor

TFramebufferDeviceUpdateCursor = function(Framebuffer:PFramebufferDevice; Enabled:Boolean; X,Y:LongInt; Relative:Boolean):LongWord;

Framebuffer device get properties

TFramebufferDeviceGetProperties = function(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;

Framebuffer device set properties

TFramebufferDeviceSetProperties = function(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;

Framebuffer device

PFramebufferDevice = ^TFramebufferDevice;

TFramebufferDevice = record

Device Properties
Device:TDevice; The Device entry for this Framebuffer device
Framebuffer Properties
FramebufferId:LongWord; Unique Id of this Framebuffer device in the Framebuffer device table
FramebufferState:LongWord; Framebuffer device state (eg FRAMEBUFFER_STATE_ENABLED)
DeviceAllocate:TFramebufferDeviceAllocate; A device specific DeviceAllocate method implementing a standard framebuffer device interface (Mandatory)
DeviceRelease:TFramebufferDeviceRelease; A device specific DeviceRelease method implementing a standard framebuffer device interface (Mandatory)
DeviceBlank:TFramebufferDeviceBlank; A device specific DeviceBlank method implementing a standard framebuffer device interface (Optional)
DeviceRead:TFramebufferDeviceRead; A device specific DeviceRead method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
DeviceWrite:TFramebufferDeviceWrite; A device specific DeviceWrite method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
DeviceMark:TFramebufferDeviceMark; A device specific DeviceMark method implementing a standard framebuffer device interface (Optional)
DeviceCommit:TFramebufferDeviceCommit; A device specific DeviceCommit method implementing a standard framebuffer device interface (Optional)
DeviceGetRect:TFramebufferDeviceGetRect; A device specific DeviceGetRect method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
DevicePutRect:TFramebufferDevicePutRect; A device specific DevicePutRect method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
DeviceCopyRect:TFramebufferDeviceCopyRect; A device specific DeviceCopyRect method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
DeviceFillRect:TFramebufferDeviceFillRect; A device specific DeviceFillRect method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
DeviceGetLine:TFramebufferDeviceGetLine; A device specific DeviceGetLine method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
DeviceGetPoint:TFramebufferDeviceGetPoint; A device specific DeviceGetPoint method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
DeviceWaitSync:TFramebufferDeviceWaitSync; A device specific DeviceWaitSync method implementing a standard framebuffer device interface (Optional)
DeviceGetOffset:TFramebufferDeviceGetOffset; A device specific DeviceGetOffset method implementing a standard framebuffer device interface (Optional)
DeviceSetOffset:TFramebufferDeviceSetOffset; A device specific DeviceSetOffset method implementing a standard framebuffer device interface (Optional)
DeviceSetOffsetEx:TFramebufferDeviceSetOffsetEx; A device specific DeviceSetOffsetEx method implementing a standard framebuffer device interface (Optional)
DeviceGetPalette:TFramebufferDeviceGetPalette; A device specific DeviceGetPalette method implementing a standard framebuffer device interface (Optional)
DeviceSetPalette:TFramebufferDeviceSetPalette; A device specific DeviceSetPalette method implementing a standard framebuffer device interface (Optional)
DeviceSetBacklight:TFramebufferDeviceSetBacklight; A device specific DeviceSetBacklight method implementing a standard framebuffer device interface (Optional)
DeviceSetCursor:TFramebufferDeviceSetCursor; A device specific DeviceSetCursor method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
DeviceUpdateCursor:TFramebufferDeviceUpdateCursor; A device specific DeviceUpdateCursor method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
DeviceGetProperties:TFramebufferDeviceGetProperties; A device specific DeviceGetProperties method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
DeviceSetProperties:TFramebufferDeviceSetProperties; A device specific DeviceSetProperties method implementing a standard framebuffer device interface (Or nil if the default method is suitable)
Statistics Properties
AllocateCount:LongWord;  
ReleaseCount:LongWord;  
ReadCount:LongWord;  
WriteCount:LongWord;  
GetCount:LongWord;  
PutCount:LongWord;  
CopyCount:LongWord;  
FillCount:LongWord;  
Driver Properties
Lock:TMutexHandle; Device lock
Address:PtrUInt; Framebuffer address
Size:LongWord; Framebuffer size (Bytes)
Pitch:LongWord; Framebuffer pitch (Bytes per Line)
Depth:LongWord; Framebuffer depth (Bits per Pixel)(8/16/24/32)
Order:LongWord; Framebuffer pixel order (BGR/RGB)
Mode:LongWord; Framebuffer alpha mode (Enabled/Reversed/Ignored)
Format:LongWord; Framebuffer color format (eg COLOR_FORMAT_ARGB32)
PhysicalWidth:LongWord; Framebuffer Physical Width (Pixels)
PhysicalHeight:LongWord; Framebuffer Physical Height (Pixels)
VirtualWidth:LongWord; Framebuffer Virtual Width (Pixels)
VirtualHeight:LongWord; Framebuffer Virtual Height (Pixels)
OffsetX:LongWord; Framebuffer Virtual Offset X (Pixels)
OffsetY:LongWord; Framebuffer Virtual Offset Y (Pixels)
OverscanTop:LongWord; Framebuffer Overscan Top (Pixels)
OverscanBottom:LongWord; Framebuffer Overscan Bottom (Pixels)
OverscanLeft:LongWord; Framebuffer Overscan Left (Pixels)
OverscanRight:LongWord; Framebuffer Overscan Right (Pixels)
Rotation:LongWord; Framebuffer Rotation (eg FRAMEBUFFER_ROTATION_180)
CursorX:LongWord; Framebuffer Cursor X (Pixels)
CursorY:LongWord; Framebuffer Cursor Y (Pixels)
CursorState:LongWord; Framebuffer Cursor State (eg FRAMEBUFFER_CURSOR_ENABLED)
Buffer Properties
LineBuffer:Pointer; Buffer for line fills
CopyBuffer:Pointer; Buffer for overlapped copy
Cursor Properties
CursorUpdate:LongBool; Flag to indicate if cursor update (Show/Hide) is in progress
CursorImage:Pointer; Buffer for cursor image pixels (COLOR_FORMAT_DEFAULT)
CursorInput:Pointer; Buffer for cursor image pixels (Native color format)
CursorBuffer:Pointer; Buffer for pixels currently under cursor (Native color format)
CursorOutput:Pointer; Buffer for cursor pixels currently displayed (Native color format)
CursorWidth:LongWord; Framebuffer Cursor Width (Pixels)
CursorHeight:LongWord; Framebuffer Cursor Height (Pixels)
CursorHotspotX:LongWord; Framebuffer Cursor Hotspot X (Pixels)
CursorHotspotY:LongWord; Framebuffer Cursor Hotspot Y (Pixels)
Internal Properties
Prev:PFramebufferDevice; Previous entry in Framebuffer device table
Next:PFramebufferDevice; Next entry in Framebuffer device table


Public variables



Initialization handlers

FramebufferInitHandler:TFramebufferInit;


Function declarations



Initialization functions

procedure FramebufferInit;
Description: Initialize the Framebuffer unit and Framebuffer device table
Note Called only during system startup


Framebuffer functions

function FramebufferDeviceAllocate(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Description: Allocate and enable a framebuffer device using supplied properties or defaults
Framebuffer The framebuffer device to allocate
Properties The framebuffer properties (Width/Height/Depth etc) to use for allocation (Optional)
Return ERROR_SUCCESS if completed or another error code on failure


function FramebufferDeviceRelease(Framebuffer:PFramebufferDevice):LongWord;
Description: Disable and release a framebuffer device
Framebuffer The framebuffer device to release
Return ERROR_SUCCESS if completed or another error code on failure


function FramebufferDeviceBlank(Framebuffer:PFramebufferDevice; Blank:Boolean):LongWord;
Description: Blank (Turn off) the display of a framebuffer device
Framebuffer The framebuffer device to blank
Blank Turn off the display if True/Turn on the display if False
Return ERROR_SUCCESS if completed or another error code on failure
Note Not all framebuffer devices support blank, returns ERROR_CALL_NOT_IMPLEMENTED if not supported.

Devices that support blank should set the flag FRAMEBUFFER_FLAG_BLANK


function FramebufferDeviceRead(Framebuffer:PFramebufferDevice; X,Y:LongWord; Buffer:Pointer; Len,Flags:LongWord):LongWord;
Description: Read one or more pixels from framebuffer device memory to a supplied buffer
Framebuffer The framebuffer device to read from
X The column to start reading from
Y The row to start reading from
Buffer Pointer to a buffer to receive the read pixels
Len The number of pixels to read starting at X,Y
Flags The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
Return ERROR_SUCCESS if completed or another error code on failure
Note Pixel data will be returned in the color format of the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache cleaning before a DMA read.


function FramebufferDeviceWrite(Framebuffer:PFramebufferDevice; X,Y:LongWord; Buffer:Pointer; Len,Flags:LongWord):LongWord;
Description: Write one or more pixels to framebuffer device memory from a supplied buffer
Framebuffer The framebuffer device to write to
X The column to start writing from
Y The row to start writing from
Buffer Pointer to a buffer containing the pixels to write
Len The number of pixels to write starting at X,Y
Flags The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
Return ERROR_SUCCESS if completed or another error code on failure
Note Caller must ensure pixel data is in the correct color format for the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache invalidation after a DMA write.


function FramebufferDeviceMark(Framebuffer:PFramebufferDevice; X,Y,Width,Height,Flags:LongWord):LongWord;
Description: Mark a region written to the framebuffer and signal the device to take any necessary actions
Framebuffer The framebuffer device to mark
X The starting column of the mark
Y The starting row of the mark
Width The number of columns to mark
Height The number of rows to mark
Flags The flags used for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
Return ERROR_SUCCESS if completed or another error code on failure
Note Not all framebuffer devices support mark, returns ERROR_CALL_NOT_IMPLEMENTED if not supported.

Devices that support and require mark should set the flag FRAMEBUFFER_FLAG_MARK


function FramebufferDeviceCommit(Framebuffer:PFramebufferDevice; Address:PtrUInt; Size,Flags:LongWord):LongWord;
Description: Commit a region written to the framebuffer and signal the device to take any necessary actions
Framebuffer The framebuffer device to commit
Address The starting address of the commit
Size The size in bytes of the commit
Flags The flags used for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
Return ERROR_SUCCESS if completed or another error code on failure
Note Not all framebuffer devices support commit, returns ERROR_CALL_NOT_IMPLEMENTED if not supported.

Devices that support and require commit should set the flag FRAMEBUFFER_FLAG_COMMIT


function FramebufferDeviceGetRect(Framebuffer:PFramebufferDevice; X,Y:LongWord; Buffer:Pointer; Width,Height,Skip,Flags:LongWord):LongWord;
Description: Get a rectangular area of pixels from framebuffer memory to a supplied buffer
Framebuffer The framebuffer device to get from
X The starting column of the get
Y The starting row of the get
Buffer Pointer to a block of memory large enough to hold the pixels in a contiguous block of rows
Width The number of columns to get
Height The number of rows to get
Skip The number of pixels to skip in the buffer after each row (Optional)
Flags The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
Return ERROR_SUCCESS if completed or another error code on failure
Note Pixel data will be returned in the color format of the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache cleaning before a DMA read.


function FramebufferDevicePutRect(Framebuffer:PFramebufferDevice; X,Y:LongWord;Buffer:Pointer; Width,Height,Skip,Flags:LongWord):LongWord;
Description: Put a rectangular area of pixels from a supplied buffer to framebuffer memory
Framebuffer The framebuffer device to put to
X The starting column of the put
Y The starting row of the put
Buffer Pointer to a block of memory containing the pixels in a contiguous block of rows
Width The number of columns to put
Height The number of rows to put
Skip The number of pixels to skip in the buffer after each row (Optional)
Flags The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
Return ERROR_SUCCESS if completed or another error code on failure
Note Caller must ensure pixel data is in the correct color format for the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache invalidation after a DMA write.


function FramebufferDeviceCopyRect(Framebuffer:PFramebufferDevice; X1,Y1,X2,Y2,Width,Height,Flags:LongWord):LongWord;
Description: Copy a rectangular area of pixels within framebuffer memory
Framebuffer The framebuffer device to copy on
X1 The starting column to copy from
Y1 The starting row to copy from
X2 The starting column to copy to
Y2 The starting row to copy to
Width The number of columns to copy
Height The number of rows to copy
Flags The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
Return ERROR_SUCCESS if completed or another error code on failure
Note The default method assumes that framebuffer memory is DMA coherent and does not require cache clean/invalidate before or after a DMA read/write.


function FramebufferDeviceFillRect(Framebuffer:PFramebufferDevice; X,Y,Width,Height,Color,Flags:LongWord):LongWord;
Description: Fill a rectangular area of pixels within framebuffer memory
Framebuffer The framebuffer device to fill on
X The starting column of the fill
Y The starting row of the fill
Width The number of columns to fill
Height The number of rows to fill
Color The color to use for the fill
Flags The flags for the transfer (eg FRAMEBUFFER_TRANSFER_DMA)
Return ERROR_SUCCESS if completed or another error code on failure
Note Color must be specified in the correct format for the framebuffer. The default method assumes that framebuffer memory is DMA coherent and does not require cache invalidation after a DMA write.


function FramebufferDeviceGetLine(Framebuffer:PFramebufferDevice; Y:LongWord):Pointer;
Description: Get the address of the start of a row in framebuffer memory
Framebuffer The framebuffer device to get the start address from
Y The row to get the start address of
Return Pointer to the start address of the row or nil on failure


function FramebufferDeviceGetPoint(Framebuffer:PFramebufferDevice; X,Y:LongWord):Pointer;
Description: Get the address of the specified row and column in framebuffer memory
Framebuffer The framebuffer device to get the address from
X The column to get the start address of
Y The row to get the start address of
Return Pointer to the address of the row and column or nil on failure


function FramebufferDeviceWaitSync(Framebuffer:PFramebufferDevice):LongWord;
Description: Wait for the next vertical sync signal from the display hardware
Framebuffer The framebuffer device to wait for
Return ERROR_SUCCESS if completed or another error code on failure
Note Not all framebuffer devices support wait sync, returns ERROR_CALL_NOT_IMPLEMENTED if not supported.

Devices that support wait sync should set the flag FRAMEBUFFER_FLAG_SYNC


function FramebufferDeviceGetOffset(Framebuffer:PFramebufferDevice; var X,Y:LongWord):LongWord;
Description: Get the virtual offset X and Y from a framebuffer device
Framebuffer The framebuffer device to get the offset from
X The X (Column) offset value in pixels returned from the device if successful
Y The Y (Row) offset value in pixels returned from the device if successful
Return ERROR_SUCCESS if completed or another error code on failure
Note X and Y are relative to the virtual buffer and NOT the physical screen (Where applicable)

Not all framebuffer devices support X and/or Y offset
Devices that support offset X should set the flag FRAMEBUFFER_FLAG_OFFSETX
Devices that support offset Y should set the flag FRAMEBUFFER_FLAG_OFFSETY


function FramebufferDeviceSetOffset(Framebuffer:PFramebufferDevice; X,Y:LongWord; Pan:Boolean):LongWord; inline;
Description: Set the virtual offset X and Y of a framebuffer device
Framebuffer The framebuffer device to set the offset for
X The X (Column) offset value in pixels to set
Y The Y (Row) offset value in pixels to set
Pan If True then pan the display without updating the Offset X and/or Y
Return ERROR_SUCCESS if completed or another error code on failure
Note X and Y are relative to the virtual buffer and NOT the physical screen (Where applicable)

Not all framebuffer devices support X and/or Y offset, returns ERROR_CALL_NOT_IMPLEMENTED if not supported
Devices that support offset X should set the flag FRAMEBUFFER_FLAG_OFFSETX
Devices that support offset Y should set the flag FRAMEBUFFER_FLAG_OFFSETY


function FramebufferDeviceSetOffsetEx(Framebuffer:PFramebufferDevice; X,Y:LongWord; Pan,Switch:Boolean):LongWord;
Description: Set the virtual offset X and Y of a framebuffer device
Framebuffer The framebuffer device to set the offset for
X The X (Column) offset value in pixels to set
Y The Y (Row) offset value in pixels to set
Pan If True then pan the display without updating the Offset X and/or Y
Switch If False then update the Offset X and/or Y without moving the display
Return ERROR_SUCCESS if completed or another error code on failure
Note X and Y are relative to the virtual buffer and NOT the physical screen (Where applicable)

Not all framebuffer devices support X and/or Y offset, returns ERROR_CALL_NOT_IMPLEMENTED if not supported
Devices that support offset X should set the flag FRAMEBUFFER_FLAG_OFFSETX
Devices that support offset Y should set the flag FRAMEBUFFER_FLAG_OFFSETY


function FramebufferDeviceGetPalette(Framebuffer:PFramebufferDevice; Palette:PFramebufferPalette):LongWord;
Description: Get the 8 bit color palette from a framebuffer device
Framebuffer The framebuffer device to get the palette from
Palette Pointer to a TFramebufferPalette structure for the palette data
Return ERROR_SUCCESS if completed or another error code on failure
Note Not all framebuffer devices support 8 bit palette, returns ERROR_CALL_NOT_IMPLEMENTED if not supported.


function FramebufferDeviceSetPalette(Framebuffer:PFramebufferDevice; Palette:PFramebufferPalette):LongWord;
Description: Set the 8 bit color palette of a framebuffer device
Framebuffer The framebuffer device to set the palette for
Palette Pointer to a TFramebufferPalette structure for the palette data
Return ERROR_SUCCESS if completed or another error code on failure
Note Not all framebuffer devices support 8 bit palette, returns ERROR_CALL_NOT_IMPLEMENTED if not supported.


function FramebufferDeviceSetBacklight(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;
Description: Set the brightness of the backlight of a framebuffer device
Framebuffer The framebuffer device to set the backlight
Brightness The brightness value to set (Normally 0 to 100)
Return ERROR_SUCCESS if completed or another error code on failure
Note Not all framebuffer devices support set backlight, returns ERROR_CALL_NOT_IMPLEMENTED if not supported.

Devices that support set backlight should set the flag FRAMEBUFFER_FLAG_BACKLIGHT


function FramebufferDeviceSetCursor(Framebuffer:PFramebufferDevice; Width,Height,HotspotX,HotspotY:LongWord; Image:Pointer; Len:LongWord):LongWord;
Description: Set the mouse cursor image and properties of a framebuffer device
Framebuffer The framebuffer device to set the cursor
Width The width of the cursor image in pixels
Height The height of the cursor image in pixels
HotspotX The X hotspot of the cursor image, where the cursor X location will be (Normally 0).
HotspotY The Y hotspot of the cursor image, where the cursor Y location will be (Normally 0).
Image A buffer containing the cursor image pixels in COLOR_FORMAT_DEFAULT format
Len The length of the image buffer in bytes
Return ERROR_SUCCESS if completed or another error code on failure
Note For devices that don't support hardware mouse cursor a software cursor will be implemented

If image is nil then the default cursor image will be used


function FramebufferDeviceUpdateCursor(Framebuffer:PFramebufferDevice; Enabled:Boolean; X,Y:LongInt; Relative:Boolean):LongWord;
Description: Update the position and state for the mouse cursor of a framebuffer device
Framebuffer The framebuffer device to update the cursor
Enabled If true then show the cursor else hide it
X The cursor X location in pixels
Y The cursor Y location in pixels
Relative If true then X and Y are considered relative to the current position
Return ERROR_SUCCESS if completed or another error code on failure
Note For devices that don't support hardware mouse cursor a software cursor will be implemented


function FramebufferDeviceGetProperties(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Description: Get the current properties from a framebuffer device
Framebuffer The framebuffer device to get properties from
Properties Pointer to a TFramebufferProperties structure to return
Return ERROR_SUCCESS if completed or another error code on failure


function FramebufferDeviceSetProperties(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Description: Set the current properties for a framebuffer device
Framebuffer The framebuffer device to set properties for
Properties Pointer to a TFramebufferProperties structure containing the properties
Return ERROR_SUCCESS if completed or another error code on failure
Note Changing certain properties may cause the framebuffer to be reallocated


function FramebufferDeviceCheckFlag(Framebuffer:PFramebufferDevice; Flag:LongWord):Boolean;
Description: Check if a framebuffer device supports a flag value
Framebuffer The framebuffer device to check
Flag The framebuffer flag to check (eg FRAMEBUFFER_FLAG_BACKLIGHT)
Return True if flag is supported, False if not or on error.


function FramebufferDeviceGetFormat(Framebuffer:PFramebufferDevice):LongWord;
Description: Get the color format of a framebuffer device
Framebuffer The framebuffer device to get from
Return The color format of the framebuffer (eg COLOR_FORMAT_RGB24)


function FramebufferDeviceCreate:PFramebufferDevice;
Description: Create a new Framebuffer entry
Return Pointer to new Framebuffer entry or nil if Framebuffer could not be created


function FramebufferDeviceCreateEx(Size:LongWord):PFramebufferDevice;
Description: Create a new Framebuffer entry
Size Size in bytes to allocate for new Framebuffer (Including the Framebuffer entry)
Return Pointer to new Framebuffer entry or nil if Framebuffer could not be created


function FramebufferDeviceDestroy(Framebuffer:PFramebufferDevice):LongWord;
Description: Destroy an existing Framebuffer entry
Framebuffer The framebuffer device to destroy
Return ERROR_SUCCESS if completed or another error code on failure


function FramebufferDeviceRegister(Framebuffer:PFramebufferDevice):LongWord;
Description: Register a new Framebuffer in the Framebuffer table
Framebuffer The framebuffer device to register
Return ERROR_SUCCESS if completed or another error code on failure


function FramebufferDeviceDeregister(Framebuffer:PFramebufferDevice):LongWord;
Description: Deregister a Framebuffer from the Framebuffer table
Framebuffer The framebuffer device to deregister
Return ERROR_SUCCESS if completed or another error code on failure


function FramebufferDeviceFind(FramebufferId:LongWord):PFramebufferDevice;
Description: Find a framebuffer device by ID in the framebuffer table
FramebufferId The ID number of the framebuffer to find
Return Pointer to framebuffer device entry or nil if not found


function FramebufferDeviceFindByName(const Name:String):PFramebufferDevice; inline;
Description: Find a framebuffer device by name in the framebuffer table
Name The name of the framebuffer to find (eg Framebuffer0)
Return Pointer to framebuffer device entry or nil if not found


function FramebufferDeviceFindByDescription(const Description:String):PFramebufferDevice; inline;
Description: Find a framebuffer device by description in the framebuffer table
Description The description of the framebuffer to find (eg BCM2836 Framebuffer)
Return Pointer to framebuffer device entry or nil if not found


function FramebufferDeviceEnumerate(Callback:TFramebufferEnumerate; Data:Pointer):LongWord;
Description: Enumerate all framebuffer devices in the framebuffer table
Callback The callback function to call for each framebuffer in the table
Data A private data pointer to pass to callback for each framebuffer in the table
Return ERROR_SUCCESS if completed or another error code on failure


function FramebufferDeviceNotification(Framebuffer:PFramebufferDevice; Callback:TFramebufferNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: Register a notification for framebuffer device changes
Framebuffer The framebuffer device to notify changes for (Optional, pass nil for all framebuffer devices)
Callback The function to call when a notification event occurs
Data A private data pointer to pass to callback when a notification event occurs
Notification The events to register for notification of (eg DEVICE_NOTIFICATION_REGISTER)
Flags The flags to control the notification (eg NOTIFIER_FLAG_WORKER)


RTL framebuffer functions

function SysFramebufferAvailable:Boolean;
Description: Check if a framebuffer device is available
Note None documented


Framebuffer helper functions

function FramebufferDeviceGetCount:LongWord;
Description: Get the current framebuffer device count
Note None documented


function FramebufferDeviceGetDefault:PFramebufferDevice;
Description: Get the current default framebuffer device
Note None documented


function FramebufferDeviceSetDefault(Framebuffer:PFramebufferDevice):LongWord;
Description: Set the current default framebuffer device
Note None documented


function FramebufferDeviceCheck(Framebuffer:PFramebufferDevice):PFramebufferDevice;
Description: Check if the supplied Framebuffer device is in the Framebuffer table
Note None documented


function FramebufferDeviceSwap(Value:LongWord):LongWord; inline;
Description: No longer required (See ColorDefaultToFormat and ColorFormatToDefault)
Note None documented


function FramebufferTypeToString(FramebufferType:LongWord):String;
Description: Convert a Framebuffer type value to a string
Note None documented


function FramebufferStateToString(FramebufferState:LongWord):String;
Description: Convert a Framebuffer state value to a string
Note None documented


procedure FramebufferDeviceHideCursor(Framebuffer:PFramebufferDevice);
Description: Restore the framebuffer area under the cursor from the cursor buffer
Note Caller must hold the framebuffer lock

Driver support function only, not intended for direct use by applications


procedure FramebufferDeviceShowCursor(Framebuffer:PFramebufferDevice);
Description: Save the framebuffer area under the cursor to the cursor buffer and merge the cursor input with it to create the cursor output. Put the output to the framebuffer.
Note Caller must hold the framebuffer lock

Driver support function only, not intended for direct use by applications.


function FramebufferCursorToString(State:LongWord):String;
Description: To be documented
Note None documented


function FramebufferDepthToString(Depth:LongWord):String;
Description: To be documented
Note None documented


function FramebufferOrderToString(Order:LongWord):String;
Description: To be documented
Note None documented


function FramebufferModeToString(Mode:LongWord):String;
Description: To be documented
Note None documented


function FramebufferRotationToString(Rotation:LongWord):String;
Description: To be documented
Note None documented


Return to Unit Reference