Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
nobuyuki83 committed May 13, 2024
1 parent c42eeb2 commit 33c7b88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/util_opengl.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
namespace acg {

std::string load_file_as_string(
const std::string &fname) {
std::ifstream inputFile1(fname.c_str());
const char* fname) {
std::ifstream inputFile1(fname);
std::istreambuf_iterator<char> vdataBegin(inputFile1);
std::istreambuf_iterator<char> vdataEnd;
return {vdataBegin, vdataEnd};
Expand Down
8 changes: 4 additions & 4 deletions task04/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ int main() {

int shaderProgram;
{ // compile shader program
std::string vrt_path = std::filesystem::path(PROJECT_SOURCE_DIR) / "shader.vert";
std::string frg_path = std::filesystem::path(PROJECT_SOURCE_DIR) / "shader.frag";
std::string vrt = acg::load_file_as_string(vrt_path); // read source code of vertex shader program
std::string frg = acg::load_file_as_string(frg_path); // read source code of fragment shader program
const auto vrt_path = std::filesystem::path(PROJECT_SOURCE_DIR) / "shader.vert";
const auto frg_path = std::filesystem::path(PROJECT_SOURCE_DIR) / "shader.frag";
std::string vrt = acg::load_file_as_string(vrt_path.string().c_str()); // read source code of vertex shader program
std::string frg = acg::load_file_as_string(frg_path.string().c_str()); // read source code of fragment shader program
shaderProgram = acg::create_shader_program(vrt, frg); // compile the shader on GPU
}
::glUseProgram(shaderProgram); // use the shader program
Expand Down

0 comments on commit 33c7b88

Please sign in to comment.