libkovan  1
The kovan standard library
graphics.h File Reference

Methods for displaying graphics to the screen. More...

#include "export.h"
#include "vtable.h"

Go to the source code of this file.

Typedefs

typedef enum Encoding Encoding
 

Enumerations

enum  Encoding { RGB, BGR }
 
enum  KeyCode {
  KeyEnter = '\n', KeyBackSpace = '\b', KeyTab = '\t', KeyCancel = 0x03,
  KeyClear = 0x0C, KeyShift = 0x10, KeyControl = 0x11, KeyAlt = 0x12,
  KeyPause = 0x13, KeyCapsLock = 0x14, KeyEscape = 0x1B, KeySpace = 0x20,
  KeyPageUp = 0x21, KeyPageDown = 0x22, KeyEnd = 0x23, KeyHome = 0x24,
  KeyLeft = 0x25, KeyUp = 0x26, KeyRight = 0x27, KeyDown = 0x28,
  KeyComma = 0x2C, KeyPeriod = 0x2E, KeySlash = 0x2F, KeyZero = 0x30,
  KeyOne = 0x31, KeyTwo = 0x32, KeyThree = 0x33, KeyFour = 0x34,
  KeyFive = 0x35, KeySix = 0x36, KeySeven = 0x37, KeyEight = 0x38,
  KeyNine = 0x39, KeySemiColon = 0x3B, KeyEquals = 0x3D, KeyA = 0x41,
  KeyB = 0x42, KeyC = 0x43, KeyD = 0x44, KeyE = 0x45,
  KeyF = 0x46, KeyG = 0x47, KeyH = 0x48, KeyI = 0x49,
  KeyJ = 0x4A, KeyK = 0x4B, KeyL = 0x4C, KeyM = 0x4D,
  KeyN = 0x4E, KeyO = 0x4F, KeyP = 0x50, KeyQ = 0x51,
  KeyR = 0x52, KeyS = 0x53, KeyT = 0x54, KeyU = 0x55,
  KeyV = 0x56, KeyW = 0x57, KeyX = 0x58, KeyY = 0x59,
  KeyZ = 0x5A, KeyOpenBracket = 0x5B, KeyBackSlash = 0x5C, KeyCloseBracket = 0x5D,
  KeyNumPad0 = 0x60, KeyNumPad1 = 0x61, KeyNumPad2 = 0x62, KeyNumPad3 = 0x63,
  KeyNumPad4 = 0x64, KeyNumPad5 = 0x65, KeyNumPad6 = 0x66, KeyNumPad7 = 0x67,
  KeyNumPad8 = 0x68, KeyNumPad9 = 0x69, KeyMultiply = 0x6A, KeyAdd = 0x6B,
  KeySeparator = 0x6C, KeySubtract = 0x6D, KeyDecimal = 0x6E, KeyDivide = 0x6F,
  KeyF1 = 0x70, KeyF2 = 0x71, KeyF3 = 0x72, KeyF4 = 0x73,
  KeyF5 = 0x74, KeyF6 = 0x75, KeyF7 = 0x76, KeyF8 = 0x77,
  KeyF9 = 0x78, KeyF10 = 0x79, KeyF11 = 0x7A, KeyF12 = 0x7B,
  KeyDelete = 0x7F, KeyNumLock = 0x90, KeyScrollLock = 0x91, KeyPrintScreen = 0x9A,
  KeyInsert = 0x9B, KeyHelp = 0x9C, KeyMeta = 0x9D, KeyBackQuote = 0xC0,
  KeyQuote = 0xDE, KeyFinal = 0x18, KeyConvert = 0x1C, KeyNonConvert = 0x1D,
  KeyAccept = 0x1E, KeyModeChange = 0x1F, KeyKana = 0x15, KeyKanji = 0x19,
  KeyUndefined = 0x0
}
 

Functions

VF EXPORT_SYM int graphics_open (int width, int height)
 
VF EXPORT_SYM void graphics_close ()
 
VF EXPORT_SYM void graphics_update ()
 
VF EXPORT_SYM void graphics_clear ()
 
VF EXPORT_SYM void graphics_blit (const unsigned char *data, int x, int y, int width, int height)
 
VF EXPORT_SYM void graphics_blit_region (const unsigned char *data, int sx, int sy, int ex, int ey, int width, int height, int dx, int dy)
 
VF EXPORT_SYM void graphics_blit_enc (const unsigned char *data, Encoding enc, int x, int y, int width, int height)
 
VF EXPORT_SYM void graphics_blit_region_enc (const unsigned char *data, Encoding enc, int sx, int sy, int ex, int ey, int width, int height, int dx, int dy)
 
VF EXPORT_SYM void graphics_fill (int r, int g, int b)
 
VF EXPORT_SYM void graphics_pixel (int x, int y, int r, int g, int b)
 
VF EXPORT_SYM void graphics_line (int x1, int y1, int x2, int y2, int r, int g, int b)
 
VF EXPORT_SYM void graphics_circle (int cx, int cy, int radius, int r, int g, int b)
 
VF EXPORT_SYM void graphics_circle_fill (int cx, int cy, int radius, int r, int g, int b)
 
