Clone
2
put_pixel
odweta edited this page 2026-10-11 11:09:36 +02:00

Writes a pixel of the specified color to a framebuffer at the given coordinates.

void 
put_pixel(
    framebuffer_e framebuffer,
	unsigned int x, 
	unsigned int y, 
	uint32_t color
);
Parameter Description
framebuffer The framebuffer to write to. Either BASE or OVERDRAW.
x Horizontal pixel coordinate. From 0 to ame_state->width - 1 .
y Vertical pixel coordinate. From 0 to game_state->height - 1 .
color Pixel color. Format 0xRRGGBB
Return value none
Edge case Behavior
x or y is out of bounds The pixel does not get written and the engine gives a console warning.
Side effect Description
Pixel write Alters the contents of the given framebuffer if the coordinates are valid.
Note Description
Position in the engine pipeline This function is supposed to be called inside the function game_state->engine_update_framebuffer points to. The changes get rendered after that function ends. See Engine pipeline for the whole pipeline.