#ifndef FBN_H
#define FBN_H 1
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <GL/gl.h>
#include "TexFont.h"
#include <sys/ioctl.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/soundcard.h>
#define FBN_SND_STEREO 0
#define FBN_SND_SPEED 8000
#define FBN_SND_FORMAT AFMT_U8
#define MAX_SOUNDS 16
#define debug printf
#define output printf
#define FBN_SET_RGBA(COLOR, R, G, B, A) COLOR[0]=R; \
COLOR[1]=G; \
COLOR[2]=B; \
COLOR[3]=A;
#define FBN_SET_XYWH(POS, X, Y, W, H) POS.x=X; \
POS.y=Y; \
POS.w=W; \
POS.h=H;
typedef struct Sound_tag{
const char * sound_file;
void * data;
int data_length;
}Sound;
typedef struct SoundSet_tag{
int numsounds;
Sound sounds[MAX_SOUNDS];
} SoundSet;
typedef struct Camera_tag{
GLdouble eyex;
GLdouble eyey;
GLdouble eyez;
GLdouble centerx;
GLdouble centery;
GLdouble centerz;
GLdouble upx;
GLdouble upy;
GLdouble upz;
} Camera;
int fbnSoundInit();
void fbnSoundFini();
void fbnSoundLoadData(SoundSet *soundset);
void fbnSoundUnloadData(SoundSet *soundset);
void fbnSoundPlay(int sound_id, SoundSet *soundset);
void fbnSoundPlay_subthread(void *ptr);
void fbnSoundWait(void);
int fbnSizeofFile(const char *filename);
void fbnTxfGLStateSet(void);
void fbnTxfGLStateUnset(void);
void fbnTxfRenderString(char *screen_string, char *maxstring,
float x, float y, float w, float h,
float r, float g, float b, float a,
TexFont *txf);
void fbnTxfRenderStringExtruded(char *string, char *maxstring,
float center_x, float center_y,
float width, float height,
float extrude_x, float extrude_y,
int steps,
float fg_r,
float fg_g,
float fg_b,
float fg_a,
float bg_r,
float bg_g,
float bg_b,
float bg_a,
TexFont *txf);
void fbnSetPlaceString(char *placestring, int place);
int audio_fd;
#endif