VF EXPORT_SYM void graphics_rectangle (int x1, int y1, int x2, int y2, int r, int g, int b)
 
VF EXPORT_SYM void graphics_rectangle_fill (int x1, int y1, int x2, int y2, int r, int g, int b)
 
VF EXPORT_SYM void graphics_triangle (int x1, int y1, int x2, int y2, int x3, int y3, int r, int g, int b)
 
VF EXPORT_SYM void graphics_triangle_fill (int x1, int y1, int x2, int y2, int x3, int y3, int r, int g, int b)
 
VF EXPORT_SYM int get_key_state (enum KeyCode key)
 
VF EXPORT_SYM void get_mouse_position (int *x, int *y)
 
VF EXPORT_SYM int get_mouse_middle_button ()
 
VF EXPORT_SYM int get_mouse_left_button ()
 
VF EXPORT_SYM int get_mouse_right_button ()
 

Detailed Description

Methods for displaying graphics to the screen.

Author
Braden McDorman

Typedef Documentation

typedef enum Encoding Encoding

Enumeration Type Documentation

enum Encoding
Enumerator
RGB 
BGR 
enum KeyCode
Enumerator
KeyEnter 

enter key

KeyBackSpace 

backspace key

KeyTab 

tab key

KeyCancel 

cancel key

KeyClear 

clear key

KeyShift 

shift key

KeyControl 

control key

KeyAlt 

alt key

KeyPause 

pause key

KeyCapsLock 

capslock key

KeyEscape 

escape key

KeySpace 

space key

KeyPageUp 

page up key

KeyPageDown 

page down key

KeyEnd 

end key

KeyHome 

home key

KeyLeft 

left key

KeyUp 

up arrow key

KeyRight 

right arrow key

KeyDown 

down arrow key

KeyComma 

comma key ','

KeyPeriod 

period key '.'

KeySlash 

slash key '/'

KeyZero 

zero key

KeyOne 

one key

KeyTwo 

two key

KeyThree 

three key

KeyFour 

four key

KeyFive 

five key

KeySix 

six key

KeySeven 

seven key

KeyEight 

eight key

KeyNine 

nine key

KeySemiColon 

semicolon key ';'

KeyEquals 

equals key '='

KeyA 

a key

KeyB 

b key

KeyC 

c key

KeyD 

d key

KeyE 

e key

KeyF 

f key

KeyG 

g key

KeyH 

h key

KeyI 

i key

KeyJ 

j key

KeyK 

k key

KeyL 

l key

KeyM 

m key

KeyN 

n key

KeyO 

o key

KeyP 

p key

KeyQ 

q key

KeyR 

r key

KeyS 

s key

KeyT 

t key

KeyU 

u key

KeyV 

v key

KeyW 

w key

KeyX 

x key

KeyY 

y key

KeyZ 

z key

KeyOpenBracket 

open bracket key '['

KeyBackSlash 

back slash key '\'

KeyCloseBracket 

close bracket key ']'

KeyNumPad0 

numpad 0 key

KeyNumPad1 

numpad 1 key

KeyNumPad2 

numpad 2 key

KeyNumPad3 

numpad 3 key

KeyNumPad4 

numpad 4 key

KeyNumPad5 

numpad 5 key

KeyNumPad6 

numpad 6 key

KeyNumPad7 

numpad 7 key

KeyNumPad8 

numpad 8 key

KeyNumPad9 

numpad 9 key

KeyMultiply 

multiply key '*'

KeyAdd 

add key '+'

KeySeparator 

separator key '-'

KeySubtract 

subtract key '-'

KeyDecimal 

decimal key '.'

KeyDivide 

divide key '/'

KeyF1 

F1 key.

KeyF2 

F2 key.

KeyF3 

F3 key.

KeyF4 

F4 key.

KeyF5 

F5 key.

KeyF6 

F6 key.

KeyF7 

F7 key.

KeyF8 

F8 key.

KeyF9 

F9 key.

KeyF10 

F10 key.

KeyF11 

F11 key.

KeyF12 

F12 key.

KeyDelete 

delete key

KeyNumLock 

numlock key

KeyScrollLock 

scroll lock key

KeyPrintScreen 

print screen key

KeyInsert 

insert key

KeyHelp 

help key

KeyMeta 

meta key

KeyBackQuote 

backquote key

KeyQuote 

quote key

KeyFinal 

final key

KeyConvert 

convert key

KeyNonConvert 

non convert key

KeyAccept 

accept key

KeyModeChange 

mode change key

KeyKana 

kana key

KeyKanji 

kanji key

KeyUndefined 

undefined key

Function Documentation

VF EXPORT_SYM void graphics_blit ( const unsigned char *  data,
int  x,
int  y,
int  width,
int  height 
)

This function is equivalent to calling graphics_blit_enc() with an encoding of RGB

See also
graphics_blit_enc
VF EXPORT_SYM void graphics_blit_region ( const unsigned char *  data,
int  sx,
int  sy,
int  ex,
int  ey,
int  width,
int  height,
int  dx,
int  dy 
)

This function is equivalent to calling graphics_blit_region_enc() with an encoding of RGB

See also
graphics_blit_region_enc