From 379803180921534a42743c1c5fb40647015c3dba Mon Sep 17 00:00:00 2001 From: majortom6 Date: Sun, 19 Feb 2017 11:13:04 -0600 Subject: -removed rectdrawer -removed unused shader -cleaned up main and window --- inc/main.hpp | 1 - inc/opengl/rectdrawer.hpp | 47 ------------------------------------- inc/opengl/shaders/basicshader.frag | 9 ------- inc/opengl/shaders/basicshader.geom | 33 -------------------------- inc/opengl/shaders/basicshader.vert | 15 ------------ inc/sdl/window.hpp | 13 +++++----- 6 files changed, 7 insertions(+), 111 deletions(-) delete mode 100644 inc/opengl/rectdrawer.hpp delete mode 100644 inc/opengl/shaders/basicshader.frag delete mode 100644 inc/opengl/shaders/basicshader.geom delete mode 100644 inc/opengl/shaders/basicshader.vert (limited to 'inc') diff --git a/inc/main.hpp b/inc/main.hpp index 2a8ac44..56c8283 100644 --- a/inc/main.hpp +++ b/inc/main.hpp @@ -9,7 +9,6 @@ #include "sdl/window.hpp" #include "opengl/geoshader.hpp" -#include "opengl/rectdrawer.hpp" #include "opengl/spritebatch.hpp" #endif diff --git a/inc/opengl/rectdrawer.hpp b/inc/opengl/rectdrawer.hpp deleted file mode 100644 index f2ca1e5..0000000 --- a/inc/opengl/rectdrawer.hpp +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef rectdrawer_h -#define rectdrawer_h - - -#include -#include -#include -#include "geoshader.hpp" -#include "graphicsdata.hpp" -#include "spritebatch.hpp" - - -//merge this with spritebatch -class Rectdrawer -{ -public: - Rectdrawer(GeoShader theshader); - ~Rectdrawer(); - - - //void init(); - void begin(); - void end(); - void draw(const GraphicsData& gfxData); - void renderBatch(); - -private: - // Creates all the needed RenderBatches - void createRenderBatches(); - - - GLuint _vbo; - GLuint _vao; - - - std::vector _gfxPtr; ///< This is for sorting - std::vector _gfx; ///< These are the actual glyphs - std::vector _renderBatches; - - GeoShader shader; - - -}; - - -#endif - diff --git a/inc/opengl/shaders/basicshader.frag b/inc/opengl/shaders/basicshader.frag deleted file mode 100644 index 9aa9d0b..0000000 --- a/inc/opengl/shaders/basicshader.frag +++ /dev/null @@ -1,9 +0,0 @@ -#version 320 es -in highp vec3 fColor; -out highp vec4 outColor; - - -void main() -{ - outColor = vec4(fColor, 1.0); -} \ No newline at end of file diff --git a/inc/opengl/shaders/basicshader.geom b/inc/opengl/shaders/basicshader.geom deleted file mode 100644 index 3540d10..0000000 --- a/inc/opengl/shaders/basicshader.geom +++ /dev/null @@ -1,33 +0,0 @@ -#version 320 es -layout(points) in; -layout(line_strip, max_vertices = 64) out; - -in highp vec3 vColor[]; -in highp float vSides[]; -out highp vec3 fColor; - -const float PI = 3.1415926; - -void main() -{ - fColor = vColor[0]; - - for (int i = 0; i <= 4; i++) { // Angle between each side in radians - - vec4 offset = vec4(vSides[0] *.8,-vSides[0] *1.1, 0.0, 0.0); - if(i==1) - offset = vec4(vSides[0] *.8,vSides[0] *1.1, 0.0, 0.0); - if(i==2) - offset = vec4(-vSides[0] *.8,vSides[0] *1.1, 0.0, 0.0); - if(i==3) - offset = vec4(-vSides[0] *.8,-vSides[0] *1.1, 0.0, 0.0); - if(i==4) - offset = vec4(vSides[0] *.8,-vSides[0] *1.1, 0.0, 0.0); - - - gl_Position = gl_in[0].gl_Position - offset; - - EmitVertex(); - } - EndPrimitive(); -} diff --git a/inc/opengl/shaders/basicshader.vert b/inc/opengl/shaders/basicshader.vert deleted file mode 100644 index f17aef5..0000000 --- a/inc/opengl/shaders/basicshader.vert +++ /dev/null @@ -1,15 +0,0 @@ -#version 320 es -in highp vec2 pos; -in highp vec3 color; -in highp float sides; -uniform mat4 MVP; - -out highp vec3 fColor; -out highp float vSides; - -void main() -{ - gl_Position = MVP * vec4(pos, 0.0, 1.0); - fColor = color; - vSides = sides; -} diff --git a/inc/sdl/window.hpp b/inc/sdl/window.hpp index fc0f325..64b4e7b 100644 --- a/inc/sdl/window.hpp +++ b/inc/sdl/window.hpp @@ -12,16 +12,17 @@ class Window { public: Window(int width, int height, const std::string& title); - void Clear(float r, float g, float b, float a); - void swapBuffers(); - bool getClosed(){return closed;}; + ~Window(); + + void Clear(); + void swapBuffers(); + bool getClosed(){return closed;}; - virtual ~Window(); private: SDL_Window* main; - SDL_GLContext glContext; - bool closed; + SDL_GLContext glContext; + bool closed; }; #endif -- cgit v1.2.3