OldSchool Library
Shapes

Functions

void oslDrawLine (int x0, int y0, int x1, int y1, OSL_COLOR color)
 Draws a line from (x0, y0) to (x1, y1).
 
void oslDrawRect (int x0, int y0, int x1, int y1, OSL_COLOR color)
 Draws an empty rectangle from (x0, y0) to (x1, y1).
 
void oslDrawFillRect (int x0, int y0, int x1, int y1, OSL_COLOR color)
 Draws a filled rectangle from (x0, y0) to (x1, y1).
 
void oslDrawGradientRect (int x0, int y0, int x1, int y1, OSL_COLOR c1, OSL_COLOR c2, OSL_COLOR c3, OSL_COLOR c4)
 Draws a gradient rectangle from (x0, y0) to (x1, y1).
 

Detailed Description

Formerly untextured geometry.

Function Documentation

◆ oslDrawLine()

void oslDrawLine ( int x0,
int y0,
int x1,
int y1,
OSL_COLOR color )
extern

Draws a line from (x0, y0) to (x1, y1).

This function draws a line on the screen from the starting point (x0, y0) to the ending point (x1, y1) using the specified color.

Parameters
x0The x-coordinate of the start point of the line.
y0The y-coordinate of the start point of the line.
x1The x-coordinate of the end point of the line.
y1The y-coordinate of the end point of the line.
colorThe color of the line.

◆ oslDrawRect()

void oslDrawRect ( int x0,
int y0,
int x1,
int y1,
OSL_COLOR color )
extern

Draws an empty rectangle from (x0, y0) to (x1, y1).

This function draws the outline of a rectangle on the screen with the top-left corner at (x0, y0) and the bottom-right corner at (x1, y1). The rectangle is drawn with the specified color.

Parameters
x0The x-coordinate of the top-left corner of the rectangle.
y0The y-coordinate of the top-left corner of the rectangle.
x1The x-coordinate of the bottom-right corner of the rectangle.
y1The y-coordinate of the bottom-right corner of the rectangle.
colorThe color of the rectangle outline.

◆ oslDrawFillRect()

void oslDrawFillRect ( int x0,
int y0,
int x1,
int y1,
OSL_COLOR color )
extern

Draws a filled rectangle from (x0, y0) to (x1, y1).

This function draws a filled rectangle on the screen with the top-left corner at (x0, y0) and the bottom-right corner at (x1, y1). The rectangle is filled with the specified color.

Parameters
x0The x-coordinate of the top-left corner of the rectangle.
y0The y-coordinate of the top-left corner of the rectangle.
x1The x-coordinate of the bottom-right corner of the rectangle.
y1The y-coordinate of the bottom-right corner of the rectangle.
colorThe color used to fill the rectangle.

◆ oslDrawGradientRect()

void oslDrawGradientRect ( int x0,
int y0,
int x1,
int y1,
OSL_COLOR c1,
OSL_COLOR c2,
OSL_COLOR c3,
OSL_COLOR c4 )
extern

Draws a gradient rectangle from (x0, y0) to (x1, y1).

This function draws a rectangle on the screen with a gradient color effect. The gradient transitions from one color to another across the rectangle. The colors are applied as follows:

  • c1 is used for the top-left corner.
  • c2 is used for the top-right corner.
  • c3 is used for the bottom-left corner.
  • c4 is used for the bottom-right corner.
Parameters
x0The x-coordinate of the top-left corner of the rectangle.
y0The y-coordinate of the top-left corner of the rectangle.
x1The x-coordinate of the bottom-right corner of the rectangle.
y1The y-coordinate of the bottom-right corner of the rectangle.
c1The color of the top-left corner.
c2The color of the top-right corner.
c3The color of the bottom-left corner.
c4The color of the bottom-right corner.