Files
NJU_PA/navy-apps/libs/libndl/include/NDL.h
tracer-ics2023 5b9f878839 > compile NEMU
221220000 张三
Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
 20:14:58 up 7 days, 20:15,  1 user,  load average: 0.27, 0.25, 0.22
2024-09-25 20:14:58 +08:00

31 lines
696 B
C

#ifndef __NDL_H__
#define __NDL_H__
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
int NDL_Init(uint32_t flags);
void NDL_Quit();
// 以毫秒为单位返回系统时间 return the current time in milliseconds
uint32_t NDL_GetTicks();
void NDL_OpenCanvas(int *w, int *h);
int NDL_PollEvent(char *buf, int len);
void NDL_DrawRect(uint32_t *pixels, int x, int y, int w, int h);
void NDL_OpenAudio(int freq, int channels, int samples);
void NDL_CloseAudio();
int NDL_PlayAudio(void *buf, int len);
int NDL_QueryAudio();
#define NDL_SCREEN_IDX(x, y, w, h) ( (w) * (y) + (x) )
#define NDL_SCREEN_POS(x, y, w, h) ( NDL_SCREEN_IDX(x, y, w, h) * 4 )
#ifdef __cplusplus
}
#endif
#endif