From 87d20801300e90423c17ad425364f77152eb88c3 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Fri, 1 May 2015 13:01:55 -0500 Subject: fixed directories and makefile --- Makefile | 5 +++-- img/Cbasic.png | Bin 0 -> 3081 bytes img/Rbasic.png | Bin 0 -> 1310 bytes inc/creature.h | 12 ++++++++++++ inc/entity.h | 20 ++++++++++++++++++++ inc/event.h | 21 +++++++++++++++++++++ inc/main.h | 10 ++++++++++ inc/resource.h | 12 ++++++++++++ inc/window.h | 24 ++++++++++++++++++++++++ 9 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 img/Cbasic.png create mode 100644 img/Rbasic.png create mode 100644 inc/creature.h create mode 100644 inc/entity.h create mode 100644 inc/event.h create mode 100644 inc/main.h create mode 100644 inc/resource.h create mode 100644 inc/window.h diff --git a/Makefile b/Makefile index 369b090..4dea6cc 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ -OBJS = src/main.cpp src/window.cpp src/entity.cpp src/event.cpp src/creature.cpp src/resource.cpp +OBJS = src/*.cpp +DEPS = inc/ CC = g++ -COMPILER_FLAGS = -w +COMPILER_FLAGS = -w -I$(DEPS) LINKER_FLAGS = -lSDL2 -lSDL2_image diff --git a/img/Cbasic.png b/img/Cbasic.png new file mode 100644 index 0000000..6d1f592 Binary files /dev/null and b/img/Cbasic.png differ diff --git a/img/Rbasic.png b/img/Rbasic.png new file mode 100644 index 0000000..9f668cf Binary files /dev/null and b/img/Rbasic.png differ diff --git a/inc/creature.h b/inc/creature.h new file mode 100644 index 0000000..5f5bb8d --- /dev/null +++ b/inc/creature.h @@ -0,0 +1,12 @@ +#ifndef creature_h +#define creature_h + +#include "entity.h" + +class Creature: public Entity +{ + public: + Creature(Window m, std::string s); +}; + +#endif diff --git a/inc/entity.h b/inc/entity.h new file mode 100644 index 0000000..1d16a2c --- /dev/null +++ b/inc/entity.h @@ -0,0 +1,20 @@ +#ifndef entity_h +#define entity_h + +#include "window.h" + +class Entity +{ + public: + void Place(); + SDL_Texture* loadTexture(std::string path, Window main); + + protected: + int x, y; + int height, width; + int degrees = 0; + SDL_Texture* texture; + SDL_Renderer* renderer; +}; + +#endif diff --git a/inc/event.h b/inc/event.h new file mode 100644 index 0000000..9ba7eea --- /dev/null +++ b/inc/event.h @@ -0,0 +1,21 @@ +#ifndef event_h +#define event_h + +#include "window.h" + +class Event +{ + public: + Event(); + int Poll(); + void off(); + bool gRun(); + SDL_Event& gEvent(); + int gEventType(); + + private: + bool run; + SDL_Event v; +}; + +#endif diff --git a/inc/main.h b/inc/main.h new file mode 100644 index 0000000..d026886 --- /dev/null +++ b/inc/main.h @@ -0,0 +1,10 @@ +#ifndef main_h +#define main_h + +#include "window.h" +#include "entity.h" +#include "event.h" +#include "creature.h" +#include "resource.h" + +#endif diff --git a/inc/resource.h b/inc/resource.h new file mode 100644 index 0000000..463f355 --- /dev/null +++ b/inc/resource.h @@ -0,0 +1,12 @@ +#ifndef resource_h +#define resource_h + +#include "entity.h" + +class Resource: public Entity +{ + public: + Resource(Window m, std::string s); +}; + +#endif diff --git a/inc/window.h b/inc/window.h new file mode 100644 index 0000000..fb1cf67 --- /dev/null +++ b/inc/window.h @@ -0,0 +1,24 @@ +#ifndef window_h +#define window_h + +#include +#include +#include +#include + +class Window +{ + public: + Window(); + void Destroy(); + + void Clear(); + void Render(); + SDL_Renderer* getRenderer(); + + private: + SDL_Window* main; + SDL_Renderer* renderer; +}; + +#endif -- cgit v1.2.3