Video: Structures and enumerations
- Enumerations
- VGAG3_COLORS
Some predefined colors.VGAG3_COLOR_TRANSPARENT Transparent color (r=0, g=0, b=0) VGAG3_COLOR_BLACK Black color (r=1, g=1, b=1) VGAG3_COLOR_WHITE White color VGAG3_COLOR_RED Red color VGAG3_COLOR_REDORANGE Redorange color VGAG3_COLOR_ORANGE Orange color VGAG3_COLOR_YELLOWORANGE Yelloworange color VGAG3_COLOR_YELLOW Yellow color VGAG3_COLOR_YELLOWGREEN Yellowgreen color VGAG3_COLOR_GREEN Green color VGAG3_COLOR_TURQUOISEGREEN Turquoisegreen color VGAG3_COLOR_TURQUOISE Turquoise color VGAG3_COLOR_TURQUOISEBLUE Turquoiseblue color VGAG3_COLOR_BLUE Blue color VGAG3_COLOR_BLUEVIOLET Blueviolet color VGAG3_COLOR_VIOLET Violet color VGAG3_COLOR_REDVIOLET Redviolet color VGAG3_COLOR_PINK Pink color VGAG3_COLOR_BROWN Brown color - Definitions
- VGAG3_IMAGE_ATTRIBUTES_DEFAULT(P1)
Initializes a struct vg3_image_attributes variable.
- P1 is an address to the variable
- VGAG3_TEXT_ATTRIBUTES_SET(P1, P2, P3, P4, P5)
Sets a struct vg3_text variable.
- P1 is an address to the variable
- P2 is a filename of a fontfile (variable element fontfile)
- P3 is a character for newline (variable element nl)
- P4 is the size of the text in bytes (variable element tsize)
- P5 is a pointer to the text (variable element text, is being referenced not copied)
- VGAG3_COLOR_CUSTOM(RED, GREEN, BLUE)
Defines a color via RGB.
- RED is the red color component (0 - 255)
- GREEN is the green color component (0 - 255)
- BLUE is the blue color component (0 - 255)
- Structures
- struct vg3_image
Image structure, only internally used. - struct vg3_colormap
Colormap structure, for getting and replacing the colormap with 255 colors.
Only relevant when the window is opened with VGAG3_VGAVERSION_LOW (see VGAG3_VGAVERSIONS).struct c[256] Structure for 256 colors | unsigned char r Red color component | unsigned char g Green color component | unsigned char b Blue color component - struct vg3_image_attributes
Attributes for drawing images or content to window.
Refer to VGAG3_IMAGE_ATTRIBUTES_DEFAULT for initializing this structure.unsigned char bright Brightness: 0=dark to 255=default unsigned char alpha Transparency: 0=transparent to 255=default int zoom Zooming in percent: 100=default int rotate Rotating in degrees: 0 to 359 int flip Flipping: 0=no, 1=vertical, 2=horizontal int fullfill Fitting into the destination: 0=no, 1=zoom to size of destination, -1=zoom to size of destination only if larger - struct vg3_text
Structure for drawing out text.
Refer to VGAG3_TEXT_ATTRIBUTES_SET for setting this structure.char *fontfile Fontfile to load for the text.
Each fontfile must follow the convention for naming:
- <width>x<height>[_<freetext>].font
A fontfile may be located at:
- <path>/<fontfile>: load indivdual fontfile from path
- <fontfile>: load shipped VgaGames3 fontfile, e.g. 10x17.font
- may be appended with + or - (see VG3_font_highdouble())
- NULL: load default fontfile: 8x8.font
For the format of a fontfile refer to 8x8.font below share/
unsigned char nl Character for newline in the text int tsize Size of text in bytes, or 0 = text is a string with terminating null-byte unsigned char *text Pointer to text - struct vg3_rect
Rectangle, mainly used for images.int x Position of image at left upper corner: x-position (horizontal) int y Position of image at left upper corner: y-position (vertical) int w Width of image in pixels int h Height of image in pixels