Simple Operating System
graphics.h File Reference

Draw pixels in graphics mode. More...

#include "types.h"
Include dependency graph for graphics.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Position
 Position on screen. More...
 

Typedefs

typedef struct Position Position
 Position on screen.
 

Functions

void writePixel (Position pos, Color color)
 Draw single pixel. More...
 
void draw (Position begin, Color *data, size_t width, size_t height)
 Draw picture from raw pixel table. More...
 

Variables

const size_t SIZE_X = 640
 
const size_t SIZE_Y = 350
 

Detailed Description

Draw pixels in graphics mode.

Something like https://www.programmingsimplified.com/c/graphics.h

Todo:

add .bmp pl.wikipedia.org/wiki/Windows_Bitmap

add get window height and window length

Definition in file graphics.h.

Function Documentation

◆ draw()

void draw ( Position  begin,
Color *  data,
size_t  width,
size_t  height 
)

Draw picture from raw pixel table.

Parameters
beginleft right corner to begin drawing
dataarray of pixels
width
height

Definition at line 43 of file graphics.h.

◆ writePixel()

void writePixel ( Position  pos,
Color  color 
)

Draw single pixel.

Parameters
pos
color

Definition at line 30 of file graphics.h.