summaryrefslogtreecommitdiff
path: root/gfx.h
diff options
context:
space:
mode:
authorknolax <1339802534.kk@gmail.com>2017-02-28 11:07:10 -0500
committerknolax <1339802534.kk@gmail.com>2017-02-28 11:07:10 -0500
commit8eb0808fecb8c57eff877fddf38db91b1f067921 (patch)
tree1d7a5a795686e3c607ed93993c34c7a377b7c161 /gfx.h
initial commit, this is the gfx library which serves as a crappy wrapper for SDL.
Diffstat (limited to 'gfx.h')
-rw-r--r--gfx.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/gfx.h b/gfx.h
new file mode 100644
index 0000000..f2eb889
--- /dev/null
+++ b/gfx.h
@@ -0,0 +1,27 @@
+#ifndef GFX_H
+#define GFX_H
+#include <SDL2/SDL.h>
+#include <SDL2/SDL_opengl.h>
+#include <SDL2/SDL_ttf.h>
+#include <iostream>
+#include <string>
+//these are all global variables,
+extern SDL_Window *mwindow; // main window were everything foes
+extern SDL_DisplayMode * screen;
+extern SDL_GLContext context;
+extern SDL_Renderer * renderp;
+extern TTF_Font * fontp;
+extern int maxx;
+extern int maxy;
+int initgfx(int x, int y, const char * title);
+int cleargfx();
+int quitgfx();
+int updategfx();
+int drawimg(SDL_Rect r, SDL_Texture * tex);
+int drawimg(int x, int y, int w, int h,SDL_Texture * tex);
+int drawimg(int x, int y, int w, int h, const char * file);
+SDL_Texture * loadtexture(const char * file);
+int drawrect(int x, int y, int w, int h, const char *);
+int drawrect (int x, int y, int w, int h,int r, int g, int b, int a);
+int drawtext(int x, int y,const char * text, SDL_Color c);
+#endif