Skip to content

Commit

Permalink
Convert tinyrenderer to example for ESW
Browse files Browse the repository at this point in the history
  • Loading branch information
wentasah committed Feb 26, 2024
1 parent f8feaa4 commit b7d0ab6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void tinyrender_init(int argc, char** argv)
int main(int argc, char** argv)
{
tinyrender_init(argc, argv);
thermobench_wrap(tinyrender_run);
tinyrender_run();
display_destroy();
return 0;
}
5 changes: 3 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
project('tinyrenderer', ['c', 'cpp'])

cxx = meson.get_compiler('cpp')

dep_scanner = dependency('wayland-scanner', native: true, disabler: true, required: false)
Expand Down Expand Up @@ -73,7 +75,6 @@ foreach wayland: [ false, true ]
dependencies : [
dependency('OpenMP', required : false),
] + (wayland ? [ dependency('wayland-client', version: '>= 1.17.0', disabler: true, required: false) ] : []),
link_with : libtbwrap,
cpp_args : cxx.get_supported_arguments(
[
'-std=c++14',
Expand All @@ -82,7 +83,7 @@ foreach wayland: [ false, true ]
'-Wno-non-virtual-dtor',
'-pedantic',
'-std=c++14',
'-O3',
'-O2',
'-fopenmp',
] + (wayland ? ['-DWITH_WAYLAND'] : [])),
)
Expand Down
2 changes: 1 addition & 1 deletion our_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void triangle(const vec4 clip_verts[3], IShader &shader, TGAImage &image, std::v
bboxmin[j] = std::max(0., std::min(bboxmin[j], pts2[i][j]));
bboxmax[j] = std::min(clamp[j], std::max(bboxmax[j], pts2[i][j]));
}
#pragma omp parallel for
//#pragma omp parallel for
for (int x=(int)bboxmin.x; x<=(int)bboxmax.x; x++) {
for (int y=(int)bboxmin.y; y<=(int)bboxmax.y; y++) {
vec3 bc_screen = barycentric(pts2, vec2(x, y));
Expand Down

0 comments on commit b7d0ab6

Please sign in to comment.