Commit a5dd833c authored by Tim Übelhör's avatar Tim Übelhör

fixed activation of onscreen_render

parent 998e9819
......@@ -9,7 +9,7 @@
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/bin/scigl_viewer",
"args": ["${workspaceFolder}/model/monkey.blend"],
"args": ["${workspaceFolder}/model/project.dae"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
......
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
......@@ -54,9 +54,9 @@ int main(int argc, char *argv[])
ShaderBuilder shader_builder;
shader_builder.attach_vertex_shader(vs_source);
shader_builder.attach_fragment_shader(fs_source);
auto shader = shader_builder.build();
// auto shader = SingleColorShader::create_shader(0.75, 0, 1, 0);
OnscreenRender render(shader);
OnscreenRender onscreen_render;
onscreen_render.set_shader_program(shader_builder.build());
// Intrinsics of my shitty webcam
CameraIntrinsics camera_intrinsics = {};
camera_intrinsics.near = 0.01;
......@@ -103,7 +103,7 @@ int main(int argc, char *argv[])
}
old_enter_pressed = new_enter_pressed;
camera.pose = camera_pose.to_quaternion_pose();
render.next_frame(*context, camera, model, light);
onscreen_render.next_frame(*context, camera, model, light);
glfwPollEvents();
}
// Finally release the context
......
......@@ -16,6 +16,7 @@ void OnscreenRender::next_frame(
GLContext &gl_context, const CvCamera &camera,
const Model &model, const DiffuseLight &light)
{
shader.activate();
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment