diff options
author | majortom6 <tombarrett@siu.edu> | 2017-02-19 11:13:04 -0600 |
---|---|---|
committer | Tom Barrett <tombarrett@siu.edu> | 2017-03-07 13:23:41 -0600 |
commit | 379803180921534a42743c1c5fb40647015c3dba (patch) | |
tree | 9ede054a43a871ab6cdfcf17099d4acdb9e2f249 /inc | |
parent | fcf6abaccec7c7ed2fd306a9cf1ec378f303297c (diff) |
-removed rectdrawer
-removed unused shader
-cleaned up main and window
Diffstat (limited to 'inc')
-rw-r--r-- | inc/main.hpp | 1 | ||||
-rw-r--r-- | inc/opengl/rectdrawer.hpp | 47 | ||||
-rw-r--r-- | inc/opengl/shaders/basicshader.frag | 9 | ||||
-rw-r--r-- | inc/opengl/shaders/basicshader.geom | 33 | ||||
-rw-r--r-- | inc/opengl/shaders/basicshader.vert | 15 | ||||
-rw-r--r-- | inc/sdl/window.hpp | 13 |
6 files changed, 7 insertions, 111 deletions
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 <GL/glew.h>
-#include <vector>
-#include <iostream>
-#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<GraphicsData*> _gfxPtr; ///< This is for sorting
- std::vector<GraphicsData> _gfx; ///< These are the actual glyphs
- std::vector<RenderBatch> _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 |