aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2018-05-25 20:14:54 +0200
committerAdrian Kummerlaender2018-05-25 20:14:54 +0200
commit8462bcc82e4845d24588eab4ef20be197ffd6c2e (patch)
treeb140b502a3ca2e011244245d3f1eb412798c05cd
parente516095a425d1c8d5bd9f9004416a6c19bcaf84f (diff)
downloadcomputicle-8462bcc82e4845d24588eab4ef20be197ffd6c2e.tar
computicle-8462bcc82e4845d24588eab4ef20be197ffd6c2e.tar.gz
computicle-8462bcc82e4845d24588eab4ef20be197ffd6c2e.tar.bz2
computicle-8462bcc82e4845d24588eab4ef20be197ffd6c2e.tar.lz
computicle-8462bcc82e4845d24588eab4ef20be197ffd6c2e.tar.xz
computicle-8462bcc82e4845d24588eab4ef20be197ffd6c2e.tar.zst
computicle-8462bcc82e4845d24588eab4ef20be197ffd6c2e.zip
Cleanup some unnecessary code
-rw-r--r--src/main.cc18
-rw-r--r--src/shader/vertex.glsl1
2 files changed, 5 insertions, 14 deletions
diff --git a/src/main.cc b/src/main.cc
index 71d1cbd..a691322 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -45,7 +45,7 @@ void updateMVP() {
);
glm::mat4 view = glm::lookAt(
- glm::vec3(0,0,20),
+ glm::vec3(0,0,1),
glm::vec3(0,0,0),
glm::vec3(0,1,0)
);
@@ -96,10 +96,6 @@ int main() {
return -1;
}
- glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
- glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
- glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
-
GLFWwindow* const window = glfwCreateWindow(window_width, window_height, "computicle", NULL, NULL);
if( window == nullptr ){
@@ -116,8 +112,6 @@ int main() {
return -1;
}
- glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE);
-
updateMVP();
for ( unsigned int i = 0; i < texture_count; ++i ) {
@@ -131,11 +125,8 @@ int main() {
GraphicShader sceneShader(VERTEX_SHADER_CODE, FRAGMENT_SHADER_CODE);
ComputeShader computeShader(
- getShaderFunction(
- "cos(v.x*sin(v.y))",
- "sin(v.x-v.y)"
- )
- );
+ getShaderFunction("cos(v.x*sin(v.y))",
+ "sin(v.x-v.y)"));
computeShader.workOn(particleBuffer->getBuffer());
GraphicShader displayShader(DISPLAY_VERTEX_SHADER_CODE,
@@ -147,7 +138,7 @@ int main() {
bool justRotated = true;
std::vector<GLuint> textures;
- for ( auto& textureBuffer : textureBuffers ) {
+ for ( const auto& textureBuffer : textureBuffers ) {
textures.emplace_back(textureBuffer->getTexture());
}
@@ -165,6 +156,7 @@ int main() {
std::rotate(textures.begin(), textures.end()-1, textures.end());
std::rotate(textureBuffers.begin(), textureBuffers.end()-1, textureBuffers.end());
justRotated = true;
+
lastRotate = std::chrono::high_resolution_clock::now();
}
diff --git a/src/shader/vertex.glsl b/src/shader/vertex.glsl
index 2d4009a..4c307d8 100644
--- a/src/shader/vertex.glsl
+++ b/src/shader/vertex.glsl
@@ -3,7 +3,6 @@ uniform mat4 MVP;
void main() {
gl_Position = MVP * vec4(gl_Vertex.xy, 0.0, 1.0);
- //gl_FrontColor = vec4(max(1. - gl_Vertex.z/5., 0.1), 0., 0., 0.);
gl_FrontColor = vec4(1., 0., 0., 0.);
}
)";