Skip to content

Frame buffer backend for Nuklear using Cairo software rendering.

Notifications You must be signed in to change notification settings

seanpringle/nuklear_cairo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

nuklear_cairo

Frame buffer backend for Nuklear using Cairo software rendering.

int main(...) {
	// run once
	nk_cairo_init();
  
	// multiple fonts are fine
	struct nk_user_font *font = nk_cairo_ttf("path/to/font.ttf", 24);

	struct nk_context ctx;
	nk_init_default(&ctx, font);

	int width = 1000;
	int height = 1000;
	int pitch = width * sizeof(uint32_t);
	void *frame = malloc(height * pitch);

	nk_begin(&ctx, nk_rect(0, 0, width, height), ...);
		// usual Nuklear stuff
	nk_end(&ctx);

	nk_cairo_render(&ctx, frame, width, height, pitch);
	// now do what you like with frame
}

About

Frame buffer backend for Nuklear using Cairo software rendering.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages