parent
3a2d18f731
commit
3f8fd07eb3
@ -0,0 +1,11 @@ |
||||
#version 430 |
||||
out vec4 color; |
||||
void main(void) |
||||
{ |
||||
color=vec4( |
||||
(gl_FragCoord.x - 300) / 5.f, |
||||
0.0, |
||||
5 - (gl_FragCoord.x - 300) / 5.f, |
||||
1.0 |
||||
); |
||||
} |
@ -0,0 +1,22 @@ |
||||
#pragma once |
||||
#include <string> |
||||
#include <fstream> |
||||
#include <GL/glew.h> |
||||
|
||||
namespace utils{ |
||||
inline std::string readShaderSource(const char *filePath){ |
||||
std::string content; |
||||
std::ifstream fileStream(filePath, std::ios::in); |
||||
std::string line = ""; |
||||
if(fileStream.fail()){ |
||||
std::cout<<"Could not open shader "<<filePath<<"!"<<std::endl; |
||||
throw; |
||||
} |
||||
while (fileStream.good()) { |
||||
getline(fileStream, line); |
||||
content.append(line + "\n"); |
||||
} |
||||
fileStream.close(); |
||||
return content; |
||||
} |
||||
} |
@ -0,0 +1,5 @@ |
||||
#version 430 |
||||
void main(void) |
||||
{ |
||||
gl_Position=vec4(0.0,0.0,0.0,1.0); |
||||
} |
Loading…
Reference in new issue