Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fwpl.git;a=commitdiff;h=71b6c6d2d4cbf7dcdf65f548075c89f571f2a657

commit 71b6c6d2d4cbf7dcdf65f548075c89f571f2a657
Author: James Buren <r...@frugalware.org>
Date:   Thu Sep 17 23:13:17 2009 -0500

graphics.c
* initial draft

diff --git a/src/graphics.c b/src/graphics.c
new file mode 100644
index 0000000..6b2240b
--- /dev/null
+++ b/src/graphics.c
@@ -0,0 +1,27 @@
+#include <gd.h>
+#include <stdlib.h>
+#include <iso646.h>
+#include <assert.h>
+#include "utility.h"
+#include "graphics.h"
+
+Image image_create(int width,int height) {
+  gdImagePtr image;
+
+  assert(width > 0 and height > 0);
+
+  image = gdImageCreateTrueColor(width,height);
+
+  if(!image) {
+    eprintf("Failed to allocate memory for image buffer.\n");
+    abort();
+  }
+
+  return image;
+}
+
+void image_destroy(Image image) {
+  assert(image);
+
+  gdImageDestroy(image);
+}
\ No newline at end of file
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to