Skip to content
Snippets Groups Projects
Commit 2d360229 authored by Dethcrvsh's avatar Dethcrvsh
Browse files

wip

parent 6a2f2873
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ set(COMMON_SOURCES ...@@ -19,7 +19,7 @@ set(COMMON_SOURCES
common/Linux/MicroGlut.c common/Linux/MicroGlut.c
) )
file(GLOB_RECURSE SRC_SOURCES src/*.cpp src/*.c) file(GLOB_RECURSE SRC_SOURCES src/*.cpp src/*.c src/*.h)
set(SOURCES ${COMMON_SOURCES} ${SRC_SOURCES}) set(SOURCES ${COMMON_SOURCES} ${SRC_SOURCES})
......
...@@ -8,6 +8,10 @@ uniform mat4 projectionMatrix; ...@@ -8,6 +8,10 @@ uniform mat4 projectionMatrix;
uniform mat4 modelToWorldToView; uniform mat4 modelToWorldToView;
uniform float time; uniform float time;
// layout(std140) uniform VertexBuffer {
// Wave waves_b[16];
// };
out vec3 world_pos; out vec3 world_pos;
out vec3 normal; out vec3 normal;
...@@ -57,7 +61,6 @@ vec3 get_waves(const vec3 pos, const float t) { ...@@ -57,7 +61,6 @@ vec3 get_waves(const vec3 pos, const float t) {
} }
return offset + vec3(pos.x, 0.0, pos.z); return offset + vec3(pos.x, 0.0, pos.z);
} }
/* Get the normal for a wave */ /* Get the normal for a wave */
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "LoadTGA.h" #include "LoadTGA.h"
#include "MicroGlut.h" #include "MicroGlut.h"
#include "VectorUtils4.h" #include "VectorUtils4.h"
#include "waves.h"
// uses framework OpenGL // uses framework OpenGL
// uses framework Cocoa // uses framework Cocoa
...@@ -256,6 +257,8 @@ int main(int argc, char* argv[]) ...@@ -256,6 +257,8 @@ int main(int argc, char* argv[])
glutMotionFunc(on_mouse_move); glutMotionFunc(on_mouse_move);
glutMouseFunc(on_mouse_button); glutMouseFunc(on_mouse_button);
Waves::init();
glutMainLoop(); glutMainLoop();
exit(0); exit(0);
} }
#include <iostream>
#include "waves.h"
#include <GL/gl.h>
namespace Waves {
GLuint ubo;
void init() {
glGenBuffers(1, &ubo);
glBindBuffer(GL_UNIFORM_BUFFER, ubo);
glBufferData(GL_UNIFORM_BUFFER, sizeof(Wave) * 16, nullptr, GL_DYNAMIC_DRAW);
}
};
#pragma once
namespace Waves {
void init();
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment