Fix title handling
This commit is contained in:
parent
3021529d92
commit
b7203383a7
3 changed files with 9 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
||||||
f←•Import "fenster.bqn"
|
f←•Import"fenster.bqn"
|
||||||
|
|
||||||
size←500
|
size←500
|
||||||
|
|
||||||
|
|
|
@ -19,14 +19,14 @@ fensterClose←FensterFFI""‿"fenster_close"‿">*:i8"
|
||||||
fensterSleep←FensterFFI""‿"fenster_sleep"‿">u32"
|
fensterSleep←FensterFFI""‿"fenster_sleep"‿">u32"
|
||||||
fensterTime←FensterFFI"u64"‿"fenster_time"
|
fensterTime←FensterFFI"u64"‿"fenster_time"
|
||||||
|
|
||||||
fensterInit←FensterFFI"*:i8"‿"fenster_init"‿"u32"‿"u32"‿"*u8:c8"
|
fensterInit←FensterFFI"*:i8"‿"fenster_init"‿"u32"‿"u32"‿"u32"‿"*u8:c8"
|
||||||
fensterGetWidth←FensterFFI"u32"‿"fenster_get_width"‿">*:i8"
|
fensterGetWidth←FensterFFI"u32"‿"fenster_get_width"‿">*:i8"
|
||||||
fensterGetHeight←FensterFFI"u32"‿"fenster_get_height"‿">*:i8"
|
fensterGetHeight←FensterFFI"u32"‿"fenster_get_height"‿">*:i8"
|
||||||
fensterGetPixel←FensterFFI"u32"‿"fenster_get_pixel"‿"*:i8"‿"u32"‿"u32"
|
fensterGetPixel←FensterFFI"u32"‿"fenster_get_pixel"‿"*:i8"‿"u32"‿"u32"
|
||||||
fensterSetPixel←FensterFFI""‿"fenster_set_pixel"‿"*:i8"‿"u32"‿"u32"‿"u32"
|
fensterSetPixel←FensterFFI""‿"fenster_set_pixel"‿"*:i8"‿"u32"‿"u32"‿"u32"
|
||||||
|
|
||||||
OpenWindow←{𝕊w‿h‿t:
|
OpenWindow←{𝕊w‿h‿t:
|
||||||
f←FensterInit w‿h‿t
|
f←FensterInit⟨w,h,1+≠t,t∾@⟩
|
||||||
FensterOpen f
|
FensterOpen f
|
||||||
FensterLoop f
|
FensterLoop f
|
||||||
f
|
f
|
||||||
|
|
8
lib.c
8
lib.c
|
@ -1,10 +1,14 @@
|
||||||
#include "fenster/fenster.h"
|
#include "fenster/fenster.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
struct fenster *fenster_init(int width, int height, char *title) {
|
struct fenster *fenster_init(int width, int height, int title_length,
|
||||||
|
char title[title_length]) {
|
||||||
uint32_t *buf = calloc(width * height, sizeof(uint32_t));
|
uint32_t *buf = calloc(width * height, sizeof(uint32_t));
|
||||||
|
char *title_init = malloc(title_length);
|
||||||
|
memcpy(title_init, title, title_length);
|
||||||
struct fenster f_init = {
|
struct fenster f_init = {
|
||||||
.title = title,
|
.title = title_init,
|
||||||
.width = width,
|
.width = width,
|
||||||
.height = height,
|
.height = height,
|
||||||
.buf = buf,
|
.buf = buf,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue