]> hackdaworld.org Git - my-code/api.git/commitdiff
added dfb api (just starting, not yet working ...)
authorhackbard <hackbard>
Sat, 2 Jul 2005 03:53:41 +0000 (03:53 +0000)
committerhackbard <hackbard>
Sat, 2 Jul 2005 03:53:41 +0000 (03:53 +0000)
CHANGELOG
dfb/dfb.c [new file with mode: 0644]
dfb/dfb.h [new file with mode: 0644]

index 2aacf064d134d2e126854ea57c9091c9a488d7f0..7711b5912363178eb72b2dbdc5b2ed4b17cb4eae 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,8 @@
+*) 2005-07-2
+
+ - remembered that there is a CHANGELOG, added dfb api
+   (not working yet)
+
 *) 2004-06-26
 
  - begin list api
diff --git a/dfb/dfb.c b/dfb/dfb.c
new file mode 100644 (file)
index 0000000..8be3eb9
--- /dev/null
+++ b/dfb/dfb.c
@@ -0,0 +1,20 @@
+/* dfbt.c -- direct framebuffer stuff
+ *
+ * author: hackbard@hackdaworld.org
+ *
+ */
+
+#include "dfb.h"
+
+int dfb_init(t_dfb *dfb,int outfd,int &arg_c,char *arg_v) {
+
+  dprintf(outfd,"[dfb] initializing dfb system ...\n");
+
+  dfb->outfd=outfd;
+
+  DFBInit(arg_c,arg_v);
+
+  DirectFBCreate(&(dfb->iface));
+  
+  return DFB_SUCCESS;
+}
diff --git a/dfb/dfb.h b/dfb/dfb.h
new file mode 100644 (file)
index 0000000..bf33003
--- /dev/null
+++ b/dfb/dfb.h
@@ -0,0 +1,37 @@
+/* dfb.h -- dfb headers */
+
+#ifndef DFB_H
+#define DFB_H
+
+/* includes */
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <directfb.h>
+
+#include "list.h"
+
+/* defines */
+#define DFB_SUCCESS 1
+#define DFB_ERROR -1
+
+/* specific variables */
+typedef struct s_dfb {
+  int outfd;
+  IDirectFB *iface;
+  IDirectFBSurface primary;
+  t_list image;
+  t_list video;
+  t_list font;
+  int max_x;
+  int max_y;
+  unsigned char mode;
+} t_dfb;
+
+/* function prototypes */
+int dfb_init(t_dfb *dfb,int outfd,int &arg_c,char *arg_v);
+
+#endif