#ifndef __RENDERING_H__ #define __RENDERING_H__ #include #include #include #include #include #include #include #include #include #include #include #include "light.hpp" #include "shader.hpp" #include "object.hpp" #include "multipass.hpp" //contains the context for the window and stuff for setting up the renderer to render stuff class rendering { public: // init SDL2 (create window after) bool SDLinit(); // init gl (after sdl init) bool GLinit(SDL_Window *window); //grab manifest and get shaders bool Shaderinit(); SDL_GLContext context; std::vector vertex_shaders; std::vector fragment_shaders; std::vector geometry_shaders; std::vector shaders; std::vector< std::reference_wrapper > objects; std::vector lights; GLuint quadVBO; GLuint quadVAO=0; GLuint rboDepth; GLint width; GLint height; GLuint depthCubemap; GLuint depthFBO; GLfloat farClipPlane=100; const GLuint SHADOW_WIDTH = 1024, SHADOW_HEIGHT = 1024; //temporary void render(camera cam, shader *depthshd, shader *shadowcalc, Gbuffer *gbuf); void renderlighting(GLuint pos, GLuint txc); /* sets up the textures for defered shading * tex 0 position * tex 1 normals * tex 2 diffuse (albedo) * tex 3 texcoord */ void setupTextureDS(Gbuffer gbuf); /* copies the depth buffer to the main one * */ void cpyDepthBuffer(GLuint buffer); void mkDepthBuffer(); void mkShadowCubemap(); private: SDL_Window *window; }; #endif