summaryrefslogtreecommitdiff
path: root/gfx.h
diff options
context:
space:
mode:
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