PowerBlocks SDK
 
Loading...
Searching...
No Matches
framebuffer.h
Go to the documentation of this file.
1
12#pragma once
13
14#include <stdint.h>
15
17
18// Defines for some standards used across the video
19#define VIDEO_WIDTH 640
20#define VIDEO_HEIGHT 480
21
28typedef struct {
29 uint16_t pixels[VIDEO_HEIGHT][VIDEO_WIDTH];
31
42typedef struct {
43 const uint8_t* font_data;
44 vec2s16 character_size;
46
60extern void framebuffer_copy_rgba_into(framebuffer_t* framebuffer, const uint32_t *rgba, vec2i position, vec2i size);
61
73extern void framebuffer_fill_rgba(framebuffer_t* framebuffer, uint32_t rgba, vec2i a, vec2i b);
74
88extern void framebuffer_put_text(framebuffer_t* framebuffer, uint32_t foreground, uint32_t background, vec2i position, const framebuffer_font_t* font, const char* str);
void framebuffer_copy_rgba_into(framebuffer_t *framebuffer, const uint32_t *rgba, vec2i position, vec2i size)
Copys RGBA8888 data into a frame buffer.
Definition framebuffer.c:28
void framebuffer_put_text(framebuffer_t *framebuffer, uint32_t foreground, uint32_t background, vec2i position, const framebuffer_font_t *font, const char *str)
Renders a bitmap font to the framebuffer.
Definition framebuffer.c:272
void framebuffer_fill_rgba(framebuffer_t *framebuffer, uint32_t rgba, vec2i a, vec2i b)
Fills a section of the frame buffer with RGBA8888 data.
Definition framebuffer.c:160
Used to describe a font for the framebuffer to use.
Definition framebuffer.h:42
Data format for framebuffers.
Definition framebuffer.h:28
Definition vec2.h:17
Definition vec2.h:22
Simple 2D vectors.